Added basic rule system

This commit is contained in:
2021-01-05 23:31:58 +01:00
parent 83544a28be
commit 71095cd5b8
4 changed files with 68 additions and 16 deletions

View File

@ -51,7 +51,9 @@ function updateSubmitTimer() {
function startSubmitTimer(time) {
state.submitTimer = time || 30
state.submitTimer = time || state.submitTime
if (state.submitTimer == null)
return
console.log('Setting submitTimer to ' + state.submitTimer + ' seconds.')
@ -139,21 +141,20 @@ function reStartQuiz() {
}
function createQuiz() {
function createQuiz(e) {
e.preventDefault()
console.log('Creating new quiz')
state.title = document.getElementById('titleField').value
if (state.title == '') {
alert('Please enter a title')
return
}
clearState()
removeLink()
state.title = document.getElementById('titleField').value
state.style = document.getElementById('styleField').value
if (parseSpreadsheet().success == false) {
console.log('Quiz creation failed.')
alert('Quiz creation failed.')
return
}
@ -165,6 +166,8 @@ function createQuiz() {
console.log('Quiz created')
return false
}