+ mounted: function() {
+ if (assessment.mode != "secure")
+ return;
+ window.addEventListener("keydown", e => {
+ // (Try to) Ignore F11 + F12 (avoid accidental window resize)
+ // NOTE: in Chromium at least, exiting fullscreen mode with F11 cannot be prevented.
+ // Workaround: disable key at higher level. Possible xbindkey config:
+ // "false"
+ // m:0x10 + c:95
+ // Mod2 + F11
+ if ([122,123].includes(e.keyCode))
+ e.preventDefault();
+ }, false);
+ window.addEventListener("blur", () => {
+ this.trySendCurrentAnswer();
+ document.location.href= "/noblur";
+ }, false);
+ window.addEventListener("resize", e => {
+ this.trySendCurrentAnswer();
+ document.location.href= "/fullscreen";
+ }, false);
+ },