Quiz Type - Changing how the answers are shown

Quiz Type - Changing how the answers are shown

by Cory Gordon -
Number of replies: 9
Hi people

Using Moodle 1.9.7 here!

I'm using the quiz module 'drag & drop match' (found here), and currently the marking of a student's work is only shown when the ANSWERS button has been selected in the REVIEW OPTIONS. The answers themselves aren't given when this selection has been made. When the ANSWERS tab is unselected, no feedback is given to the students for their answers.

This doesn't suit me however, as when this question type is used along other question types i.e. MULTICHOICE - because of the ANSWERS being selected - it gives the answers to all the other question types within that quiz.

What I would like to know is, how/where can I hack the 'drag & drop match' code so that it shows results when the ANSWERS button isn't selected? It's got to be the way this module has been set up - and yes I know that this question should be asked in the specific module forum (which I will as well), but there has to be some generalised solution to this? As in the solution should be the same independant of actual question type?

Anyone have any idea how I can go about making these changes? Or even where to start looking? I've had a look around but I'm having trouble getting my head around how all the many files are linking together and where I need to be looking.

ANY feedback on this would be greatly appreciated.

thanks
Cory
Average of ratings: -
In reply to Cory Gordon

Re: Quiz Type - Changing how the answers are shown

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Sorry, I don't understand what you are asking. Could you make a screen-shot. I think that would make it clearer. Thanks.
In reply to Tim Hunt

Re: Quiz Type - Changing how the answers are shown

by Cory Gordon -
Of course - no worries.

I have a question type 'drag and drop match':

Screenshot 1:
question_1.gif


I'm trying to get it so that when a student hits the "submit all and finish" button, their responses are marked, but the answers aren't given.
With all the other questions types I can do this with the following settings:

Screenshot 2
question_2.gif

However when I run with these settings on 'drag and drop match' the students gets absolutely no feedback. It looks like screenshot 1.

To get what I want from 'drag and drop' I need to change the settings to include answers:

Screenshot 3:
question_3.gifquestion_3.gifquestion_4.gifquestion_4.gif
which gives me this in 'drag and drop':

Screenshot 4:
question_5.gif

But then I also get the answers to all the other question types, irrespective of if the student has answered them or not:

Screenshot 5:
question_6.gif


The only way at present to get what I want, is to seperate drag and drop question types from quizzes containing the other question types - which really doesn't suit.

As I would like this to be a permanent solution, I'd like to know where in the code of 'drag and drop match' would I need to change so that it marks a students work when FEEDBACK is selected - as is the case with all the other question types.

I've had a look around, but can't quite see how all the different files are linked together.

If anyone could help - even if it's a "you may want to look here" ...

thanks alot
Cory












Attachment question_1.gif
In reply to Cory Gordon

Re: Quiz Type - Changing how the answers are shown

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Cory,
What about using the Hot Potatoes JMatch type of question? It would do exactly what you want. See the Hot Potatoes forum for more info.
Joseph
In reply to Joseph Rézeau

Re: Quiz Type - Changing how the answers are shown

by Cory Gordon -
Really - that would make things easier for me.

Thanks Joseph, I'll have a look at it.
In reply to Cory Gordon

Re: Quiz Type - Changing how the answers are shown

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Looks to me like we do indeed have a bug with the drag-and-drop question type. I don't have any time to investigate right now, I am afraid.

The bug is almost certainly in rint_question_formulation_and_controls in http://cvs.moodle.org/contrib/plugins/question/type/ddmatch/questiontype.php?view=markup

(That includes http://cvs.moodle.org/contrib/plugins/question/type/ddmatch/display.html?view=markup, but I don't think the bug is there.)

Try comparing some of the if conditions in there, like

if ($options->readonly and $options->correct_responses) {

with similar tests in other question types.

Sorry I can't be more helpful.
In reply to Tim Hunt

Re: Quiz Type - Changing how the answers are shown

by Cory Gordon -
No - that's more than helpful Tim.

Atleast now I have somewhere to start looking.

thanks
In reply to Cory Gordon

Re: Quiz Type - Changing how the answers are shown

by Cory Gordon -
Looks like I've sorted it, on Line 364 it currently reads:

if ($options->readonly and $options->correct_responses)

if you change that to:

if ($options->feedback || $options->correct_responses)

Works a treat now.

Thanks for your help Tim

In reply to Cory Gordon

Re: Quiz Type - Changing how the answers are shown

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That looks like it might work. At least, it make this code more like the multichoice type.

However, I have a concern that it would not work in adaptive mode. I think it will give the answer away the first time the student put in an answer.

I think

if (($options->feedback && $options->readonly) || $options->correct_responses)

would be better.

Interestingly the core matching question type is exactly like the way the ddmatch code currently reads. I wonder why no-one has complained about that before.

I am not quite confident enough yet to commit this change to core Moodle. I created MDL-21530 to track this.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Quiz Type - Changing how the answers are shown

by Mat Cannings -

Hi Tim,

I think with this questiontype the way that Cory posted is probably the correct method for adaptive mode feedback.

It will tell you the ones you got correct but it will not give away the correct answer for the wrong choices in most circumstances.

For example if you have 6 options and 6 choices then if you got 1 correct then you are given no clues as to the correct answer for the others, just that it would not be the one just tried (or the correct answer for 1:1 matching).

The exception would be if you had multiple statements and only two match options  e.g. true or false. Here an incorrect response would indicate that the other option was correct. (This could possibly be a question type of it's own multipleTF?) Although any feedback whatsoever would giveaway the correct answer here.

I think for most circumstances where adaptive mode was chosen for the quiz the questions would be of the first example with multiple matching options.