Removing line breaks from the to-be-saved questions/answers

This commit is contained in:
YourFriendlyNeighborhoodDealer 2019-03-04 21:07:25 +01:00
parent 8aeb5ecf63
commit 6fa1625755

View file

@ -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