Commit 15e3b6a6 authored by norhalimah's avatar norhalimah

fixed..

parent d5cdb71a
...@@ -173,7 +173,7 @@ class Quiz extends React.Component { ...@@ -173,7 +173,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
// console.log('finish'); // console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -186,7 +186,7 @@ class Quiz extends React.Component { ...@@ -186,7 +186,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
// console.log('finish'); // console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -204,7 +204,7 @@ class Quiz extends React.Component { ...@@ -204,7 +204,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -217,7 +217,7 @@ class Quiz extends React.Component { ...@@ -217,7 +217,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
//console.log('finish'); //console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -235,7 +235,7 @@ class Quiz extends React.Component { ...@@ -235,7 +235,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
// console.log('finish'); // console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -248,7 +248,7 @@ class Quiz extends React.Component { ...@@ -248,7 +248,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
// console.log('finish'); // console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -266,7 +266,7 @@ class Quiz extends React.Component { ...@@ -266,7 +266,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
// console.log('finish'); // console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -279,7 +279,7 @@ class Quiz extends React.Component { ...@@ -279,7 +279,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
// console.log('finish'); // console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -297,7 +297,7 @@ class Quiz extends React.Component { ...@@ -297,7 +297,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -310,7 +310,7 @@ class Quiz extends React.Component { ...@@ -310,7 +310,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
// console.log('finish'); // console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -328,7 +328,7 @@ class Quiz extends React.Component { ...@@ -328,7 +328,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
// console.log('finish'); // console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -341,7 +341,7 @@ class Quiz extends React.Component { ...@@ -341,7 +341,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
// console.log('finish'); // console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -359,7 +359,7 @@ class Quiz extends React.Component { ...@@ -359,7 +359,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -372,7 +372,7 @@ class Quiz extends React.Component { ...@@ -372,7 +372,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
console.log('finish'); console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -390,7 +390,7 @@ class Quiz extends React.Component { ...@@ -390,7 +390,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -403,7 +403,7 @@ class Quiz extends React.Component { ...@@ -403,7 +403,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -421,7 +421,7 @@ class Quiz extends React.Component { ...@@ -421,7 +421,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
//console.log('finish'); //console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -434,7 +434,7 @@ class Quiz extends React.Component { ...@@ -434,7 +434,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
//console.log('finish'); //console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -452,7 +452,7 @@ class Quiz extends React.Component { ...@@ -452,7 +452,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
//console.log('finish'); //console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -465,7 +465,7 @@ class Quiz extends React.Component { ...@@ -465,7 +465,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
//console.log('finish'); //console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -483,7 +483,7 @@ class Quiz extends React.Component { ...@@ -483,7 +483,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
//console.log('finish'); //console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -496,7 +496,7 @@ class Quiz extends React.Component { ...@@ -496,7 +496,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
//console.log('finish'); //console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -514,7 +514,7 @@ class Quiz extends React.Component { ...@@ -514,7 +514,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -527,7 +527,7 @@ class Quiz extends React.Component { ...@@ -527,7 +527,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -545,7 +545,7 @@ class Quiz extends React.Component { ...@@ -545,7 +545,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
// console.log('finish'); // console.log('finish');
this.backAction(); //this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -558,7 +558,7 @@ class Quiz extends React.Component { ...@@ -558,7 +558,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -576,7 +576,7 @@ class Quiz extends React.Component { ...@@ -576,7 +576,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime); this.handlerArgCall((this.state.correct + 1), this.state.wrong, stime);
// console.log('finish'); // console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
keywordsList.splice(0, keywordsList.length); keywordsList.splice(0, keywordsList.length);
...@@ -589,7 +589,7 @@ class Quiz extends React.Component { ...@@ -589,7 +589,7 @@ class Quiz extends React.Component {
this.setState({showDone: true}); this.setState({showDone: true});
this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime); this.handlerArgCall(this.state.correct, (this.state.wrong + 1), stime);
//console.log('finish'); //console.log('finish');
this.backAction(); // this.backAction();
} }
else { else {
this.setState({showW: true}); this.setState({showW: true});
...@@ -614,8 +614,9 @@ class Quiz extends React.Component { ...@@ -614,8 +614,9 @@ class Quiz extends React.Component {
}; };
backAction = () => { backAction = () => {
this.props.navigation.navigate('1'); this.setState({showDone: false});
Orientation.lockToPortrait(); this.props.navigation.navigate('1');
Orientation.lockToPortrait();
}; };
componentDidMount() { componentDidMount() {
...@@ -753,7 +754,6 @@ this.setState({records: []}); ...@@ -753,7 +754,6 @@ this.setState({records: []});
}; };
render() { render() {
BackHandler.addEventListener('hardwareBackPress', this.homeExit);
const { const {
selectedKeywordStyle, selectedKeywordStyle,
buttonStyle, buttonStyle,
...@@ -867,11 +867,11 @@ this.setState({records: []}); ...@@ -867,11 +867,11 @@ this.setState({records: []});
<View style={{backgroundColor: '#000000aa', flex: 1}}> <View style={{backgroundColor: '#000000aa', flex: 1}}>
<View <View
style={{ style={{
marginTop: Dimensions.get('window').height * 0.6, marginTop: Dimensions.get('window').height * 0.25,
marginLeft: Dimensions.get('window').width * 0.05,
backgroundColor: 'white', backgroundColor: 'white',
width : Dimensions.get('window').width * 0.4,
borderRadius: 5, borderRadius: 5,
marginLeft: Dimensions.get('window').width * 0.3,
width : Dimensions.get('window').width * 0.4,
}}> }}>
<Text style={{fontSize: 20, margin:10}}>Well Done</Text> <Text style={{fontSize: 20, margin:10}}>Well Done</Text>
<Text style={{fontSize: 15, marginLeft:10, color: 'green'}}>Correct : {this.state.correct}</Text> <Text style={{fontSize: 15, marginLeft:10, color: 'green'}}>Correct : {this.state.correct}</Text>
...@@ -886,7 +886,7 @@ this.setState({records: []}); ...@@ -886,7 +886,7 @@ this.setState({records: []});
borderRadius: 5, borderRadius: 5,
margin : 10, margin : 10,
}} }}
onPress={() => this.setState({showDone: false})}> onPress={() => this.backAction()}>
<Text style={{color: 'white'}}>OK</Text> <Text style={{color: 'white'}}>OK</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
......
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