Compare commits

...

2 Commits

2 changed files with 9 additions and 2 deletions

View File

@ -547,6 +547,11 @@ window.onload = async function() {
state.submitTime = quiz.submitTime
state.id = urlId
// Workaround for quizzes that were saved before the fix
// Where the stored value is null instead of Infinity
if (state.style == 'FSCzech')
state.submitTries = Infinity
changeView('prescreen')
}

View File

@ -52,7 +52,7 @@ async function shareQuiz() {
var response = await fetch(db, {
method: 'POST',
headers: {'Content-Type': 'text/plain'},
body: JSON.stringify(quizData)
body: JSON.stringify(quizData, (k,v) => (v == Infinity) ? '__Infinity' : v)
})
if (response.ok == false) {
@ -92,7 +92,9 @@ async function fetchQuiz(id) {
return
}
var json = await response.json()
var text = await response.text()
var json = JSON.parse(text, (k,v) => (v == '__Infinity') ? Infinity : v)
console.log('Quiz fetched. Response:')
console.log(json)