Browse Source

fix bad timer and icon

master
Dslak 6 years ago
parent
commit
b82dc11538
  1. 6
      vds-app/App/screens/Exam.js
  2. 2
      vds-app/app.json

6
vds-app/App/screens/Exam.js

@ -70,8 +70,10 @@ class Exam extends React.Component {
return nextState return nextState
}, },
() => { () => {
if(this.state.timer > 1 || (this.state.correctCount+this.state.wrongCount) < this.state.totalCount) {
setTimeout(() => this.nextQuestion(), 750) setTimeout(() => this.nextQuestion(), 750)
} }
}
) )
} }
@ -79,7 +81,7 @@ class Exam extends React.Component {
this.setState( (state) => { this.setState( (state) => {
const updatedIndexes = state.availableIds.filter( item => item != state.activeQuestionId) const updatedIndexes = state.availableIds.filter( item => item != state.activeQuestionId)
const nextId = updatedIndexes[Math.floor(Math.random() * updatedIndexes.length)] const nextId = updatedIndexes[Math.floor(Math.random() * updatedIndexes.length)]
let resultsShow = this.state.timer <= 1 || false
let resultsShow = (this.state.timer <= 1 || (this.state.correctCount+this.state.wrongCount) == this.state.totalCount) ? true : false
if (!updatedIndexes.length) { if (!updatedIndexes.length) {
resultsShow = true resultsShow = true
@ -112,7 +114,7 @@ class Exam extends React.Component {
}, 1000) }, 1000)
} }
if(this.state.timer < 1) {
if(this.state.timer < 1 || (this.state.correctCount+this.state.wrongCount) == this.state.totalCount) {
clearInterval(interval) clearInterval(interval)
setTimeout( () => { setTimeout( () => {
this.props.navigation.popToTop() this.props.navigation.popToTop()

2
vds-app/app.json

@ -7,7 +7,7 @@
"platforms": ["ios", "android"], "platforms": ["ios", "android"],
"version": "1.0.0", "version": "1.0.0",
"orientation": "portrait", "orientation": "portrait",
"icon": "./assets/logo.png",
"icon": "./assets/icon.png",
"splash": { "splash": {
"image": "./assets/splash.png", "image": "./assets/splash.png",
"resizeMode": "cover", "resizeMode": "cover",

Loading…
Cancel
Save