Alert on test mode, and some message when trying to solve questions on passive mode

This commit is contained in:
YourFriendlyNeighborhoodDealer 2019-03-05 09:13:16 +01:00
parent 268754d2e4
commit a46bc362ee

18
main.js
View file

@ -228,6 +228,17 @@ function Main() {
'use strict'; 'use strict';
Init(function(count, subjCount) { Init(function(count, subjCount) {
var url = location.href; 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 { try {
if ((url.includes("/quiz/") && url.includes("attempt.php")) || forceTestPage) { // if the current page is a test if ((url.includes("/quiz/") && url.includes("attempt.php")) || forceTestPage) { // if the current page is a test
HandleQuiz(); 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." "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"); var useNetDB = GM_getValue("useNetDB");
let skipLoad = GM_getValue("skipLoad"); let skipLoad = GM_getValue("skipLoad");
if (skipLoad) if (skipLoad) {
cwith(-2, -2);
return -1; return -1;
}
if (useNetDB != undefined && useNetDB == 1) if (useNetDB != undefined && useNetDB == 1)
return ReadNetDB(cwith, useNetDB); return ReadNetDB(cwith, useNetDB);