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
8
main.js
8
main.js
|
@ -28,8 +28,8 @@ const serverAdress = "https://qmining.tk/";
|
||||||
|
|
||||||
// forcing pages for testing. unless you test, do not set these to true!
|
// forcing pages for testing. unless you test, do not set these to true!
|
||||||
// only one of these should be true for testing
|
// only one of these should be true for testing
|
||||||
const forceTestPage = true;
|
const forceTestPage = false;
|
||||||
const forceResultPage = false;
|
const forceResultPage = true;
|
||||||
const forceDefaultPage = false;
|
const forceDefaultPage = false;
|
||||||
const logElementGetting = false;
|
const logElementGetting = false;
|
||||||
const log = true;
|
const log = true;
|
||||||
|
@ -1301,6 +1301,7 @@ function GetQuiz() {
|
||||||
var q = GetQuestionFromResult(i);
|
var q = GetQuestionFromResult(i);
|
||||||
if (q != undefined)
|
if (q != undefined)
|
||||||
question.q = SimplifyQuery(q);
|
question.q = SimplifyQuery(q);
|
||||||
|
|
||||||
// RIGHTANSWER ---------------------------------------------------------------------------------------------------------------------
|
// RIGHTANSWER ---------------------------------------------------------------------------------------------------------------------
|
||||||
var a = GetRightAnswerFromResultv2(i);
|
var a = GetRightAnswerFromResultv2(i);
|
||||||
if (a == undefined)
|
if (a == undefined)
|
||||||
|
@ -1311,6 +1312,9 @@ function GetQuiz() {
|
||||||
var img = GetImageFormResult(i);
|
var img = GetImageFormResult(i);
|
||||||
question.i = img;
|
question.i = img;
|
||||||
|
|
||||||
|
q = ReplaceCharsWithSpace(q, "\n");
|
||||||
|
a = ReplaceCharsWithSpace(a, "\n");
|
||||||
|
|
||||||
if (question.a != undefined) // adding only if has question
|
if (question.a != undefined) // adding only if has question
|
||||||
{
|
{
|
||||||
quiz.push(new Question(question.q, question.a, question.i)); // adding current question to quiz
|
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