Introduce timer skip/bypass using Ctrl+Shift (Resolves #10)
This commit is contained in:
parent
314c9e8c67
commit
64ca89eefb
@ -2,7 +2,7 @@ ChooseAny Which Materials can be used to fabricate the brake pedal? "Steel
|
|||||||
Aluminium
|
Aluminium
|
||||||
Titanum
|
Titanum
|
||||||
All the above" "1
|
All the above" "1
|
||||||
2" 0.3
|
2" 3
|
||||||
ChooseOne What is depicted on the picture "7 speed double clutch transmission for AWD
|
ChooseOne What is depicted on the picture "7 speed double clutch transmission for AWD
|
||||||
8 speed double clutch transmission for AWD
|
8 speed double clutch transmission for AWD
|
||||||
7 speed double clutch transmission for 2WD
|
7 speed double clutch transmission for 2WD
|
||||||
|
|
18
web/quiz.js
18
web/quiz.js
@ -54,6 +54,18 @@ function startTotalTimer() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function skipWaitNextQuestion(event) {
|
||||||
|
|
||||||
|
if (!event.ctrlKey || !event.shiftKey)
|
||||||
|
return
|
||||||
|
|
||||||
|
console.log('Skipping/Bypassing wait timer')
|
||||||
|
|
||||||
|
state.submitTimer = 0
|
||||||
|
updateSubmitTimer()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function updateSubmitInfo() {
|
function updateSubmitInfo() {
|
||||||
|
|
||||||
var button = document.getElementById('quizSubmitButton')
|
var button = document.getElementById('quizSubmitButton')
|
||||||
@ -63,13 +75,15 @@ function updateSubmitInfo() {
|
|||||||
if (state.submitTimer > 0) {
|
if (state.submitTimer > 0) {
|
||||||
si.innerHTML = state.waitNextQuestion ? 'Waiting for next question' : 'Wait to retry'
|
si.innerHTML = state.waitNextQuestion ? 'Waiting for next question' : 'Wait to retry'
|
||||||
button.value = 'Wait ' + formatTime(state.submitTimer)
|
button.value = 'Wait ' + formatTime(state.submitTimer)
|
||||||
button.disabled = true
|
button.readOnly = true
|
||||||
|
button.addEventListener('click', skipWaitNextQuestion)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
si.innerHTML = ''
|
si.innerHTML = ''
|
||||||
button.disabled = false
|
button.readOnly = false
|
||||||
|
button.removeEventListener('click', skipWaitNextQuestion)
|
||||||
|
|
||||||
if (getRule('questionTimeout')) {
|
if (getRule('questionTimeout')) {
|
||||||
if (state.submitTimer > 0) {
|
if (state.submitTimer > 0) {
|
||||||
|
@ -84,7 +84,7 @@ input[type="button"].center, input[type="submit"].center {
|
|||||||
float: none;
|
float: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="button"]:disabled, input[type="submit"]:disabled {
|
input[type="button"][readonly], input[type="submit"][readonly] {
|
||||||
cursor: auto;
|
cursor: auto;
|
||||||
background: #888 !important;
|
background: #888 !important;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user