Merge branch 'yoyo'

This commit is contained in:
Yoan Guerin
2025-12-05 05:11:14 +01:00
3 changed files with 13 additions and 0 deletions

View File

@@ -69,3 +69,7 @@ button:active {
font-size: 20px;
}
#finalScore {
display: none;
}

View File

@@ -6,12 +6,16 @@ function test()
}
var nextquestion;
var nbQuestion;
var score
function startQuiz(j)
{
nextquestion = 1;
nbQuestion = j;
score = 0;
document.getElementById("test1").style.display = "block";
document.getElementById("test1").scrollIntoView();
document.getElementById("strt").disabled = "true";
document.getElementById("finalScore").style.display = "block";
}
function tog(j)
@@ -29,6 +33,7 @@ function tog(j)
{
document.getElementById("answer"+nextquestion).innerHTML = "correct";
document.getElementById("answer"+nextquestion).style.color = "#00ff00";
score += 1;
} else
{
document.getElementById("answer"+nextquestion).innerHTML = "incorrect";
@@ -42,6 +47,9 @@ function tog(j)
if (nextquestion<=nbQuestion)
{
document.getElementById("test"+nextquestion).style.display = "block";
document.getElementById("test"+nextquestion).scrollIntoView();
} else {
document.getElementById("finalScore").innerHTML = "Your final score is " + score + "/" + nbQuestion + "!";
}
}

View File

@@ -12,5 +12,6 @@
<h1 id="txt">page du quiz</h1>
<button id="strt" onclick="startQuiz({{questions.nbQuestion}})">Start Quiz!</button>
{% include 'question.html' %}
<h2 id="finalScore">continue to get your final score...</h2>
</body>
</html>