I don't know anything about this module. However, I just had a quick look at the code, and the change you want seems easy to make here: https://github.com/middlebury/moodle-mod_adaptivequiz/blob/921db48834d5c2399a3a0d7aea74ba93ab64b79a/catalgo.class.php#L297
Hi Tim,
Thanks for looking at it, its a rare module it seems hardly people have worked on it. I looked at line 297, is this for the cloze type of answers? I make it false for partialcorrect to be treated as a wrong.
Am i right?
I hope you looked at the whole method, not just the one line of code. And where that method was called from.
Hi Tim,
I think its not there, its somewhere on the question engine,
Here i edited
return question_state::$gradedpartial; | |
} | |
} | |
gradepartial to gradedwrong
It shows incorrect now on adaptivequiz but still marks it Right and proceeds to a higher level of question.
But marks it correct on adaptivequiz and proceeds to a higher difficulty
I did not see any evidence that mod_adaptive quiz looked at the question state. It seems to just look at the mark. I don't think you should change how questions (== resuable components) work just to make a small change in bahaviour in adaptive quiz.
// Return true if the question was marked correct. | |
if ((float) 0 < $mark) { | |
// Increment questions attempted. | |
$this->questattempted++; | |
return true; | |
} | |
// Increment questions attempted. | |
$this->questattempted++; | |
return false; |
If i choose cloze, with 4 options, the grades are out of 4, and one being correct makes the score 1/4, making it more then 0 and hence a right option for the adaptive.
I am sadly getting no response from either adaptivequiz github nor RemoteLearner in this regard.
Ah yes. That is a key point which is explained in the docs here: https://docs.moodle.org/dev/Overview_of_the_Moodle_question_engine#A_note_about_scores
The mod_adaptivemode code seems to spend a lot of unnecessary effort checking whether the mark is null or not. It is pretty simple. If the question has not been graded yet, the mark is null. Once it has been graded it is a number.
Anyway, if you switch from mark to fraction, then you get a score that is between 0 and 1.
$quba->get_question_fraction($slot)
Basically Mark = Fraction * [Max mark]
So, if i am not wrong i should replace
$quba->get_question_mark($slotid) to $quba->get_question_fraction($slotid);
wherever i find the get_question_mark
I edited two files adaptiveattempt.class.php and catalgo.class.php
/**
* This function determins whether the user answered the question correctly or incorrectly.
* If the answer is partially correct it is seen as correct.
* @param quesiton_usage_by_activity $quba an object loaded using the unique id of the attempt
* @param int $slotid the slot id of the question
* @return float|null a float representing the user's mark. Or null if there was no mark
*/
public function get_question_mark($quba, $slotid) {
$mark = $quba->get_question_fraction($slotid);
if (is_float($mark)) {
return $mark;
}
$this->print_debug('get_question_mark() - Question mark was not a float slot id: '.$slotid);
return null;
}
But sadly no change, i think i am missing something.
from if ($this->quba->get_question_mark($this->slot) > 0) {
to if ($this->quba->get_question_fraction($this->slot) > 0.9) {
Seems to do the trick And i also changed renderer.php to show the right marks on calculation table too.
Ouch Tim!
I changed that, now my other questions which are not cloze, multiple answer are giving me an error