Question getting match percent fix, licence fix

This commit is contained in:
YourFriendlyNeighborhoodDealer 2019-03-06 09:43:05 +01:00
parent 4ed1fab920
commit fad66afef8
3 changed files with 17 additions and 4 deletions

View file

@ -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

View file

@ -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
View file

@ -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