All-or-nothing mode for Matching question type

All-or-nothing mode for Matching question type

لە لایەن Ella S. -
Number of replies: 11

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

Moodle 2.7

تێکرایى نمرەپێدراوەکان: -
In reply to Ella S.

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

لە لایەن 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

In reply to Ella S.

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

لە لایەن Joseph Rézeau -
وێنەی Core developers وێنەی Particularly helpful Moodlers وێنەی Plugin developers وێنەی Testers وێنەی Translators

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

Joseph

تێکرایى نمرەپێدراوەکان:Useful (1)
In reply to Joseph Rézeau

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

لە لایەن Ella S. -

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

In reply to Ella S.

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

لە لایەن Joseph Rézeau -
وێنەی Core developers وێنەی Particularly helpful Moodlers وێنەی Plugin developers وێنەی Testers وێنەی 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

In reply to Joseph Rézeau

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

لە لایەن 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 چاوداگرتن

In reply to Jean-Michel Védrine

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

لە لایەن 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)
In reply to Jean-Michel Védrine

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

لە لایەن 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.


In reply to Jean-Michel Védrine

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

لە لایەن Joseph Rézeau -
وێنەی Core developers وێنەی Particularly helpful Moodlers وێنەی Plugin developers وێنەی Testers وێنەی 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

تێکرایى نمرەپێدراوەکان:Useful (2)
In reply to Ella S.

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

لە لایەن Joseph Rézeau -
وێنەی Core developers وێنەی Particularly helpful Moodlers وێنەی Plugin developers وێنەی Testers وێنەی 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?

تێکرایى نمرەپێدراوەکان:Useful (1)
In reply to Joseph Rézeau

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

لە لایەن Tim Hunt -
وێنەی Core developers وێنەی Documentation writers وێنەی Particularly helpful Moodlers وێنەی Peer reviewers وێنەی 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.