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!
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.')