|
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>Quiz Host</title> |
|
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"> |
|
<link rel="stylesheet" href="/static/style.css"> |
|
</head> |
|
<body> |
|
<div class="container"> |
|
<h2>Quiz Host</h2> |
|
<p>Participants connected: <span id="participant-count">0</span></p> |
|
<select id="exam-selector" class="form-control" onchange="selectExam()"> |
|
<option value="" disabled selected>Select an exam</option> |
|
{% for exam in exams %} |
|
<option value="{{ exam }}">{{ exam }}</option> |
|
{% endfor %} |
|
</select> |
|
<label for="start-question" id="start-question-label" class="mt-3" style="display: none;">Select starting question:</label> |
|
<input type="range" id="start-question" min="1" max="10" value="1" class="form-range mt-2 mb-2" style="display: none;" oninput="updateSliderValue(this.value)"> |
|
<input type="number" id="start-question-number" min="1" max="10" value="1" class="form-control" style="display: none;" oninput="updateSliderValue(this.value)"> |
|
<p id="question-start-display" class="mt-2" style="display: none;">Starting from question 1.</p> |
|
<button onclick="loadQuiz()" class="btn btn-info mt-3">Load Quiz</button><br><br> |
|
<button onclick="startQuiz()" class="btn btn-success mt-3">Start Quiz</button><br><br> |
|
<button onclick="restartQuiz()" class="btn btn-warning mt-3">Restart</button><br><br> |
|
<button onclick="checkAnswers()" class="btn btn-primary mt-2">Check Answers</button><br><br> |
|
<button onclick="nextQuestion()" class="btn btn-secondary mt-2">Next Question</button><br><br> |
|
<button onclick="endQuiz()" id="end-quiz" class="btn btn-danger mt-2" disabled>End Quiz</button> |
|
<div id="question-section" class="mt-4"> |
|
<p id="question-text"></p> |
|
<div id="options"></div> |
|
</div> |
|
<div id="results" class="mt-4"></div> |
|
</div> |
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.0/socket.io.js"></script> |
|
<script src="/static/script.js"></script> |
|
</body> |
|
</html> |
|
|