From a46bc362ee0b8216dde77c7a0c03dc827fd2a6b4 Mon Sep 17 00:00:00 2001 From: YourFriendlyNeighborhoodDealer Date: Tue, 5 Mar 2019 09:13:16 +0100 Subject: [PATCH] Alert on test mode, and some message when trying to solve questions on passive mode --- main.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 3a6bb46..7b1753a 100644 --- a/main.js +++ b/main.js @@ -228,6 +228,17 @@ function Main() { 'use strict'; Init(function(count, subjCount) { var url = location.href; + + let skipLoad = GM_getValue("skipLoad"); + if (count == -2 && subjCount == -2 && skipLoad) { + if (url.includes("/quiz/") && url.includes("attempt.php")) + ShowMessage({ + m: "Passzív mód bekapcsolva, válaszok megjelenítéséhez menü gomb alatt kapcsold ki, és frissíts!", + isSimple: true + }); + return; + } + try { if ((url.includes("/quiz/") && url.includes("attempt.php")) || forceTestPage) { // if the current page is a test HandleQuiz(); @@ -254,6 +265,9 @@ function Main() { "Itteni hibák 100% a moodle hiba. Kivéve, ha oda van írva hogy script error ;) Ha ilyesmi szerepel itt, akkor olvasd el a segítség szekciót! Nagy esélyel a kérdéseket nem lehetett beolvasni." ); }); + + if (forceTestPage || forceResultPage || forceDefaultPage) + alert("TEST MODE"); } //: }}} @@ -923,8 +937,10 @@ function Load(cwith) { var useNetDB = GM_getValue("useNetDB"); let skipLoad = GM_getValue("skipLoad"); - if (skipLoad) + if (skipLoad) { + cwith(-2, -2); return -1; + } if (useNetDB != undefined && useNetDB == 1) return ReadNetDB(cwith, useNetDB);