mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Question class tostring, removed some todos
This commit is contained in:
parent
339d67d5cc
commit
ba9f812041
1 changed files with 4 additions and 11 deletions
|
@ -260,11 +260,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
toString () {
|
toString () {
|
||||||
var r = '?' + this.Q + '\n!' + this.A
|
if (this.data.type !== 'simple') {
|
||||||
if (this.data.type === 'image') {
|
return '?' + this.Q + '\n!' + this.A + '\n>' + JSON.stringify(this.data)
|
||||||
r += '\n>' + this.data.images.join(', ')
|
} else {
|
||||||
|
return '?' + this.Q + '\n!' + this.A
|
||||||
}
|
}
|
||||||
return r
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HasQuestion () {
|
HasQuestion () {
|
||||||
|
@ -798,7 +798,6 @@
|
||||||
// "húzza oda ..." skip
|
// "húzza oda ..." skip
|
||||||
fun.push((i) => {
|
fun.push((i) => {
|
||||||
let temp = RPM.GetAnswersFromGrabBox(i)
|
let temp = RPM.GetAnswersFromGrabBox(i)
|
||||||
console.log('GRABBOX TEST', temp) // TODO: remove
|
|
||||||
return temp.map((x) => {
|
return temp.map((x) => {
|
||||||
return x.text
|
return x.text
|
||||||
}).join(', ')
|
}).join(', ')
|
||||||
|
@ -1264,7 +1263,6 @@
|
||||||
var answers = []
|
var answers = []
|
||||||
questions.forEach((x, j) => {
|
questions.forEach((x, j) => {
|
||||||
let question = SUtils.EmptyOrWhiteSpace(x) ? '' : SUtils.RemoveUnnecesarySpaces(x) // simplifying question
|
let question = SUtils.EmptyOrWhiteSpace(x) ? '' : SUtils.RemoveUnnecesarySpaces(x) // simplifying question
|
||||||
// TODO: getdatafromquestion, implement grabboxes answering
|
|
||||||
var result = data.Search(question, GetImageDataFromImgNodes(imgNodes))
|
var result = data.Search(question, GetImageDataFromImgNodes(imgNodes))
|
||||||
var r = PrepareAnswers(result, j)
|
var r = PrepareAnswers(result, j)
|
||||||
if (r !== undefined) { answers.push(r) }
|
if (r !== undefined) { answers.push(r) }
|
||||||
|
@ -1387,11 +1385,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
// function GetGrabBoxPositionsFromQuestion (i) {
|
|
||||||
// return asd
|
|
||||||
// }
|
|
||||||
|
|
||||||
function GetDataFormResult (i) {
|
function GetDataFormResult (i) {
|
||||||
let data = { type: 'simple' }
|
let data = { type: 'simple' }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue