Suggestion for a new Question Behaviour

Suggestion for a new Question Behaviour

by Matthias Giger -
Number of replies: 7
Picture of Particularly helpful Moodlers

Moodle quiz allows for different question behaviours. However, with H5P there is a question behaviour which allows for feedback after each cloze the user fills in. 

This is similar to Moodle's "interactive with multiple tries" or "adaptive mode". But in those modes, a user needs to fill all the gaps of a question before the answers can be checked.

When you try to do that in Moodle, you get an error message:

Feedback when checking a question without answering all the gaps

It would be nice to have a mode where a user can check the answers even if there are still some gaps to fill. This would be useful in language teaching, especially for students who haven't reached a high level of mastery yet.

I don't know what it would take to adjust existing behaviours as storage in the database will probably be envolved.

What do you think? Could that be Moodle's answer to some H5P features?

BTW, I would like Moodle's native quiz engine for that purpose because it allows for more freedom in placing your elements than H5P does.

Average of ratings: Useful (4)
In reply to Matthias Giger

Re: Suggestion for a new Question Behaviour

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Actually, there is already a behaviour that does this: adaptivemultipart, which is used by STACK and (I think) forumlas.

It might be a good thing to convert core Cloze question type to use that behaviour. (MDL-37188)
In reply to Tim Hunt

Re: Suggestion for a new Question Behaviour

by Matthias Giger -
Picture of Particularly helpful Moodlers

Of course it would be preferable if the question behaviour could work will all question types which have multiple parts. For language teaching Marcus Green's gapfill question type would probably the best choice due to its flexibility.

A question behaviour which only works with a few question types could be problematic from a user perspective.

In reply to Tim Hunt

Re: Suggestion for a new Question Behaviour

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
How hard would it be to convert a different question type to work with that behaviour?
In reply to Marcus Green

Re: Suggestion for a new Question Behaviour

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In theory it should not be too difficult. Basically, you just need to make your question definition class implement the extra interface question_automatically_gradable_with_multiple_parts (https://github.com/maths/moodle-qbehaviour_adaptivemultipart/blob/master/behaviour.php#L37). Then change the make_behaviour method to include

if ($preferredbehaviour == 'adaptive' ||
        $preferredbehaviour == 'adaptivenopenalty') {
    return question_engine::make_behaviour('adaptivemultipart',
            $qa, $preferredbehaviour);
}

However, it is not quite that simple. To make the display of feedback work for STACK, I had to resort to nasty hacks in the renderer (e.g. https://github.com/maths/moodle-qtype_stack/blob/master/renderer.php#L262). I think that sort of pragmatic mess is sometimes necessary in third-party plugins, but I would be a bit reluctant to put that sort of thing in Moodle core. I looks to me like a symptom that the design is not quite right. If we are doing things in core, we should try to take the opportunity to improve the design of the question system so we can achieve the desired result without hacks.

That second bit makes the whole thing harder.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Suggestion for a new Question Behaviour

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
You might be amused at the signature of my question type...(the comment is present in the repo)
class qtype_gapfill_question extends question_graded_automatically_with_countback {
    /* Not actually using the countback bit at the moment, not sure what it does.
     * if you are trying to make sense of Moodle question code, check the following link
     * http://docs.moodle.org/dev/Question_engine
     */
In reply to Marcus Green

Re: Suggestion for a new Question Behaviour

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Not sure I believe the comment. You are using the countback bit: https://github.com/marcusgreen/moodle-qtype_gapfill/blob/master/question.php#L520 - at least it looks like you are trying to.
In reply to Tim Hunt

Re: Suggestion for a new Question Behaviour

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
It might have been true when I wrote it, possibly before it worked correctly. I shall remove it.