File size: 1,820 Bytes
78447bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Quiz Client</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 id="join-title">Join the Quiz</h2>
        <input type="text" id="username" placeholder="Enter your name" class="form-control">
        <button onclick="joinQuiz()" class="btn btn-primary mt-2">Join</button>
        <div id="quiz-content" style="display: none;">
            <h3>Logged in as: <span id="logged-user"></span></h3>
            <h3 id="waiting-message" style="display: none;">Waiting for the Host...</h3>
            <div id="question-section" class="mt-4">
                <form id="quiz-form" onsubmit="submitForm(event)">
                    <p id="question-text"></p>
                    <div id="options"></div>
                    <input type="submit" value="Submit" class="btn btn-primary mt-2">
                </form>
            </div>
            <div id="results" class="mt-4"></div>
        </div>
        <div id="final-results" style="display: none;" class="mt-4">
            <h3>And the Winners are:</h3>
            <table class="table mt-2">
                <thead>
                    <tr>
                        <th>Participant</th>
                        <th>Score</th>
                    </tr>
                </thead>
                <tbody id="results-table">
                </tbody>
            </table>
        </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>