All-or-nothing mode for Matching question type

All-or-nothing mode for Matching question type

von Ella S. -
Anzahl Antworten: 11

Is this possible to use "All-or-nothing" mode for Matching question type?

Moodle 2.7

Als Antwort auf Ella S.

Re: All-or-nothing mode for Matching question type

von Sakshi Goel -

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

Als Antwort auf Ella S.

Re: All-or-nothing mode for Matching question type

von Joseph Rézeau -
Nutzerbild von Core developers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers Nutzerbild von Translators

In the Lesson activity, the Matching question works that way (all-or-nothing).

Joseph

Als Antwort auf Joseph Rézeau

Re: All-or-nothing mode for Matching question type

von Ella S. -

I need this in test. Is there any plugins to do it?

Als Antwort auf Ella S.

Re: All-or-nothing mode for Matching question type

von Tim Hunt -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers

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.

Als Antwort auf Ella S.

Re: All-or-nothing mode for Matching question type

von Joseph Rézeau -
Nutzerbild von Core developers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers Nutzerbild von Translators

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

Als Antwort auf Joseph Rézeau

Re: All-or-nothing mode for Matching question type

von Jean-Michel Védrine -

Joseph Rézeau wrote "No, there is no "plugin" to do what you want."

Are you really sure of that Joseph ?

See here

Well I must admit that when you wrote that it was true zwinkernd

Als Antwort auf Jean-Michel Védrine

Re: All-or-nothing mode for Matching question type

von Jean-Michel Védrine -

Some notes:

  • completely untested and I didn't had time to modify the phpunit tests.
  • It doesn't work in interactive with multiple tries as I didn't had time to modify the compute_final_grade function
  • all other features are done including Moodle XML import/export (but that also would need some testing)
Als Antwort auf Jean-Michel Védrine

Re: All-or-nothing mode for Matching question type

von Jean-Michel Védrine -

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.


Als Antwort auf Jean-Michel Védrine

Re: All-or-nothing mode for Matching question type

von Joseph Rézeau -
Nutzerbild von Core developers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers Nutzerbild von Translators

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

Als Antwort auf Ella S.

Re: All-or-nothing mode for Matching question type

von Joseph Rézeau -
Nutzerbild von Core developers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers Nutzerbild von Translators

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

screenshot #1

Joseph

PS.- @Tim, why not make the "all-or-nothing" feature a setting of the Matching question?

Als Antwort auf Joseph Rézeau

Re: All-or-nothing mode for Matching question type

von Tim Hunt -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers

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.