Kiruthikaramalingam commited on
Commit
87fdf15
·
verified ·
1 Parent(s): 6f8f5bc

Update templates/tempor.html

Browse files
Files changed (1) hide show
  1. templates/tempor.html +7 -0
templates/tempor.html CHANGED
@@ -45,6 +45,10 @@
45
  const data = await response.json();
46
  const quizBox = document.getElementById("quiz-box");
47
 
 
 
 
 
48
  if (data.question && data.options) {
49
  quizBox.innerHTML = `
50
  <p class="quiz-question"><strong>Question:</strong> ${data.question}</p>
@@ -86,9 +90,11 @@
86
 
87
  const data = await response.json();
88
  const quizBox = document.getElementById("quiz-box");
 
89
 
90
  // Display feedback for the answer
91
  quizBox.innerHTML = `<p class="quiz-feedback">${data.reply}</p>`;
 
92
 
93
  // Check if there's a next question
94
  if (data.next_question && data.options) {
@@ -156,6 +162,7 @@
156
  <button class="btn btn-primary" onclick="startQuiz()">Start Quiz</button>
157
  </div>
158
  <div id="quiz-box"></div>
 
159
  </div>
160
  </div>
161
  </div>
 
45
  const data = await response.json();
46
  const quizBox = document.getElementById("quiz-box");
47
 
48
+
49
+ quizBox.innerHTML = `<p class="quiz-feedback">${data.reply}</p>`;
50
+
51
+
52
  if (data.question && data.options) {
53
  quizBox.innerHTML = `
54
  <p class="quiz-question"><strong>Question:</strong> ${data.question}</p>
 
90
 
91
  const data = await response.json();
92
  const quizBox = document.getElementById("quiz-box");
93
+ const scoreBox = document.getElementById("score-box");
94
 
95
  // Display feedback for the answer
96
  quizBox.innerHTML = `<p class="quiz-feedback">${data.reply}</p>`;
97
+ scoreBox.innerHTML = `Score: ${data.score}`;
98
 
99
  // Check if there's a next question
100
  if (data.next_question && data.options) {
 
162
  <button class="btn btn-primary" onclick="startQuiz()">Start Quiz</button>
163
  </div>
164
  <div id="quiz-box"></div>
165
+ <div id="score-box" style="margin-top: 10px; font-size: 16px; font-weight: bold; color: #0056b3;">Score: 0</div>
166
  </div>
167
  </div>
168
  </div>