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
|
@ -4,3 +4,8 @@
|
|||
1.6.1.0:
|
||||
Changed server domain name
|
||||
Fixed not found data file "brick"
|
||||
1.6.1.5:
|
||||
Question answering/getting/parsing improvements
|
||||
Passive mode
|
||||
1.6.1.6:
|
||||
Fixed question saving match percent
|
||||
|
|
6
license
6
license
|
@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
|
|||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
Moodle test solver userscript
|
||||
Copyright (C) 2019 YourFriendlyNeighborhoodDealer
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
|||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
Moodle Test solver userscript Copyright (C) 2019 YourFriendlyNeighborhoodDealer
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
|
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