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 @@ -216,6 +216,16 @@ function runCheck() {
216
216
217
217
if ( isCorrect && ( oldGrade !== newGrade ) ) {
218
218
// Hooray! User has a newly-correct answer!
219
+
220
+ // Set `correctStamp` id (if present) with timestamp and UUID
221
+ // This makes it easy to detect someone simply copying a final result.
222
+ correctStamp = document . getElementById ( 'correctStamp' ) ;
223
+ if ( correctStamp ) {
224
+ let timeStamp = ( new Date ( ) ) . toISOString ( ) ;
225
+ let uuid = crypto . randomUUID ( ) ;
226
+ correctStamp . innerHTML = `${ timeStamp } ${ uuid } ` ;
227
+ }
228
+
219
229
// Use a timeout so the underlying page will *re-render* before the
220
230
// alert shows. If we don't do this, the alert would be confusing
221
231
// 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