It is finaly working!
This commit is contained in:
64
templates/index.html
Normal file
64
templates/index.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Random Question</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 50px auto;
|
||||
padding: 20px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
.question {
|
||||
margin: 20px 0;
|
||||
}
|
||||
.answers {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.answers input {
|
||||
margin-right: 10px;
|
||||
}
|
||||
button {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
.option-style:hover{
|
||||
background-color: #33333352;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Véletlenszerű kérdés</h1>
|
||||
<form method="POST">
|
||||
{{ html_frame|safe }}
|
||||
<button type="submit" name="check">Ellenőriz</button>
|
||||
<button type="submit" name="next">Következő</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
68
templates/quiz.html
Normal file
68
templates/quiz.html
Normal file
@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Quiz</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f4f4f9;
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
}
|
||||
.container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
background-color: white;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
color: #2C3E50;
|
||||
}
|
||||
.question {
|
||||
margin-bottom: 20px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.answer-options {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.answer-options input {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.submit-button {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
background-color: #3498db;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
font-size: 1.1em;
|
||||
cursor: pointer;
|
||||
}
|
||||
.submit-button:hover {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Question {{ question_index + 1 }}</h1>
|
||||
<p class="question">{{ question['question'] }}</p>
|
||||
<form method="POST" action="{{ url_for('submit_answer') }}">
|
||||
{% for answer in question['answers'] %}
|
||||
<label>
|
||||
<input type="checkbox" name="answer" value="{{ answer }}">
|
||||
{{ answer }}
|
||||
</label><br>
|
||||
{% endfor %}
|
||||
<input type="hidden" name="question_index" value="{{ question_index }}">
|
||||
<input type="submit" value="Next" class="submit-button">
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
139
templates/result.html
Normal file
139
templates/result.html
Normal file
@ -0,0 +1,139 @@
|
||||
<!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>
|
Reference in New Issue
Block a user