mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Merge branch 'master' of gitlab.com:MrFry/moodle-test-userscript
This commit is contained in:
commit
3e48f16f8a
1 changed files with 8 additions and 6 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
// ==UserScript==
|
||||
// @name Moodle/Elearning/KMOOC test help
|
||||
// @version 2.0.1.9
|
||||
// @version 2.0.1.10
|
||||
// @description Online Moodle/Elearning/KMOOC test help
|
||||
// @author MrFry
|
||||
// @match https://elearning.uni-obuda.hu/main/*
|
||||
|
@ -580,12 +580,12 @@
|
|||
GuessCorrectIn2LengthAnswersByPoints (i, items) {
|
||||
const first = {
|
||||
elem: items[0],
|
||||
val: parseInt(items[0].childNodes[0].value),
|
||||
val: items[0].childNodes[0].checked,
|
||||
text: items[0].innerText
|
||||
}
|
||||
const second = {
|
||||
elem: items[1],
|
||||
val: parseInt(items[1].childNodes[0].value),
|
||||
val: items[1].childNodes[0].checked,
|
||||
text: items[1].innerText
|
||||
}
|
||||
|
||||
|
@ -593,19 +593,21 @@
|
|||
const grades = grade.split(' ').reduce((acc, text) => {
|
||||
if (text.includes(',')) { // FIXME: fancy regexp
|
||||
acc.push(parseInt(text))
|
||||
} else if (text.includes('.')) { // FIXME: fancy regexp
|
||||
acc.push(parseInt(text))
|
||||
}
|
||||
return acc
|
||||
}, [])
|
||||
|
||||
if (grades[0] === 1) {
|
||||
if (first.val === 1) {
|
||||
if (first.val) {
|
||||
return first.text
|
||||
} else {
|
||||
return second.text
|
||||
}
|
||||
} else {
|
||||
if (first.val === 0) {
|
||||
return first.txt
|
||||
if (!first.val) {
|
||||
return first.text
|
||||
} else {
|
||||
return second.text
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue