Fix #11 by remembering whether results are shown in state
This commit is contained in:
parent
0a9055431f
commit
095716c2eb
|
@ -282,6 +282,7 @@ function reStartQuiz() {
|
||||||
state.totalTimer = defaultState.totalTimer
|
state.totalTimer = defaultState.totalTimer
|
||||||
state.totalInterval = defaultState.totalInterval
|
state.totalInterval = defaultState.totalInterval
|
||||||
state.fsaTeamCountTroll = defaultState.fsaTeamCountTroll
|
state.fsaTeamCountTroll = defaultState.fsaTeamCountTroll
|
||||||
|
state.resultsShown = defaultState.resultsShown
|
||||||
|
|
||||||
changeView('prescreen')
|
changeView('prescreen')
|
||||||
|
|
||||||
|
@ -351,6 +352,10 @@ function showQuizResults() {
|
||||||
|
|
||||||
changeView('quiz')
|
changeView('quiz')
|
||||||
|
|
||||||
|
// Prevent result metadata being added more than once
|
||||||
|
if (state.resultsShown)
|
||||||
|
return
|
||||||
|
|
||||||
for (var [idx, value] of state.responses.entries()) {
|
for (var [idx, value] of state.responses.entries()) {
|
||||||
|
|
||||||
console.log(idx + ':', value)
|
console.log(idx + ':', value)
|
||||||
|
@ -399,6 +404,8 @@ function showQuizResults() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state.resultsShown = true
|
||||||
|
|
||||||
document.querySelector('#fsateamcounttroll').innerHTML = ''
|
document.querySelector('#fsateamcounttroll').innerHTML = ''
|
||||||
document.querySelector('#submitinfo').innerHTML = ''
|
document.querySelector('#submitinfo').innerHTML = ''
|
||||||
document.querySelector('#quizSubmitButton').value = 'Back'
|
document.querySelector('#quizSubmitButton').value = 'Back'
|
||||||
|
|
|
@ -16,7 +16,8 @@ const defaultState = {
|
||||||
questionStartTotalTimer: 0,
|
questionStartTotalTimer: 0,
|
||||||
totalTimer: 0,
|
totalTimer: 0,
|
||||||
totalInterval: null,
|
totalInterval: null,
|
||||||
fsaTeamCountTroll: 0
|
fsaTeamCountTroll: 0,
|
||||||
|
resultsShown: false
|
||||||
}
|
}
|
||||||
|
|
||||||
var state
|
var state
|
||||||
|
|
Loading…
Reference in New Issue