mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Removed number before kgk questions, code formatting
This commit is contained in:
parent
b8b4af45a5
commit
4386dc72b5
1 changed files with 29 additions and 25 deletions
|
@ -46,7 +46,7 @@
|
|||
// : Script header {{{
|
||||
// ==UserScript==
|
||||
// @name Moodle/Elearning/KMOOC test help
|
||||
// @version 2.1.3.2
|
||||
// @version 2.1.3.3
|
||||
// @description Online Moodle/Elearning/KMOOC test help
|
||||
// @author MrFry
|
||||
// @match https://elearning.uni-obuda.hu/*
|
||||
|
@ -147,7 +147,7 @@
|
|||
const overlayElemUpdateInterval = 2 // seconds
|
||||
|
||||
if (isDevel) {
|
||||
log('Moodle script running in developement mode!')
|
||||
warn('Moodle script running in developement mode!')
|
||||
infoExpireTime = 1
|
||||
serverAdress = 'http://localhost:8080/'
|
||||
apiAdress = 'http://localhost:8080/'
|
||||
|
@ -1047,8 +1047,8 @@
|
|||
}
|
||||
|
||||
function HandleKGKResults(url) {
|
||||
const tableChilds = document.getElementsByTagName('table')[0].childNodes[0]
|
||||
.childNodes
|
||||
const tableChilds =
|
||||
document.getElementsByTagName('table')[0].childNodes[0].childNodes
|
||||
const question = removeUnnecesarySpaces(
|
||||
tableChilds[0].innerText.split(':')[1]
|
||||
)
|
||||
|
@ -1066,7 +1066,9 @@
|
|||
location: url,
|
||||
quiz: [
|
||||
{
|
||||
Q: question,
|
||||
Q: question.includes('.')
|
||||
? question.split('.').splice(1).join('.').trim()
|
||||
: question,
|
||||
A: answer,
|
||||
data: {
|
||||
type: 'simple',
|
||||
|
@ -1077,6 +1079,7 @@
|
|||
],
|
||||
}
|
||||
|
||||
log(sentData)
|
||||
post('isAdding', sentData).then((res) => {
|
||||
ShowSaveQuizDialog(res.success, sentData, res.totalNewQuestions)
|
||||
})
|
||||
|
@ -2055,7 +2058,7 @@
|
|||
|
||||
Array.from(messageNode.childNodes).forEach((node) => {
|
||||
if (node.tagName === 'A') {
|
||||
let linkNode = document.createElement('span')
|
||||
const linkNode = document.createElement('span')
|
||||
SetStyle(linkNode, {
|
||||
color: 'lightblue',
|
||||
textDecoration: 'underline',
|
||||
|
@ -2084,7 +2087,9 @@
|
|||
}
|
||||
|
||||
let currOpacity = getVal(`${elem.id}_opacity`) || 1
|
||||
elem.addEventListener('wheel', (e) => {
|
||||
elem.addEventListener(
|
||||
'wheel',
|
||||
(e) => {
|
||||
e.preventDefault()
|
||||
const isUp = e.deltaY < 0
|
||||
if (isUp) {
|
||||
|
@ -2098,7 +2103,9 @@
|
|||
}
|
||||
elem.style.opacity = currOpacity
|
||||
setVal(`${elem.id}_opacity`, currOpacity)
|
||||
})
|
||||
},
|
||||
{ capture: true }
|
||||
)
|
||||
}
|
||||
|
||||
function addMoveEventListener(elem) {
|
||||
|
@ -2364,11 +2371,8 @@
|
|||
'.'
|
||||
}
|
||||
|
||||
result.msgContainer.child.leftSideDiv.child.matchPercent.elem.innerText = isNaN(
|
||||
getCurrMsg().p
|
||||
)
|
||||
? ''
|
||||
: getCurrMsg().p + '%'
|
||||
result.msgContainer.child.leftSideDiv.child.matchPercent.elem.innerText =
|
||||
isNaN(getCurrMsg().p) ? '' : getCurrMsg().p + '%'
|
||||
|
||||
result.msgContainer.child.msgDiv.elem.innerText = getCurrMsg().m
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue