mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Merge branch 'master' into devel
This commit is contained in:
21
main.js
21
main.js
@@ -540,7 +540,9 @@ class ResultsPageModell {
|
||||
if (logElementGetting) { Log('Getting right answer if correct not shown') }
|
||||
var results = this.GetFormResult() // getting results element
|
||||
var n = results[i].getElementsByTagName('i')[0].parentNode
|
||||
if (n.className.includes('correct') && !n.className.includes('incorrect')) { return results[i].getElementsByTagName('i')[0].parentNode.innerText } else { return '' }
|
||||
if (n.className.includes('correct') && !n.className.includes('incorrect')) {
|
||||
return results[i].getElementsByTagName('i')[0].parentNode.innerText
|
||||
}
|
||||
}
|
||||
|
||||
GetFormCFOfResult (result) {
|
||||
@@ -560,6 +562,15 @@ class ResultsPageModell {
|
||||
return this.GetFormCFOfResult(results[i]).getElementsByTagName('img')
|
||||
}
|
||||
|
||||
GetOnlyImageQuestionResult (i) {
|
||||
console.log('############################################################')
|
||||
console.log(i)
|
||||
const results = this.GetFormResult() // getting results element
|
||||
const n = results[i]
|
||||
console.log(n)
|
||||
console.log('############################################################')
|
||||
}
|
||||
|
||||
// gets the question from the result page
|
||||
// i is the index of the question
|
||||
GetQuestionFromResult (i) {
|
||||
@@ -608,6 +619,11 @@ class ResultsPageModell {
|
||||
if (RPM.GetDropboxes(i).length > 0) { return RPM.GetCurrentAnswer(i) }
|
||||
})
|
||||
|
||||
// image and text only question
|
||||
fun.push(function TryGet5 (i) {
|
||||
return RPM.GetOnlyImageQuestionResult(i)
|
||||
})
|
||||
|
||||
// if the correct answers are not shown, and the selected answer
|
||||
// is correct
|
||||
fun.push(function TryGet2 (i) {
|
||||
@@ -637,7 +653,10 @@ class ResultsPageModell {
|
||||
var j = 0
|
||||
var currAnswer
|
||||
while (j < fun.length && SUtils.EmptyOrWhiteSpace(currAnswer)) {
|
||||
try {
|
||||
currAnswer = fun[j](i)
|
||||
} catch (e) {
|
||||
}
|
||||
j++
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user