File tree Expand file tree Collapse file tree 5 files changed +14
-0
lines changed Expand file tree Collapse file tree 5 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,16 @@ function runCheck() {
219
219
220
220
if ( isCorrect && ( oldGrade !== newGrade ) ) {
221
221
// Hooray! User has a newly-correct answer!
222
+
223
+ // Set `correctStamp` id (if present) with timestamp and UUID
224
+ // This makes it easy to detect someone simply copying a final result.
225
+ correctStamp = document . getElementById ( 'correctStamp' ) ;
226
+ if ( correctStamp ) {
227
+ let timeStamp = ( new Date ( ) ) . toISOString ( ) ;
228
+ let uuid = crypto . randomUUID ( ) ;
229
+ correctStamp . innerHTML = `${ timeStamp } ${ uuid } ` ;
230
+ }
231
+
222
232
// Use a timeout so the underlying page will *re-render* before the
223
233
// alert shows. If we don't do this, the alert would be confusing
224
234
// because the underlying page would show that it wasn't completed.
Original file line number Diff line number Diff line change @@ -408,6 +408,7 @@ <h2>Interactive Lab (<span id="grade"></span>)</h2>
408
408
< button type ="button " id ="resetButton "> Reset</ button >
409
409
< button type ="button " id ="giveUpButton "> Give up</ button >
410
410
< br > < br >
411
+ < pre id ="correctStamp "> </ pre >
411
412
< textarea id ="debugData " rows ="20 " cols ="70 " readonly style ="display: none; ">
412
413
</ textarea >
413
414
</ form >
Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ <h2>Interactive Lab (<span id="grade"></span>)</h2>
169
169
< button type ="button " id ="resetButton "> Reset</ button >
170
170
< button type ="button " id ="giveUpButton "> Give up</ button >
171
171
< br > < br >
172
+ < pre id ="correctStamp "> </ pre >
172
173
< textarea id ="debugData " rows ="20 " cols ="70 " readonly style ="display: none; ">
173
174
</ textarea >
174
175
</ form >
Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ <h2>Interactive Lab (<span id="grade"></span>)</h2>
225
225
< button type ="button " id ="resetButton "> Reset</ button >
226
226
< button type ="button " id ="giveUpButton "> Give up</ button >
227
227
< br > < br >
228
+ < pre id ="correctStamp "> </ pre >
228
229
< textarea id ="debugData " rows ="20 " cols ="70 " readonly style ="display: none; ">
229
230
</ textarea >
230
231
</ form >
Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ <h2>Interactive Lab (<span id="grade"></span>)</h2>
216
216
< button type ="button " id ="resetButton "> Reset</ button >
217
217
< button type ="button " id ="giveUpButton "> Give up</ button >
218
218
< br > < br >
219
+ < pre id ="correctStamp "> </ pre >
219
220
< textarea id ="debugData " rows ="20 " cols ="70 " readonly style ="display: none; ">
220
221
</ textarea >
221
222
</ form >
You can’t perform that action at this time.
0 commit comments