mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Removing line breaks from the to-be-saved questions/answers
This commit is contained in:
parent
8aeb5ecf63
commit
6fa1625755
1 changed files with 7 additions and 3 deletions
10
main.js
10
main.js
|
@ -28,8 +28,8 @@ const serverAdress = "https://qmining.tk/";
|
|||
|
||||
// forcing pages for testing. unless you test, do not set these to true!
|
||||
// only one of these should be true for testing
|
||||
const forceTestPage = true;
|
||||
const forceResultPage = false;
|
||||
const forceTestPage = false;
|
||||
const forceResultPage = true;
|
||||
const forceDefaultPage = false;
|
||||
const logElementGetting = false;
|
||||
const log = true;
|
||||
|
@ -954,7 +954,7 @@ function NLoad(resource, cwith) {
|
|||
} catch (e2) {
|
||||
Log("Couldt parse data!");
|
||||
ShowMessage({
|
||||
m: "Nem sikerült betölteni az adatokat! Ellenőriz a megadott fájlt, vagy az internetelérésed!",
|
||||
m: "Nem sikerült betölteni az adatokat! Ellenőriz a megadott fájlt, vagy az internetelérésed!",
|
||||
isSimple: true
|
||||
});
|
||||
return;
|
||||
|
@ -1301,6 +1301,7 @@ function GetQuiz() {
|
|||
var q = GetQuestionFromResult(i);
|
||||
if (q != undefined)
|
||||
question.q = SimplifyQuery(q);
|
||||
|
||||
// RIGHTANSWER ---------------------------------------------------------------------------------------------------------------------
|
||||
var a = GetRightAnswerFromResultv2(i);
|
||||
if (a == undefined)
|
||||
|
@ -1311,6 +1312,9 @@ function GetQuiz() {
|
|||
var img = GetImageFormResult(i);
|
||||
question.i = img;
|
||||
|
||||
q = ReplaceCharsWithSpace(q, "\n");
|
||||
a = ReplaceCharsWithSpace(a, "\n");
|
||||
|
||||
if (question.a != undefined) // adding only if has question
|
||||
{
|
||||
quiz.push(new Question(question.q, question.a, question.i)); // adding current question to quiz
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue