Location.href-s to currurl, minimal fixes

This commit is contained in:
mrfry 2020-12-22 15:23:16 +01:00
parent 0140095322
commit f7cc4378ab

View file

@ -112,8 +112,8 @@
// 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!
setVal('ISDEVEL', true) setVal('ISDEVEL', 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
var addEventListener // add event listener function var addEventListener // add event listener function
@ -146,6 +146,8 @@
apiAdress = 'http://localhost:8080/' apiAdress = 'http://localhost:8080/'
} }
const currUrl = 'https://elearning.uni-obuda.hu/' // location.href TODO
// : Localisation {{{ // : Localisation {{{
const huTexts = { const huTexts = {
@ -342,7 +344,7 @@
post('ask', { post('ask', {
questions: questions, questions: questions,
subj: getCurrentSubjectName(), subj: getCurrentSubjectName(),
location: location.href, location: currUrl,
version: info().script.version, version: info().script.version,
cid: cid, cid: cid,
uid: uid, uid: uid,
@ -979,7 +981,7 @@
} }
function AfterLoad() { function AfterLoad() {
const url = location.href // eslint-disable-line const url = currUrl
try { try {
if ( if (
@ -1073,7 +1075,7 @@
} }
function Init() { function Init() {
const url = location.href // eslint-disable-line const url = currUrl
if (url.includes(serverAdress.split('/')[2])) { if (url.includes(serverAdress.split('/')[2])) {
HandleQminingSite(url) HandleQminingSite(url)
@ -1398,6 +1400,7 @@
version: info().script.version, version: info().script.version,
id: GetId(), id: GetId(),
quiz: quiz, quiz: quiz,
location: currUrl,
} }
try { try {
sentData.subj = getCurrentSubjectName() sentData.subj = getCurrentSubjectName()
@ -1407,7 +1410,7 @@
} }
console.log('SENT DATA', sentData) console.log('SENT DATA', sentData)
post('isAdding', sentData).then(res => { post('isAdding', sentData).then(res => {
next(res.success, sentData, res.newQuestions) next(res.success, sentData, res.totalNewQuestions)
}) })
} catch (e) { } catch (e) {
Exception(e, 'error at sending data to server.') Exception(e, 'error at sending data to server.')