-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.html
More file actions
426 lines (360 loc) · 18.8 KB
/
student.html
File metadata and controls
426 lines (360 loc) · 18.8 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
<!DOCTYPE HTML>
<!-- this page is the main login that you are redirected to with the normal url. -->
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<title>Student View</title>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link rel="stylesheet" href="stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="stylesheets/style.css"/>
<link rel="stylesheet" href="stylesheets/fields.css"/>
</head>
<script type="text/javascript" src="js/d3.min.js" charset="utf-8"></script>
<script>
</script>
<body hidden>
<div id="main" class="container">
<div id="page" class="row">
<!-- ***** Login View ***** -->
<div class="login_view" hidden>
<!-- Title -->
<div class="col-md-12 col-sm-12">
<div class="col-md-4 col-sm-4"></div>
<div class="col-md-4 col-sm-4">
<h2 class="section_title"> Student Login </h2>
</div>
<div class="col-md-4 col-sm-4"></div>
</div>
<!-- Error Frame -->
<div class="col-md-12 col-sm-12">
<div class="col-md-4 col-sm-4"></div>
<div class="col-md-4 col-sm-4">
<h4 id="error_frame"></h4>
</div>
<div class="col-md-4 col-sm-4"></div>
</div>
<!-- Text Fields and Login Button -->
<div class="col-md-12 col-sm-12">
<div class="col-md-4 col-sm-4"></div>
<div class="col-md-4 col-sm-4">
<input type="text" class="form-control" id="class_id" name="class_id" required="" placeholder="Class ID"/><br/>
<input type="text" class="form-control" id="nickname" name="nickname" required="" placeholder="Nickname"/><br/>
<input class="btn btn-lg btn-primary btn-block" type="submit" value="Login" id="login"/><br/>
</div>
<div class="col-md-4 col-sm-4"></div>
</div>
</div> <!-- ***** End of login_view ***** -->
<!-- ***** Class View ***** -->
<div class="class_view" hidden>
<!-- Title -->
<div class="col-md-12 col-sm-12">
<div class="col-md-4 col-sm-4"></div>
<div class="col-md-4 col-sm-4">
<h3> Student Groups </h3>
</div>
<div class="col-md-4 col-sm-4"></div>
</div>
<!-- Group Buttons -->
<div class="col-md-12 col-sm-12">
<div class="col-md-2 col-sm-2"></div>
<div class="col-md-8 col-sm-8">
<!-- add in class name, display buttons based on the class's groups to enter the individual groups -->
<p id="buttons"> </p>
</div>
<div class="col-md-2 col-sm-2"></div>
</div>
<!-- Log Out button -->
<div class="col-md-12 col-sm-12">
<div class="col-md-4 col-sm-4"></div>
<div class="col-md-4 col-sm-4">
<!-- foreach group, create a html button with onclick to emit action to a group -->
<input type="button" class="btn btn-danger" value="Log Out" id="logout" />
</div>
<div class="col-md-4 col-sm-4"></div>
</div>
</div> <!-- ***** End of class_view ***** -->
<!-- ***** Group View ***** -->
<div class="group_view" hidden>
<div class="col-md-9">
<!-- Title, Leave Group Button -->
<h2 id="groupview_title">
<span id="number">Group</span>
<input class="btn btn-danger" type="button" value="Leave Group" id="leave_group"/>
</h2>
<h2 id="container_title">Electrical field lines and equipotential surfaces</h2>
<!-- Field Container -->
<div id="field-container"></div>
<!-- Legend -->
<div id="legend">
<span>
Legend:
<span id="legend_text_positive">positive</span>,
<span id="legend_text_negative">negative</span>,
<span id="legend_text_forcelines">force lines</span>,
<span id="legend_text_selectedcharge">selected charge</span>.
</span>
<span id="select_point_charge">
Selected point charge: <select id="charge"></select>
</span>
</div>
<!-- Glyphicons (Settings, Draw, Delete) -->
<div class="col-md-8 col-sm-8">
<div class="tools">
<label id="settings_button" type="button" onclick="this.blur();" class="btn btn-default btn-sm" data-toggle="modal" data-target="#settings_modal">
<span class="glyphicon glyphicon-cog"></span>
</label>
<label id="draw_vectors_button" type="button" onclick="toggle_draw_vectors_mode(this);" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</label>
<label id="delete_mode_button" type="button" onclick="toggle_delete_mode(this);" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-trash"></span>
</label>
<label id="add_charge_button" type="button" onclick="add_charge(this);" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</label>
<label id="remove_charge_button" type="button" onclick="remove_charge(this);" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-minus"></span>
</label>
<label id="clear_vectors_button" type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#confirm_clear_vectors_modal">
<span> Clear </span>
</label>
</div>
</div>
<!-- Confirm Clear Vectors Modal -->
<div id="confirm_clear_vectors_modal" class="modal fad" tabindex="-1" role="dialog" aria-labelledby="modal_confirm_clear_vectors_label">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="modal_confirm_clear_vectors_label"> Are you sure you want to clear your drawn vectors? </h4>
</div> <!-- modal-header -->
<div class="modal-body">
<button type="button" onclick="clear_vectors(this);" class="btn btn-default btn-sm" data-dismiss="modal">
<span> Yes </span>
</button>
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
<span> No </span>
</button>
</div> <!-- modal-body -->
</div> <!-- modal-content -->
</div> <!-- modal-dialog -->
</div> <!-- Confirm Clear Vectors Modal -->
<!-- Coordinate Change Buttons -->
<div class="col-md-4 col-sm-4">
<input type="button" value="←" class="btn btn-default change_coord" data-x=-1 data-y=0 />
<input type="button" value="↑" class="btn btn-default change_coord" data-x=0 data-y=1 />
<input type="button" value="↓" class="btn btn-default change_coord" data-x=0 data-y=-1 />
<input type="button" value="→" class="btn btn-default change_coord" data-x=1 data-y=0 />
</div>
<!-- Settings Modal -->
<div id="settings_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal_settings_label">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="modal_settings_label"> Settings </h4>
</div> <!-- End of modal-header -->
<div class="modal-body">
<form id="display-settings">
<div class="row">
<!-- Left Column -->
<div class="col-md-6 col-sm-6">
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_particle_charge" checked>
<label class="onoffswitch-label" for="show_particle_charge"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show particle charge</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_particle_size" checked>
<label class="onoffswitch-label" for="show_particle_size"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show particle size</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_labels" checked>
<label class="onoffswitch-label" for="show_labels"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show name labels</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_axes" checked>
<label class="onoffswitch-label" for="show_axes"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show axes & grid</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_points" checked>
<label class="onoffswitch-label" for="show_points"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show points</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_energy">
<label class="onoffswitch-label" for="show_energy"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show energy</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_drawn_vectors">
<label class="onoffswitch-label" for="show_drawn_vectors"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show drawn vectors</span>
</div>
</div>
</div> <!-- End of col-6 (Left Column) -->
<!-- Right Column -->
<div class="col-md-6 col-sm-6">
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_potential">
<label class="onoffswitch-label" for="show_potential"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show potential lines</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_equipotentials">
<label class="onoffswitch-label" for="show_equipotentials"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show equipotential lines</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_fieldlines">
<label class="onoffswitch-label" for="show_fieldlines"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show field lines</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_forcevectors">
<label class="onoffswitch-label" for="show_forcevectors"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show force vectors</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_fieldvectors">
<label class="onoffswitch-label" for="show_fieldvectors"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show field vectors</span>
</div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show_testcharge">
<label class="onoffswitch-label" for="show_testcharge"></label>
</div>
</div>
<div class="col-md-10 col-sm-10">
<span class="checkboxtext">Show test charge</span>
</div>
</div>
<select id ="testcharge_value" class="testcharge_options">
<option value="positive">+</option>
<option value="negative">-</option>
</select>
<span class="checkboxtext testcharge_options">Select test charge</span>
</div> <!-- End of col-6 (Right Column) -->
</div> <!-- End of row -->
</form> <!-- End of display-settings -->
<!-- Display when Hide Options setting enabled by admin -->
<div id="disabled_settings_message" hidden>
<h3> Settings Disabled by Administrator </h3>
</div>
</div> <!-- End of modal-body -->
<div class="modal-footer">
<div id="settings_footer">
<input type="button" value="Set to Default" onclick="set_to_default();" class="btn btn-default btn-sm outline"/>
</div>
</div> <!-- End of modal-footer -->
</div> <!-- End of modal-content -->
</div> <!-- End of modal-dialogue -->
</div> <!-- End of settings-modal -->
<br>
<script type="text/javascript" src="js/fields5.js"></script>
<script type="text/javascript" src="js/field_lines.js"></script>
</div>
</div> <!-- ***** End of group_view ***** -->
</div> <!-- End of page -->
</div> <!-- End of main -->
<footer>
<script src="js/jquery.min.js"></script>
<script src="js/socket.io-1.3.5.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/host.js"></script>
<script src="js/student_sockets.js"></script>
<script src="js/student_functions.js"></script>
<script src="js/login.js"></script>
<script src="js/class.js"></script>
<script src="js/groups.js"></script>
<script>
var socket = Student.Socket(io(host));
$(document).ready(function() {
$('#display-settings').change(update_display_settings);
$('body').addClass('stop-scrolling')
.bind('touchmove', function(e){e.preventDefault()});
redraw();
});
</script>
</footer>
</body>
</html>