WIAI-Weihnachtsquiz
-Herzlichen Glückwunsch!
Du hast insgesamt {{score}} Punkte erzielt.
Herzlichen Glückwunsch!
Du hast insgesamt {{score}} von {{questions.length * 3}} möglichen Punkten erzielt.
Jammerschade!
Beim nächsten Mal klappt es sicher besser.
(Korrekt)' - estimateDisplay.innerHTML = this.currentEstimate + '
(Geschätzt)' + correctResultDisplay.innerHTML = `${this.currentQuestion.correctAnswer}
(Korrekt)` + estimateDisplay.innerHTML = `${this.currentEstimate}
(Geschätzt)` if (this.currentEstimate < this.currentQuestion.correctAnswer) { correctResultDisplay.style.left = 100 + '%' @@ -80,13 +83,15 @@ const app = new Vue({ const x50 = this.currentQuestion.correctAnswer * 0.5 const x150 = this.currentQuestion.correctAnswer * 1.5 + this.currentScore = 0 if (this.currentEstimate >= x90 && this.currentEstimate <= x110) { - this.addToScore(3) + this.currentScore = 3 } else if (this.currentEstimate >= x75 && this.currentEstimate <= x125) { - this.addToScore(2) + this.currentScore = 2 } else if (this.currentEstimate >= x50 && this.currentEstimate <= x150) { - this.addToScore(1) + this.currentScore = 1 } + this.addToScore(this.currentScore) } } }, diff --git a/js/questions.js b/js/questions.js index cb4b451..f30dda1 100644 --- a/js/questions.js +++ b/js/questions.js @@ -44,4 +44,4 @@ const questionCatalog = [ text: 'Wie viele wissenschaftliche Mitarbeiter:innen und Postdocs treiben die Forschung und die Lehre an unserer Fakultät voran? (externe Doktorand:innen ausgeschlossen)', correctAnswer: 74 } -] \ No newline at end of file +]