mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Alert on test mode, and some message when trying to solve questions on passive mode
This commit is contained in:
parent
268754d2e4
commit
a46bc362ee
1 changed files with 17 additions and 1 deletions
18
main.js
18
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue