140 lines
3.4 KiB
HTML
140 lines
3.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Quiz Results</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
background-color: #f4f4f9;
|
|
color: #333;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100vh;
|
|
overflow: auto;
|
|
}
|
|
|
|
.container {
|
|
background-color: #ffffff;
|
|
width: 90%;
|
|
max-width: 900px;
|
|
padding: 30px;
|
|
border-radius: 10px;
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
overflow-y: auto;
|
|
max-height: 90vh;
|
|
}
|
|
|
|
h1 {
|
|
text-align: center;
|
|
color: #4CAF50;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
h2 {
|
|
color: #333;
|
|
margin-top: 20px;
|
|
font-size: 1.5em;
|
|
}
|
|
|
|
p {
|
|
font-size: 1.1em;
|
|
}
|
|
|
|
ul {
|
|
list-style: none;
|
|
padding-left: 0;
|
|
}
|
|
|
|
li {
|
|
background-color: #f9f9f9;
|
|
border: 1px solid #ddd;
|
|
padding: 15px;
|
|
margin-bottom: 10px;
|
|
border-radius: 8px;
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
li strong {
|
|
font-weight: bold;
|
|
color: #333;
|
|
}
|
|
|
|
.correct-answer {
|
|
color: #4CAF50;
|
|
}
|
|
|
|
.user-answer {
|
|
color: #FF5722;
|
|
}
|
|
|
|
.mistake-item {
|
|
background-color: #FFEBEE;
|
|
border: 1px solid #FFCDD2;
|
|
}
|
|
|
|
.no-mistakes {
|
|
text-align: center;
|
|
font-size: 1.2em;
|
|
color: #4CAF50;
|
|
}
|
|
|
|
a {
|
|
display: block;
|
|
text-align: center;
|
|
margin-top: 20px;
|
|
padding: 10px 20px;
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
text-decoration: none;
|
|
border-radius: 5px;
|
|
font-size: 1.1em;
|
|
}
|
|
|
|
a:hover {
|
|
background-color: #45a049;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>Quiz Results</h1>
|
|
|
|
<p><strong>Score:</strong> {{ score }} out of {{ total }}</p>
|
|
|
|
<h2>Mistakes</h2>
|
|
{% if mistakes %}
|
|
<ul>
|
|
{% for mistake in mistakes %}
|
|
<li class="mistake-item">
|
|
<strong>Question:</strong> {{ mistake.question }}<br>
|
|
<strong class="user-answer">Your Answer:</strong> {{ mistake.user_answer }}<br>
|
|
<strong class="correct-answer">Correct Answer:</strong> {{ mistake.correct_answer }}<br>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<p class="no-mistakes">No mistakes!</p>
|
|
{% endif %}
|
|
|
|
<h2>All Answers</h2>
|
|
<ul>
|
|
{% for question, answer in questions_with_answers %}
|
|
<li>
|
|
<strong>{{ question['question'] }}</strong><br>
|
|
<strong class="user-answer">Your Answer:</strong> {{ answer }}<br>
|
|
<strong class="correct-answer">Correct Answer:</strong> {{ question['correct_answers'] }}<br>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
<a href="{{ url_for('restart') }}">Restart Quiz</a>
|
|
</div>
|
|
</body>
|
|
</html>
|