diff --git a/main.js b/main.js index d0f4bd6..4dfa808 100644 --- a/main.js +++ b/main.js @@ -20,9 +20,14 @@ ------------------------------------------------------------------------- */ +/* TODO + * remove stuff like "b. answer", "c. answer" .... + * */ + var data; // all data, which is in the resource txt var addEventListener; // add event listener function -const lastChangeLog = 'Néhány szerkezeti átalakítás, és bugfix. Ha valami elromlott akkor pls report, thanx'; +const lastChangeLog = + 'Néhány szerkezeti átalakítás, és bugfix. Ha valami elromlott akkor pls report, thanx'; const serverAdress = "https://qmining.tk/"; // forcing pages for testing. unless you test, do not set these to true! @@ -1325,13 +1330,19 @@ function ShowSaveQuizDialog(addedQ, allQ, allOutput, output, sendSuccess, sentDa m: msg, isSimple: true }, null, function() { - var towrite = '<h3>' + sentData.subj + '<br>TXT-ben nem szereplő kérdések: ' + addedQ + '/' + allQ + '</h3><br>' + + var towrite = '<h3>' + sentData.subj + '<br>TXT-ben nem szereplő kérdések: ' + addedQ + '/' + + allQ + '</h3><br>' + output.replace(/\n/g, '<br>') + '<br><h3>Összes kérdés/válasz:</h3>' + allOutput.replace( /\n/g, '<br>'); var useNetDB = GM_getValue("useNetDB"); - if (useNetDB != undefined && useNetDB == 1) - towrite += "</p>Elküldött adatok:</p> " + sentData; + if (useNetDB != undefined && useNetDB == 1) { + try { + towrite += "</p>Elküldött adatok:</p> " + JSON.stringify(sentData); + } catch (e) { + towrite += "</p>Elküldött adatok:</p> " + sentData; + } + } document.write(towrite); document.close(); });