mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Removed small OOP code from main branch
This commit is contained in:
parent
02461eb74a
commit
96ea28e208
1 changed files with 0 additions and 30 deletions
30
main.js
30
main.js
|
@ -746,36 +746,6 @@ function Load(cwith) {
|
|||
return ReadFile(cwith);
|
||||
}
|
||||
|
||||
// Creates a Question.
|
||||
// q: question
|
||||
// a: answer
|
||||
// i: image
|
||||
function Question(q, a, i) {
|
||||
this.question = q;
|
||||
this.answer = a;
|
||||
this.image = i;
|
||||
// Compares to another question. Simplifies question before comparing
|
||||
// returns: true, if its matching
|
||||
this.Compare = function(q2) {
|
||||
var j = 0;
|
||||
for (var j = 0; j < questionData.length; j++) {
|
||||
var q1 = SimplifyStringForComparison(this.question);
|
||||
var q2 = SimplifyStringForComparison(q2.question);
|
||||
var a1 = SimplifyStringForComparison();
|
||||
var a2 = SimplifyStringForComparison();
|
||||
if (q1.includes(q2) && a2.includes(a2)) { // if the questions and the answers match
|
||||
if (quiz[i].i && questionData[j].i) { // if it has image questionData
|
||||
if (questionData[j].i.includes(quiz[i].i)) // if they are the same
|
||||
return j;
|
||||
} else {
|
||||
return j;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
function LoadMOTD(resource) {
|
||||
try {
|
||||
if (resource[0][0] == '@')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue