-
Notifications
You must be signed in to change notification settings - Fork 0
/
resultado.html
170 lines (144 loc) · 5.07 KB
/
resultado.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Resultado do Quiz Bíblico</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@material/[email protected]/dist/material.min.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@material/[email protected]/dist/material.min.js"></script>
<style>
:root {
--md-sys-color-primary: #2196f3;
--md-sys-color-secondary: #4caf50;
--md-sys-color-error: #ef5350;
--md-sys-color-surface: #fafafa;
--md-sys-color-surface-container: #ffffff;
--md-sys-color-on-surface: #1d1b20;
}
body {
margin: 0;
padding: 16px;
background-color: var(--md-sys-color-surface);
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
color: var(--md-sys-color-on-surface);
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 16px;
}
.card {
background-color: var(--md-sys-color-surface-container);
border-radius: 28px;
padding: 24px;
margin-bottom: 24px;
box-shadow: var(--md-elevation-level2);
}
h1 {
font-size: 2rem;
text-align: center;
margin-bottom: 24px;
color: var(--md-sys-color-on-surface);
}
h2 {
font-size: 1.5rem;
text-align: center;
margin: 24px 0;
color: var(--md-sys-color-on-surface);
}
.score {
font-size: 1.2rem;
text-align: center;
margin-bottom: 24px;
}
.correct-answers {
color: var(--md-sys-color-secondary);
font-weight: bold;
}
.total-questions {
color: var(--md-sys-color-primary);
font-weight: bold;
}
.wrong-answers-list {
list-style: none;
padding: 0;
margin: 0;
}
.wrong-answer-item {
background-color: var(--md-sys-color-surface);
border-radius: 16px;
padding: 16px;
margin-bottom: 12px;
border-left: 4px solid var(--md-sys-color-error);
}
.reference {
font-size: 0.9rem;
color: var(--md-sys-color-primary);
margin-top: 8px;
}
.action-container {
text-align: center;
margin-top: 24px;
}
@media (min-width: 768px) {
body {
padding: 24px;
}
h1 {
font-size: 2.5rem;
}
.card {
padding: 32px;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Resultado do Quiz Bíblico</h1>
<div class="card">
<p class="score">
Você acertou
<span id="correctAnswers" class="correct-answers"></span>
de
<span id="totalQuestions" class="total-questions"></span>
perguntas
</p>
<md-divider style="margin: 24px 0;"></md-divider>
<h2>Perguntas que você errou:</h2>
<div id="wrongAnswersList" class="wrong-answers-list"></div>
<div class="action-container">
<md-filled-button onclick="voltar()">
Voltar ao Início
</md-filled-button>
</div>
</div>
</div>
<script>
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const correctAnswers = urlParams.get('correctAnswers');
const totalQuestions = urlParams.get('totalQuestions');
const wrongAnswers = JSON.parse(urlParams.get('wrongAnswers'));
document.getElementById('correctAnswers').textContent = correctAnswers;
document.getElementById('totalQuestions').textContent = totalQuestions;
const wrongAnswersList = document.getElementById('wrongAnswersList');
wrongAnswers.forEach(wrongAnswer => {
const listItem = document.createElement('div');
listItem.className = 'wrong-answer-item';
const questionText = document.createElement('div');
questionText.textContent = wrongAnswer.question;
const reference = document.createElement('div');
reference.className = 'reference';
reference.textContent = `Referência Bíblica: ${wrongAnswer.reference}`;
listItem.appendChild(questionText);
listItem.appendChild(reference);
wrongAnswersList.appendChild(listItem);
});
function voltar() {
window.location.href = 'index.html';
}
</script>
</body>
</html>