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
|
||||
Titanum
|
||||
All the above" "1
|
||||
2" 0.3
|
||||
2" 3
|
||||
ChooseOne What is depicted on the picture "7 speed double clutch transmission for AWD
|
||||
8 speed double clutch transmission for AWD
|
||||
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() {
|
||||
|
||||
var button = document.getElementById('quizSubmitButton')
|
||||
@ -63,13 +75,15 @@ function updateSubmitInfo() {
|
||||
if (state.submitTimer > 0) {
|
||||
si.innerHTML = state.waitNextQuestion ? 'Waiting for next question' : 'Wait to retry'
|
||||
button.value = 'Wait ' + formatTime(state.submitTimer)
|
||||
button.disabled = true
|
||||
button.readOnly = true
|
||||
button.addEventListener('click', skipWaitNextQuestion)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
si.innerHTML = ''
|
||||
button.disabled = false
|
||||
button.readOnly = false
|
||||
button.removeEventListener('click', skipWaitNextQuestion)
|
||||
|
||||
if (getRule('questionTimeout')) {
|
||||
if (state.submitTimer > 0) {
|
||||
|
@ -84,7 +84,7 @@ input[type="button"].center, input[type="submit"].center {
|
||||
float: none;
|
||||
}
|
||||
|
||||
input[type="button"]:disabled, input[type="submit"]:disabled {
|
||||
input[type="button"][readonly], input[type="submit"][readonly] {
|
||||
cursor: auto;
|
||||
background: #888 !important;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user