Fausto Busuito commited on
Commit
15ca1e9
·
1 Parent(s): 557c7e9

Application changes

Browse files
Files changed (2) hide show
  1. app/static/script.js +9 -0
  2. app/static/style.css +59 -13
app/static/script.js CHANGED
@@ -103,6 +103,15 @@ document.getElementById('end-session').addEventListener('click', async () => {
103
  document.getElementById('score').innerText = `Your score: ${result.score.toFixed(2)}%`;
104
  });
105
 
 
 
 
 
 
 
 
 
 
106
  function updateTimer() {
107
  const elapsedTime = Math.floor((Date.now() - startTime) / 1000);
108
  const hours = String(Math.floor(elapsedTime / 3600)).padStart(2, '0');
 
103
  document.getElementById('score').innerText = `Your score: ${result.score.toFixed(2)}%`;
104
  });
105
 
106
+ document.getElementById('restart').addEventListener('click', () => {
107
+ document.getElementById('results-container').style.display = 'none';
108
+ document.getElementById('file-selection').style.display = 'block';
109
+ document.getElementById('quiz-container').style.display = 'none';
110
+ currentIndex = 0;
111
+ questions = [];
112
+ userAnswers = [];
113
+ document.getElementById('file').value = ''; // Reset file selection
114
+ });
115
  function updateTimer() {
116
  const elapsedTime = Math.floor((Date.now() - startTime) / 1000);
117
  const hours = String(Math.floor(elapsedTime / 3600)).padStart(2, '0');
app/static/style.css CHANGED
@@ -2,28 +2,44 @@ body {
2
  font-family: Arial, sans-serif;
3
  margin: 0;
4
  padding: 0;
5
- display: flex;
6
- justify-content: center;
7
- align-items: center;
8
- height: 100vh;
9
- background-color: #f5f5f5;
10
  }
11
 
12
- .container {
13
- width: 600px;
 
 
 
14
  background: white;
 
 
 
 
 
 
15
  padding: 20px;
16
- border-radius: 8px;
17
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
 
 
 
 
18
  }
19
 
20
- input[type="radio"], input[type="checkbox"] {
21
- margin-right: 10px;
22
- cursor: pointer;
 
 
 
 
 
23
  }
24
 
25
  label {
 
26
  font-size: 16px;
 
27
  cursor: pointer;
28
  }
29
 
@@ -34,7 +50,37 @@ label {
34
  }
35
 
36
  #navigation button {
37
- padding: 10px 15px;
38
  font-size: 16px;
 
 
 
39
  cursor: pointer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
 
2
  font-family: Arial, sans-serif;
3
  margin: 0;
4
  padding: 0;
5
+ background-color: #f4f4f9;
 
 
 
 
6
  }
7
 
8
+ #quiz-container {
9
+ display: none;
10
+ padding: 20px;
11
+ max-width: 800px;
12
+ margin: 20px auto;
13
  background: white;
14
+ border: 1px solid #ddd;
15
+ border-radius: 5px;
16
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
17
+ }
18
+
19
+ #file-selection, #results-container {
20
  padding: 20px;
21
+ max-width: 800px;
22
+ margin: 20px auto;
23
+ background: white;
24
+ border: 1px solid #ddd;
25
+ border-radius: 5px;
26
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
27
  }
28
 
29
+ h2 {
30
+ font-size: 24px;
31
+ color: #333;
32
+ margin-bottom: 15px;
33
+ }
34
+
35
+ #options {
36
+ margin-top: 20px;
37
  }
38
 
39
  label {
40
+ display: block;
41
  font-size: 16px;
42
+ margin-bottom: 10px;
43
  cursor: pointer;
44
  }
45
 
 
50
  }
51
 
52
  #navigation button {
53
+ padding: 10px 20px;
54
  font-size: 16px;
55
+ border: none;
56
+ background-color: #007bff;
57
+ color: white;
58
  cursor: pointer;
59
+ border-radius: 5px;
60
+ transition: background-color 0.3s ease;
61
+ }
62
+
63
+ #navigation button:hover {
64
+ background-color: #0056b3;
65
+ }
66
+
67
+ #timer, #question-number {
68
+ margin-bottom: 20px;
69
+ font-size: 18px;
70
+ color: #555;
71
+ }
72
+
73
+ button#restart {
74
+ padding: 10px 20px;
75
+ font-size: 16px;
76
+ border: none;
77
+ background-color: #28a745;
78
+ color: white;
79
+ cursor: pointer;
80
+ border-radius: 5px;
81
+ transition: background-color 0.3s ease;
82
+ }
83
+
84
+ button#restart:hover {
85
+ background-color: #218838;
86
  }