Is this possible to use "All-or-nothing" mode for Matching question type?
Moodle 2.7
Hello Ella ,
All or nothing is a question type . Following All or Nothing question types are available :
All or nothing multi-choice question
All or nothing Embedded answer cloze question
There is no for matching
In the Lesson activity, the Matching question works that way (all-or-nothing).
Joseph
I need this in test. Is there any plugins to do it?
I am not aware of an add-on like this. It is probably not too much work to make such an add-on, but of course, someone would need to do that work.
No, there is no "plugin" to do what you want. Have you considered using the Lesson activity instead? Could you post a sample question so we can make other suggestions?
Joseph
Joseph Rézeau wrote "No, there is no "plugin" to do what you want."
Are you really sure of that Joseph ?
Well I must admit that when you wrote that it was true
Some notes:
I have now done the compute_final_grade function so Interactive with multiple tries behaviour should work too.
I have added some phpunit tests for my compute_final_grade function because I was not really sure I got it right.
Also I have modified the existing tests for matching questions so that they run and give some confidence the matchset question is correctly graded.
Hi Jean-Michel,
You are correct, my suggested hack did not take into account the "multiple tries behaviour". I have tested your matchset question type and it seems to work fine. Congratulations!
However, I persist in thinking that "all-or-nothing" should really be made an option of the core Matching question. Whenever a new function/option is requested for an existing question type, it has to be decided whether a) it's a minor but useful function that should be part of the original question type or b) it is a major change and deserves a new question type to be created. For me, this "all-or-nothing" option clearly belongs to the first case. Since Tim seems to agree and you are very knowledgeable in the question code, would you agree to implement the change in a way that would be agreeable to Tim?
Joseph
@Ella,
If a) you (or your admin) are ready to hack your moodle core files b) you want ALL Quiz Matching questions on your Moodle site to behave in an "all-or-nothing" way, then all you need is to make a small change to file yourmoodle/question/type/match/question.php.
Locate function grade_response(array $response). In Moodle 2.7 (current version) it's around line 270 and replace:
$fraction = $right / $total;
with
if ($right < $total) {
$fraction = 0;
} else {
$fraction = $right / $total;
}
See the result:
Joseph
PS.- @Tim, why not make the "all-or-nothing" feature a setting of the Matching question?
Yes, I did wonder about making it an option.
I have no fundamental objection to the idea. I would just like to see it implemented well, with unit tests, before it goes into core.