Introduce timer skip/bypass using Ctrl+Shift (Resolves #10)
This commit is contained in:
		
							
								
								
									
										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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user