-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
384 lines (368 loc) · 18.1 KB
/
index.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Giffer Reborn</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/styles/androidstudio.css">
</head>
<body>
<nav class="navbar sticky-top navbar-light bg-light">
<p class="navbar-brand">Giffer Reborn</p>
<form class="form-inline my-2 my-lg-0">
<button class="btn btn-outline-info my-2 my-sm-0" id="copy-page" type="button">Copy Page</button>
<button class="btn btn-danger my-2 my-sm-0" id='finish-debug' type="button" onclick="debug.stopDebuggingSession()">Finish</button>
<button class="btn btn-success my-2 my-sm-0" id="run-button" type="button" onclick="runCode()">Run</button>
</form>
</nav>
<div class="container-fluid" id="main-div">
<div class="row full-height">
<div class="col-7 full-height">
<div id="editor" class="full-height"></div>
</div>
<div class="col-5 scrollable full-height">
<div class="card">
<div class="card-body">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<ul class="nav nav-tabs" id="control-tabs">
<li class="nav-item">
<a class="nav-link active" id="controls-tab" data-toggle="tab" href="#controls" aria-controls="controls" aria-selected="true">Controls</a>
</li>
<li class="nav-item">
<a class="nav-link" id="edit-tab" data-toggle="tab" href="#edit" aria-controls="edit" aria-selected="false">
<span class="d-inline-block" id="edit-tooltip" tabindex="0" data-toggle="tooltip" title="Board cannot be changed while an exercise is selected">
Configure Board
</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="debug-tab" data-toggle="tab" href="#debug" aria-controls="edit" aria-selected="false">Debugging</a>
</li>
<li class="nav-item">
<a class="nav-link" id="dev-tab" data-toggle="tab" href="#dev" aria-controls="dev" aria-selected="false">Tools</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="controls" role="tabpanel" aria-labelledby="controls-tab">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="name-addon">Name:</span>
</div>
<input type="text" id="name" class="form-control" aria-describedby="name-addon">
</div>
<br>
<div class="input-group mb-3">
<select id="board" class="custom-select">
<!--Populated by Board.js-->
</select>
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" onclick="loadBoard()">Load Board</button>
</div>
</div>
<div class="input-group mb-3">
<input type="text" id="exercise-number" class="form-control" placeholder="Exercise Number (leave blank for no grading)">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" onclick="loadExercise(true)">Load Exercise</button>
</div>
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" onclick="wipeExercise()">Clear Exercise</button>
</div>
</div>
</div>
<div class="tab-pane fade" id="edit" role="tabpanel" aria-labelledby="edit-tab">
<!--Populated/deleted by current board-->
</div>
<div class="tab-pane fade" id="debug" role="tabpanel" aria-labelledby="edit-tab">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="debugging-enabled" onchange="debug.sendUpdateEnabled()" checked>
<label class="custom-control-label" for="debugging-enabled">Enable breakpoints</label>
</div>
<br>
<div id="debugging-buttons">
<button class="btn btn-info" onclick="debug.doContinue()">Run to Next</button>
<button class="btn btn-secondary" onclick="debug.doStepLine()">Step Line</button>
<button class="btn btn-secondary" onclick="debug.doStepExpression()">Step Expression</button>
</div>
<br>
<br>
<div id="variables-table">
<table class="table">
<thead>
<tr>
<th scope="col">Type</th>
<th scope="col">Variable</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody id="variables-table-body">
</tbody>
</table>
</div>
</div>
<div class="tab-pane fade" id="dev" role="tabpanel" aria-labelledby="dev-tab">
<button class="btn btn-outline-secondary" onclick="saveExercise()">Export Exercise</button>
<button class="btn btn-outline-secondary" onclick="saveFrameManager()">Export FrameManager</button>
<button class="btn btn-outline-secondary" onclick="generateExerciseModal()">Generate Exercise</button>
<hr>
<button class="btn btn-info" onclick="showReadme()">Show Help</button>
</div>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-12">
<ul class="nav nav-tabs" id="output-tabs">
<li class="nav-item">
<a class="nav-link" id="directions-tab" data-toggle="tab" href="#directions" aria-controls="directions" aria-selected="false">Exercise Directions</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="gif-tab" data-toggle="tab" href="#gif" aria-controls="gif" aria-selected="true">Output Gif</a>
</li>
<li class="nav-item">
<a class="nav-link" id="output-tab" data-toggle="tab" href="#output" aria-controls="output" aria-selected="false">Output Console</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade" id="directions" role="tabpanel" aria-labelledby="directions-tab">
<p id="directions-content"></p>
</div>
<div class="tab-pane fade show active" id="gif" role="tabpanel" aria-labelledby="gif-tab">
<div class="card-title" id="gif-loading-status">Gif</div>
<div id="gif-loading-bar" style="display: none" class="progress-bar progress-bar-striped progress-bar-animated bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
<div id="gif-output">
<hr>
<canvas id="canvas" width="100" height="100"></canvas>
<br>
<div id="correct-section" style="display: none;">
<hr>
<h4>Correct Gif: </h4>
<canvas id="correct-canvas" width="100" height="100"></canvas>
<br>
</div>
<span id="playback-speed">Playback Speed: 1</span><input class="custom-range" type="range" id="canvas-speed" value="1" min="0" max="3" step="0.01">
</div>
</div>
<div class="tab-pane fade" id="output" role="tabpanel" aria-labelledby="output-tab">
<div id="console-output"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modals are the windows that appear over the main page. -->
<div class="modal fade" id="overwrite-modal" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal-title">Exercise Loaded</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
This exercise provides starting code. Do you want to overwrite your current code?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">No</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="overwriteCode()">Yes</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="readme-modal" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal-title">Welcome to Giffer Reborn!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
This window will outline the features of Giffer Reborn. <br>
<strong>To see this window again, click "Show Help" under "Tools".</strong><br>
<br><br>
<h4>Working with exercises</h4>
To load an exercise, type the exercise number into the exercise field and press load.<br>
Some exercises provide some starting code! Be sure to load the exercise before you start working.<br>
If you want to edit the board, or experiment, you should "Clear Exercise".<br>
<br><br>
<h4>Debugging</h4>
Under the "Debugging" tab, there is a checkbox to "Enable Breakpoints".<br>
If you click next to a line number on the left of your code, you can add a breakpoint.<br>
When breakpoints are enabled, the program will halt execution when it reaches the breakpoint.<br>
Once the program has halted, you can view the current variables and their values.<br>
You can press "Step" to step to the next line of execution, this might take you into a function.<br>
You can press "Continue" to skip to the next breakpoint.<br>
At any time during debugging, you can disable breakpoints to finish executing.<br>
<br><br>
<h4>Submitting</h4>
Once you've solved an exercise, you can click "Copy Page".<br>
Then, read the directions in the console for how to submit to NEO.<br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="setToStorage('prevent-readme', true)">Don't Show Again</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="gen-modal" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal-title">Generate Exercise</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<div class="input-group mb-3 has-warning has-feedback">
<div class="input-group-prepend">
<span class="input-group-text"><strong>Exercise</strong></span>
</div>
<input type="number" required min="1" class="form-control" aria-label="Exercise number" id="genex-number"/>
<div class="input-group-append">
<button id="fetchButton" type="button" class="btn btn-warning" onclick="fetchExercise(true)">Fetch</button>
</div>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><strong>Board Type</strong></span>
</div>
<select class="form-control" id="genex-board">
</select>
</div>
<div id="genex-edit">
<table class="table" id="keyframe-table">
<thead>
<tr>
<th>At time (ms)</th>
<th>Change pin</th>
<th>To value</th>
<th>Remove</th>
</tr>
</thead>
<tbody id="keyframe-table-tbody"></tbody>
</table>
</div>
<div class="form-group">
<p></p>
<label for="genex-directions">Exercise Directions</label>
<textarea class="form-control" id="genex-directions" rows="8">
Directions go here!
</textarea>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="genex-starting">Starting code</label>
<textarea class="form-control" id="genex-starting" rows="8">
Starting code for students goes here.
</textarea>
</div>
<div class="form-group">
<label for="genex-suffix">Complete code</label>
<textarea class="form-control" id="genex-complete" rows="8">
And here should be a preview of the complete code for the exercise.
</textarea>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button id= "genexButton" type="button" class="btn btn-primary" onclick="generateExercise()" disabled>Create Exercise</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="exercise-modal" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal-title">Export Exercise</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="export-exercise-number">Exercise Number</label>
<input type="number" class="form-control" min="1" id="export-exercise-number">
</div>
<p>
<strong>Board Type</strong> currently selected board
</p>
<p>
<strong>Board Configuration</strong> current configuration (keyframes, etc)
</p>
<p>
<strong>Correct FrameManager</strong> current FrameManager (as shown by gif)
</p>
<div class="form-group">
<label for="export-exercise-directions">Exercise Directions</label>
<textarea class="form-control" id="export-exercise-directions">
Directions go here
</textarea>
</div>
<div class="form-group">
<label for="export-exercise-starting">Student starting code</label>
<textarea class="form-control" id="export-exercise-starting">
void setup() {
pinMode(3, OUTPUT);
}
void loop() {
digitalWrite(3, HIGH);
delay(500);
digitalWrite(3, LOW);
delay(500);
}
</textarea>
</div>
<div class="form-group">
<label for="export-exercise-suffix">Student code suffix</label>
<textarea class="form-control" id="export-exercise-suffix">
int main() {
setup();
loop();
return 0;
}
</textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="updateSuffix()">Set Code Suffix</button>
<button type="button" class="btn btn-primary" onclick="exportExercise()">Export Exercise</button>
</div>
</div>
</div>
</div>
<div id="confirmation-gif-container" style="display: none;"></div>
<div id="highlight-storage" style="display: none; width: 0.01px; height: 0.01px;"></div>
<script src="js/jquery-2.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/bootstrap.bundle.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="js/FrameManager.js" type="text/javascript" charset="utf-8"></script>
<script src="js/gif/gif.js" type="text/javascript" charset="utf-8"></script>
<script src="js/FileSaver.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/clipboard.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
<script src="js/Debugger.js" type="text/javascript" charset="utf-8"></script>
<script src="js/Board.js" type="text/javascript" charset="utf-8"></script>
<script src="js/main.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>