mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Adding cid on qmining site to better find user errors by cid
This commit is contained in:
parent
ac127afb99
commit
2f9446157b
2 changed files with 43 additions and 2 deletions
|
@ -25,6 +25,8 @@
|
||||||
// @author Yout
|
// @author Yout
|
||||||
// @match https://elearning.uni-obuda.hu/main/*
|
// @match https://elearning.uni-obuda.hu/main/*
|
||||||
// @match https://elearning.uni-obuda.hu/kmooc/*
|
// @match https://elearning.uni-obuda.hu/kmooc/*
|
||||||
|
// @match https://qmining.frylabs.net/*
|
||||||
|
// @match http://qmining.frylabs.net/*
|
||||||
// @match file:///*
|
// @match file:///*
|
||||||
// @grant GM_getResourceText
|
// @grant GM_getResourceText
|
||||||
// @grant GM_info
|
// @grant GM_info
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
// @match https://elearning.uni-obuda.hu/main/*
|
// @match https://elearning.uni-obuda.hu/main/*
|
||||||
// @match https://elearning.uni-obuda.hu/kmooc/*
|
// @match https://elearning.uni-obuda.hu/kmooc/*
|
||||||
// @match https://mooc.unideb.hu/*
|
// @match https://mooc.unideb.hu/*
|
||||||
|
// @match https://qmining.frylabs.net/*
|
||||||
|
// @match http://qmining.frylabs.net/*
|
||||||
// @grant GM_getResourceText
|
// @grant GM_getResourceText
|
||||||
// @grant GM_info
|
// @grant GM_info
|
||||||
// @grant GM_getValue
|
// @grant GM_getValue
|
||||||
|
@ -610,7 +612,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function AfterLoad () {
|
function AfterLoad () {
|
||||||
var url = location.href // eslint-disable-line
|
const url = location.href // eslint-disable-line
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ((url.includes('/quiz/') && url.includes('attempt.php')) || forceTestPage) { // if the current page is a test
|
if ((url.includes('/quiz/') && url.includes('attempt.php')) || forceTestPage) { // if the current page is a test
|
||||||
|
@ -651,8 +653,46 @@
|
||||||
// : Main logic stuff {{{
|
// : Main logic stuff {{{
|
||||||
|
|
||||||
// : Loading {{{
|
// : Loading {{{
|
||||||
|
function HandleQminingSite (url) {
|
||||||
|
try {
|
||||||
|
Array.from(document.getElementById('sideBarLinks').childNodes).forEach((link) => {
|
||||||
|
link.addEventListener('mousedown', () => {
|
||||||
|
FillFeedbackCID(url, link)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
FillFeedbackCID(url,
|
||||||
|
document.getElementById('sideBarLinks').getElementsByClassName('active')[0]
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
console.info('Error filling client ID input', e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function FillFeedbackCID (url, link) {
|
||||||
|
try {
|
||||||
|
if (link.id === 'feedback') {
|
||||||
|
const cidSetInterval = setInterval(() => {
|
||||||
|
const cid = document.getElementById('cid')
|
||||||
|
if (cid) {
|
||||||
|
cid.value = GetId()
|
||||||
|
window.clearInterval(cidSetInterval)
|
||||||
|
}
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.info('Error filling client ID input', e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Init () {
|
function Init () {
|
||||||
|
const url = location.href // eslint-disable-line
|
||||||
|
|
||||||
|
if (url.includes(serverAdress.split('/')[2])) {
|
||||||
|
HandleQminingSite(url)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (false) { // eslint-disable-line
|
if (false) { // eslint-disable-line
|
||||||
setVal('version16', undefined)
|
setVal('version16', undefined)
|
||||||
setVal('version15', undefined)
|
setVal('version15', undefined)
|
||||||
|
@ -660,7 +700,6 @@
|
||||||
setVal('showQuestions', undefined)
|
setVal('showQuestions', undefined)
|
||||||
setVal('showSplash', undefined)
|
setVal('showSplash', undefined)
|
||||||
}
|
}
|
||||||
var url = location.href // eslint-disable-line
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
// event listener fuckery
|
// event listener fuckery
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue