Commit 4a8f1f62 authored by norhalimah's avatar norhalimah

still updating...

parent 75ca5165
......@@ -91,6 +91,7 @@ class Listen extends React.Component {
records: [],
choose : octavelist,
soundName : '',
keynumber: 0,
};
}
......@@ -98,7 +99,18 @@ class Listen extends React.Component {
console.log('Press: ' + keyword);
//indexS = Listennotes.findIndex(item=> item.name === keyword);
console.log(Listennotes[indexS].name);
if (keyword === 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) {
this.correctAlert();
if ( (this.state.count + 1) > this.state.maxCount) {
this.setState({correct : this.state.correct + 1});
......@@ -126,7 +138,6 @@ class Listen extends React.Component {
}
};
listenRecord = async(correct, wrong, timer) => {
var listR = [];
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