|
|
@ -32,15 +32,30 @@ const styles = StyleSheet.create({ |
|
|
|
}, |
|
|
|
box: { |
|
|
|
position: "absolute", |
|
|
|
top: (screen.height/2)-220, |
|
|
|
width: screen.width-80, |
|
|
|
top: screen.width/4, |
|
|
|
left: 40, |
|
|
|
width: screen.width-80, |
|
|
|
borderRadius: 15, |
|
|
|
backgroundColor: colors.white_alpha, |
|
|
|
borderColor: colors.white, |
|
|
|
borderWidth: 4, |
|
|
|
paddingVertical: 30 |
|
|
|
}, |
|
|
|
boxCorrect: { |
|
|
|
borderColor: colors.green, |
|
|
|
}, |
|
|
|
boxWrong: { |
|
|
|
borderColor: colors.red, |
|
|
|
}, |
|
|
|
boxUnsafe: { |
|
|
|
borderColor: colors.orange, |
|
|
|
}, |
|
|
|
button: { |
|
|
|
position: "absolute", |
|
|
|
bottom: 40, |
|
|
|
left: 40, |
|
|
|
width: screen.width-80 |
|
|
|
}, |
|
|
|
text: { |
|
|
|
color: colors.white, |
|
|
|
fontSize: 22, |
|
|
@ -101,9 +116,11 @@ class Results extends React.Component { |
|
|
|
const currentResults = this.props.navigation.getParam("results") |
|
|
|
const percentage = currentResults.total ? (100/currentResults.total) * currentResults.correct : 0 |
|
|
|
let resultStyle = currentResults.points >= 80 ? currentResults.points >= 85 ? styles.correct : styles.unsafe : styles.wrong |
|
|
|
let boxStyle = currentResults.points >= 80 ? currentResults.points >= 85 ? styles.boxCorrect : styles.boxUnsafe : styles.boxWrong |
|
|
|
|
|
|
|
if(!currentResults.isExam) { |
|
|
|
resultStyle = percentage >= 80 ? percentage >= 85 ? styles.correct : styles.unsafe : styles.wrong |
|
|
|
boxStyle = percentage >= 80 ? percentage >= 85 ? styles.boxCorrect : styles.boxUnsafe : styles.boxWrong |
|
|
|
} |
|
|
|
|
|
|
|
console.log(currentResults) |
|
|
@ -124,7 +141,7 @@ class Results extends React.Component { |
|
|
|
</View> |
|
|
|
|
|
|
|
<SafeAreaView style={styles.safearea}> |
|
|
|
<View style={styles.box}> |
|
|
|
<View style={[styles.box, boxStyle]}> |
|
|
|
<Text style={styles.text}> |
|
|
|
<Text style={styles.textLabel}>{`${texts.corrects}: ${currentResults.correct}`}</Text> |
|
|
|
</Text> |
|
|
@ -145,6 +162,19 @@ class Results extends React.Component { |
|
|
|
} |
|
|
|
</View> |
|
|
|
|
|
|
|
<View style={styles.button}> |
|
|
|
<Button |
|
|
|
text={texts.restart} |
|
|
|
onPress={() => { |
|
|
|
this.props.navigation.navigate("Splash", { |
|
|
|
title: texts.section_quizzes, |
|
|
|
color: colors.blue |
|
|
|
})} |
|
|
|
} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
</SafeAreaView> |
|
|
|
|
|
|
|
</View> |
|
|
|