mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Question getting match percent fix, licence fix
This commit is contained in:
parent
4ed1fab920
commit
fad66afef8
3 changed files with 17 additions and 4 deletions
10
main.js
10
main.js
|
@ -39,6 +39,7 @@ var motd = "";
|
|||
var lastestVersion = "";
|
||||
|
||||
const minMatchAmmount = 55;
|
||||
const minResultMatchPercent = 99;
|
||||
const lengthDiffMultiplier = 10;
|
||||
|
||||
//: Class descriptions {{{
|
||||
|
@ -1232,7 +1233,14 @@ function ShowSaveQuizDialog(addedQ, allQ, allOutput, output, sendSuccess, sentDa
|
|||
|
||||
function SearchSameQuestion(questionData, quiz, i) {
|
||||
var r = questionData.Search(quiz[i].Q);
|
||||
return r.length == 0 ? -1 : r.length;
|
||||
|
||||
let count = 0;
|
||||
r.forEach((item) => {
|
||||
if (item.match > minResultMatchPercent)
|
||||
count ++;
|
||||
});
|
||||
|
||||
return count == 0 ? -1 : count;
|
||||
}
|
||||
|
||||
// this should get the image url from a result page
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue