Commit 4a8f1f62 authored by norhalimah's avatar norhalimah

still updating...

parent 75ca5165
...@@ -91,6 +91,7 @@ class Listen extends React.Component { ...@@ -91,6 +91,7 @@ class Listen extends React.Component {
records: [], records: [],
choose : octavelist, choose : octavelist,
soundName : '', soundName : '',
keynumber: 0,
}; };
} }
...@@ -98,6 +99,17 @@ class Listen extends React.Component { ...@@ -98,6 +99,17 @@ class Listen extends React.Component {
console.log('Press: ' + keyword); console.log('Press: ' + keyword);
//indexS = Listennotes.findIndex(item=> item.name === keyword); //indexS = Listennotes.findIndex(item=> item.name === keyword);
console.log(Listennotes[indexS].name); console.log(Listennotes[indexS].name);
if (this.state.keynumber === 0) {
this.playButton();
this.setState({keynumber : this.state.keynumber + 1});
}
if (this.state.keynumber === 1) {
this.answer(keyword);
this.setState({keynumber : 0});
}
};
answer = (keyword) => {
if (keyword === Listennotes[indexS].name) { if (keyword === Listennotes[indexS].name) {
this.correctAlert(); this.correctAlert();
if ( (this.state.count + 1) > this.state.maxCount) { if ( (this.state.count + 1) > this.state.maxCount) {
...@@ -126,7 +138,6 @@ class Listen extends React.Component { ...@@ -126,7 +138,6 @@ class Listen extends React.Component {
} }
}; };
listenRecord = async(correct, wrong, timer) => { listenRecord = async(correct, wrong, timer) => {
var listR = []; var listR = [];
let obj = { let obj = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment