mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Added unique ID for statistics
This commit is contained in:
parent
aaf93c8fad
commit
6cee318903
1 changed files with 14 additions and 1 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
// ==UserScript==
|
||||
// @name Moodle/Elearning/KMOOC test help
|
||||
// @version 1.6.4.6
|
||||
// @version 1.6.4.7
|
||||
// @description Online Moodle/Elearning/KMOOC test help
|
||||
// @author MrFry
|
||||
// @match https://elearning.uni-obuda.hu/main/*
|
||||
|
@ -55,6 +55,7 @@
|
|||
var addEventListener // add event listener function
|
||||
const lastChangeLog = 'Kérdés parsolás bugfixek, old school fálj beolvasás kiszedése, részletesebb hibajelentés és egyéb fixek'
|
||||
const serverAdress = 'https://qmining.frylabs.net/'
|
||||
// const serverAdress = 'http://localhost:8080/'
|
||||
|
||||
// forcing pages for testing. unless you test, do not set these to true!
|
||||
// only one of these should be true for testing
|
||||
|
@ -1363,6 +1364,7 @@
|
|||
sentData.allData = quiz
|
||||
sentData.data = newQuestions
|
||||
sentData.version = info().script.version
|
||||
sentData.id = GetId()
|
||||
SendXHRMessage('datatoadd=' + JSON.stringify(sentData))
|
||||
sendSuccess = true
|
||||
} catch (e) {
|
||||
|
@ -2099,6 +2101,17 @@
|
|||
// : }}}
|
||||
|
||||
// : Generic utils {{{
|
||||
function GetId () {
|
||||
let currId = getVal('clientId')
|
||||
if (currId) {
|
||||
return currId
|
||||
} else {
|
||||
currId = new Date()
|
||||
currId = currId.getTime() + Math.floor(Math.random() * 10000000)
|
||||
setVal('clientId', currId.toString())
|
||||
return currId
|
||||
}
|
||||
}
|
||||
|
||||
function CreateNodeWithText (to, text, type) {
|
||||
var paragraphElement = document.createElement(type || 'p') // new paragraph
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue