From f7cc4378ab7307fff1f5a41fa3244ff7967b90e1 Mon Sep 17 00:00:00 2001 From: mrfry Date: Tue, 22 Dec 2020 15:23:16 +0100 Subject: [PATCH] Location.href-s to currurl, minimal fixes --- stable.user.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/stable.user.js b/stable.user.js index 5c40d59..08095a0 100755 --- a/stable.user.js +++ b/stable.user.js @@ -112,8 +112,8 @@ // forcing pages for testing. unless you test, do not set these to true! setVal('ISDEVEL', 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 var addEventListener // add event listener function @@ -146,6 +146,8 @@ apiAdress = 'http://localhost:8080/' } + const currUrl = 'https://elearning.uni-obuda.hu/' // location.href TODO + // : Localisation {{{ const huTexts = { @@ -342,7 +344,7 @@ post('ask', { questions: questions, subj: getCurrentSubjectName(), - location: location.href, + location: currUrl, version: info().script.version, cid: cid, uid: uid, @@ -979,7 +981,7 @@ } function AfterLoad() { - const url = location.href // eslint-disable-line + const url = currUrl try { if ( @@ -1073,7 +1075,7 @@ } function Init() { - const url = location.href // eslint-disable-line + const url = currUrl if (url.includes(serverAdress.split('/')[2])) { HandleQminingSite(url) @@ -1398,6 +1400,7 @@ version: info().script.version, id: GetId(), quiz: quiz, + location: currUrl, } try { sentData.subj = getCurrentSubjectName() @@ -1407,7 +1410,7 @@ } console.log('SENT DATA', sentData) post('isAdding', sentData).then(res => { - next(res.success, sentData, res.newQuestions) + next(res.success, sentData, res.totalNewQuestions) }) } catch (e) { Exception(e, 'error at sending data to server.')