-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.html
More file actions
192 lines (176 loc) · 7.41 KB
/
student.html
File metadata and controls
192 lines (176 loc) · 7.41 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Student View - Interactive Deck</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: sans-serif;
background-color: #f0f0f0;
padding: 20px;
max-width: 600px;
margin: 0 auto;
}
.card {
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
h2 { margin-top: 0; }
input[type="text"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background-color: #42affa;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
width: 100%;
}
button:hover { background-color: #2196f3; }
.quiz-options button {
margin-bottom: 10px;
background-color: #eee;
color: #333;
text-align: left;
}
.quiz-options button.selected {
background-color: #4caf50;
color: white;
}
.hidden { display: none; }
</style>
</head>
<body>
<h1>Student Response</h1>
<div id="connection-status" style="font-size: 0.8em; color: #666; margin-bottom: 10px; padding: 5px; background: #e0e0e0; border-radius: 4px; text-align: center;">
Initializing...
</div>
<!-- Sentiment Section -->
<div class="card">
<h2>How are you feeling?</h2>
<p>Share a thought about the class:</p>
<input type="text" id="studentThoughtInput" placeholder="I learned so much..." autocomplete="off">
<button id="studentAddThoughtBtn">Send Thought</button>
</div>
<!-- Quiz Section -->
<div class="card" id="quiz-card">
<h2>Quick Quiz</h2>
<p style="font-style: italic; color: #666; margin-bottom: 20px;">Look at the main screen for the question, then select your answer below.</p>
<div id="q1">
<p><strong>Question 1 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(1, 'a', this)">Option A</button>
<button onclick="submitAnswer(1, 'b', this)">Option B</button>
<button onclick="submitAnswer(1, 'c', this)">Option C</button>
</div>
</div>
<div id="q2" class="hidden">
<p><strong>Question 2 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(2, 'a', this)">Option A</button>
<button onclick="submitAnswer(2, 'b', this)">Option B</button>
<button onclick="submitAnswer(2, 'c', this)">Option C</button>
</div>
</div>
<div id="q3" class="hidden">
<p><strong>Question 3 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(3, 'a', this)">Option A</button>
<button onclick="submitAnswer(3, 'b', this)">Option B</button>
<button onclick="submitAnswer(3, 'c', this)">Option C</button>
</div>
</div>
<div id="q4" class="hidden">
<p><strong>Question 4 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(4, 'a', this)">Option A</button>
<button onclick="submitAnswer(4, 'b', this)">Option B</button>
<button onclick="submitAnswer(4, 'c', this)">Option C</button>
</div>
</div>
<div id="q5" class="hidden">
<p><strong>Question 5 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(5, 'a', this)">Option A</button>
<button onclick="submitAnswer(5, 'b', this)">Option B</button>
<button onclick="submitAnswer(5, 'c', this)">Option C</button>
</div>
</div>
<div id="q6" class="hidden">
<p><strong>Question 6 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(6, 'a', this)">Option A</button>
<button onclick="submitAnswer(6, 'b', this)">Option B</button>
<button onclick="submitAnswer(6, 'c', this)">Option C</button>
</div>
</div>
<div id="q7" class="hidden">
<p><strong>Question 7 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(7, 'a', this)">Option A</button>
<button onclick="submitAnswer(7, 'b', this)">Option B</button>
<button onclick="submitAnswer(7, 'c', this)">Option C</button>
</div>
</div>
<div id="q8" class="hidden">
<p><strong>Question 8 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(8, 'a', this)">Option A</button>
<button onclick="submitAnswer(8, 'b', this)">Option B</button>
<button onclick="submitAnswer(8, 'c', this)">Option C</button>
</div>
</div>
<div id="q9" class="hidden">
<p><strong>Question 9 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(9, 'a', this)">Option A</button>
<button onclick="submitAnswer(9, 'b', this)">Option B</button>
<button onclick="submitAnswer(9, 'c', this)">Option C</button>
</div>
</div>
<div id="q10" class="hidden">
<p><strong>Question 10 of 10</strong></p>
<div class="quiz-options">
<button onclick="submitAnswer(10, 'a', this)">Option A</button>
<button onclick="submitAnswer(10, 'b', this)">Option B</button>
<button onclick="submitAnswer(10, 'c', this)">Option C</button>
</div>
</div>
<div id="quiz-done" class="hidden">
<h3>Thanks for your answers!</h3>
<p>Here is how you compare to the class:</p>
<div id="student-results-container" style="margin-top: 20px;">
<table style="width: 100%; font-size: 0.9em; border-collapse: collapse;">
<thead>
<tr style="border-bottom: 2px solid #ddd;">
<th style="text-align: left; padding: 8px;">Q</th>
<th style="text-align: center; padding: 8px;">You</th>
<th style="text-align: center; padding: 8px;">Class</th>
</tr>
</thead>
<tbody id="student-results-body">
<!-- Rows generated by JS -->
</tbody>
</table>
</div>
<button onclick="location.reload()" style="margin-top: 20px; background-color: #777;">Take Quiz Again</button>
</div>
</div>
<!-- PeerJS -->
<script src="https://unpkg.com/peerjs@1.5.2/dist/peerjs.min.js"></script>
<script src="js/sentiment.js"></script>
<script src="js/student.js"></script>
</body>
</html>