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

10
main.js
View file

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