-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathresult-daily.html
More file actions
203 lines (175 loc) · 5.63 KB
/
Copy pathresult-daily.html
File metadata and controls
203 lines (175 loc) · 5.63 KB
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>🎉 Daily Quiz Results | 日本語マスター</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css" />
<style>
.result-container {
max-width: 900px;
margin: 0 auto;
}
.score-hero {
text-align: center;
padding: 60px 30px;
margin-bottom: 40px;
background: linear-gradient(135deg, var(--secondary), #2a9d8f);
border-radius: 40px;
color: white;
box-shadow: var(--shadow);
position: relative;
}
.score-hero h1,
.score-hero p {
color: white;
}
.score-badge {
font-size: 5rem;
font-weight: 800;
line-height: 1;
margin-bottom: 15px;
display: block;
}
.score-label {
font-size: 1.2rem;
font-weight: 600;
opacity: 0.9;
}
.review-item {
padding: 25px;
border-radius: 20px;
margin-bottom: 20px;
border-left: 8px solid #eee;
background: white;
transition: var(--transition);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
position: relative;
}
.item-correct {
border-left-color: var(--success);
}
.item-incorrect {
border-left-color: var(--primary);
}
.level-badge-mini {
position: absolute;
top: 20px;
right: 20px;
font-size: 0.7rem;
font-weight: 800;
padding: 3px 10px;
border-radius: 50px;
background: var(--light);
color: var(--secondary);
}
.ans-block {
padding: 15px;
border-radius: 12px;
margin-top: 10px;
font-size: 1rem;
}
.your-ans {
background: var(--light);
border: 1px solid #e0e0e0;
}
.correct-ans {
background: rgba(42, 157, 143, 0.05);
border: 1px solid rgba(42, 157, 143, 0.2);
margin-top: 8px;
}
.explanation {
margin-top: 15px;
padding-top: 15px;
border-top: 1px dashed #eee;
color: var(--text-light);
font-style: italic;
font-size: 0.95rem;
}
.action-buttons {
margin-top: 50px;
display: flex;
justify-content: center;
gap: 20px;
padding-bottom: 50px;
}
</style>
</head>
<body>
<nav class="navbar animate-fade">
<div class="logo">日本語マスター</div>
</nav>
<div class="container animate-fade result-container">
<div class="score-hero">
<h1>Daily Challenge Result</h1>
<span class="score-badge" id="scoreDisplay">--</span>
<p class="score-label">out of 100 points</p>
<div class="feedback-text mt-4" id="feedback" style="font-size: 2rem; font-weight: 800;">Processing...</div>
</div>
<div class="review-section">
<h3 class="mb-4">Challenge Review (100 Questions)</h3>
<div id="reviewContainer"></div>
</div>
<div class="action-buttons">
<a href="index.html" class="btn btn-outline" style="min-width: 250px;">
🏠 Return to Dashboard
</a>
</div>
</div>
<script src="js/quiz-data.js"></script>
<script>
window.onload = function () {
const urlParams = new URLSearchParams(window.location.search);
const allQuestions = [];
Object.keys(window.quizQuestions).forEach(level => {
window.quizQuestions[level].forEach(q => {
allQuestions.push({ ...q, level });
});
});
// Same shuffle logic for consistency
for (let i = allQuestions.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[allQuestions[i], allQuestions[j]] = [allQuestions[j], allQuestions[i]];
}
const shuffledQuestions = allQuestions.slice(0, 100);
let correctCount = 0;
const reviewContainer = document.getElementById('reviewContainer');
shuffledQuestions.forEach((q, index) => {
const userAnswerIndex = parseInt(urlParams.get(`q${index}`));
const isCorrect = userAnswerIndex === q.correct;
if (isCorrect) correctCount++;
const item = document.createElement('div');
item.className = `review-item animate-slide ${isCorrect ? 'item-correct' : 'item-incorrect'}`;
item.style.animationDelay = `${index * 0.02}s`;
const userAnswerText = userAnswerIndex === -1 ? "No answer" : q.options[userAnswerIndex] || "No answer";
const correctAnswerText = q.options[q.correct];
item.innerHTML = `
<span class="level-badge-mini">${q.level}</span>
<div class="q-header">
<strong style="color: var(--secondary)">Q${index + 1}: ${q.question}</strong>
</div>
<div class="ans-block your-ans">
<strong>Your Choice:</strong> ${userAnswerText}
</div>
${!isCorrect ? `
<div class="ans-block correct-ans">
<strong>Correct Answer:</strong> ${correctAnswerText}
</div>
` : ''}
<div class="explanation">
<strong>Explanation:</strong> ${q.explanation}
</div>
`;
reviewContainer.appendChild(item);
});
document.getElementById('scoreDisplay').textContent = correctCount;
const feedback = document.getElementById('feedback');
if (correctCount >= 90) feedback.textContent = "🏆 Daily Grandmaster!";
else if (correctCount >= 70) feedback.textContent = "🔥 Advanced Learner!";
else if (correctCount >= 40) feedback.textContent = "✅ On the Right Track!";
else feedback.textContent = "📚 Keep at it!";
};
</script>
</body>
</html>