More OU question types in the pipeline

Re: More OU question types in the pipeline

от Joseph Rézeau -
Number of replies: 7
Снимка на Core developers Снимка на Particularly helpful Moodlers Снимка на Plugin developers Снимка на Testers Снимка на Translators

@Jamie,

Actually, what I was asking for is much more than simply adding another expected Answer to the edit form. I would like the new Combined question type to retain (optionally, as an advanced feature, as you suggest) all the current features of Short Answer, pmatch, preg and regexp questions. That is to say, it should be possible - for each question of those types - to enter as many extra Answer fields as needed and as many specific feedback fields associated to each Answer field.

That is to say I would like those "open-ended" question types to work in Combined the way that Short Answer (and, with my hack, regexp) questions work currently in the Cloze/embedded question type. The only difference being that the specific feedback messages associated with each answer, instead of appearing on mouse hover, would get displayed at the bottom of the whole Combined question text.

No longer being able to display feedback upon mouse hovering is - for me - a regression, but I accept the need to be "politically correct" for accessibility reasons - plus the fact that mouses are not used on tablets & smartphones. The proposed display of specific feedback messages right at the bottom of the Combined question text means that, especially for longish question texts, those feedback messages might be displayed significantly far away from the sub-question "blank" they refer to, which causes a real ergonomic problem. I suggest that this ergonomic problem be alleviated at the time of displaying the question analysis, with marks, feedback, etc; e.g. by printing (small?) numbers next to each sub-question, referring to the same numbered feedback messages at the bottom of the screen. Something like footnotes in books. Those numbers could even be made into links, linking both ways to the footnotes and back. See attached screenshot #1.

Joseph

Attachment 29-04-2013 14-53-39.jpg
In reply to Joseph Rézeau

Re: More OU question types in the pipeline

от Marcus Green -
Снимка на Core developers Снимка на Particularly helpful Moodlers Снимка на Plugin developers Снимка на Testers

Joseph I like your idea,  have been thinking about how feedback could be displayed and was considering numbers to match the field with the feedback but I had been thinking that the feedback should be positioned within the text after the next logical break on the next line, e.g. find a full stop and insert a break So for example

On Monday the [cat] sat on the [mat]. On Tuesday the [cow] jumped over the [moon]

Then the feedback would read

On Monday the 1:[dog] sat on the 2:[rug].
1:The word cat rhymes with mat rather unlike dog. 2:mat is the correct answer

On Tuesday the 3:[cat] jumped over the 4:[mat]
3:Cow is the correct answer 4:moon is the unlikely correct answer

I don't see why any alternative scheme should not include the existing mouse hover as well as another way of presenting feedback.

In reply to Joseph Rézeau

Re: More OU question types in the pipeline

от Jamie Pratt -

Hi Joseph,

What I said in my post above is "It would be a fairly simple extension of the combined question type  to extend the forms for individual subquestions to expose more of the settings for the question types." and I went on to say "Just to show how advanced settings would look in the sub question form fragment, I just added an extra answer field to the form fragment to see how the 'advanced' form elements worked in Moodle 2.5".

What I meant is that I just wanted to show how it would be possible to add extra settings to the form fragments, for sub questions and we could have these 'show more'/'show less' links to show the fuller form. There are typically two levels to this kind of form, the basic settings and advanced settings. You could include all the options of the full question type in there, except we are (ab)using the General Feedback field to store the feedback for an incorrect answer.

The concept I was trying to get across is that it would be possible to keep the form simple for most users but have more powerful features for advanced users.

Jamie

In reply to Jamie Pratt

Re: More OU question types in the pipeline

от Jean-Michel Védrine -

Hello Jamie,

While working on making other types of questions combinable, it works well if I create a new subfolder in question/type/combined/combinable: but I have  a problem if I want to make the combinable question type self contained in its subfolder

I understand how to include the combinable.php file in the question subfolder, and it works perfectly, but what about the renderer ?

Of course I can include it in the question type renderer.php file but how be able to extend for instance qtype_combined_text_entry_renderer_base class and still have a question that can work even if combined is not installed ?

Surely I am missing something obvious ? Joseph has hit the same problem so it seems we both not understanding something in the combinable API.

Apart that, I find the combinable API quite flexible and quite powerfull, thanks a lot for designing a question type so easily extensible.

In reply to Jean-Michel Védrine

Re: More OU question types in the pipeline

от Jamie Pratt -

Oops. Good point Jean-Michel. I had intended to put the sub question renderer in the main renderer.php file but as you point out then we will have problems with the base classes. What I think I will do instead is to look for both combinable.php and renderer.php in a combinable directory in the question type plug in.

In reply to Jamie Pratt

Re: More OU question types in the pipeline

от Jamie Pratt -

Ah. But if we put the renderer somewhere else when we call :

$PAGE->get_renderer('qtype_'.$this->qtypename, 'embedded');

We cannot avoid including the main renderer file as well as though it is not needed. I guess that is not too much of a problem.

 

In reply to Jamie Pratt

Re: More OU question types in the pipeline

от Jean-Michel Védrine -

Yes, the non embeded question type would just use the unchanged question/type/xxxxxx/renderer.php and combined would have to include both question/type/xxxxxx/renderer.php and question/type/xxxxxx/combinable/renderer.php.

 

In reply to Jean-Michel Védrine

Re: More OU question types in the pipeline

от Jamie Pratt -

I have moved both where I look for the renderer in other question type directories and where I look for the combinable.php file which holds the necessary hooks into a directory combinable.

And also I have made 'qtype_combined_embedded_renderer_base' into an interface. Notice if you want to extend your own question types renderer rather than the base class qtype_renderer you will have to require it in combinable/renderer.php to prevent a fatal error despite the fact that the renderer factory will then require it again.

 

See changes here : https://github.com/jamiepratt/moodle-qtype_combined/commit/dab71d40268620da3c7173ab1db170ed1177a3bd