Reset state after quiz
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
var state = {
|
const defaultState = {
|
||||||
style: 'FSCzech',
|
style: 'FSCzech',
|
||||||
id: null,
|
id: null,
|
||||||
title: null,
|
title: null,
|
||||||
@ -8,6 +8,8 @@ var state = {
|
|||||||
success: 0
|
success: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var state = defaultState
|
||||||
|
|
||||||
|
|
||||||
function changeView(view) {
|
function changeView(view) {
|
||||||
|
|
||||||
@ -249,6 +251,8 @@ function endQuiz() {
|
|||||||
if (state.interval)
|
if (state.interval)
|
||||||
clearInterval(state.interval)
|
clearInterval(state.interval)
|
||||||
|
|
||||||
|
state = defaultState
|
||||||
|
|
||||||
console.log('Quiz ended')
|
console.log('Quiz ended')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user