git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
word/edit: read fractional crop coordinates
[sheet.git]
/
word
/
quiz.js
diff --git
a/word/quiz.js
b/word/quiz.js
index 2385455ea0ff6e3d3a641b08ba0e8a87e1bf6401..bb12a832c73b170e496dc09e25e6fb88aa0c8849 100644
(file)
--- a/
word/quiz.js
+++ b/
word/quiz.js
@@
-58,7
+58,21
@@
class WordQuiz {
});
}
});
}
+ log(...args) {
+ this.history.push([new Date().toISOString(), ...args]);
+ }
+
+ stop(...args) {
+ this.log(...args);
+ window.onbeforeunload = null;
+ fetch('/word/report', {method: 'POST', body: JSON.stringify(this.history)});
+ }
+
constructor(dataurl) {
this.load(dataurl);
constructor(dataurl) {
this.load(dataurl);
+ this.history = [];
+ window.onbeforeunload = e => {
+ this.stop('abort');
+ };
}
}
}
}