Issue Details (XML | Word | Printable)

Key: MDL-14643
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Tim Hunt
Reporter: Jeff Sherk
Votes: 2
Watchers: 7
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Choosing 'Review Options: Feedback' displays feedback for ALL answers instead of only feedback for answers that student picked

Created: 01/May/08 11:45 PM   Updated: 19/Aug/08 11:41 AM
Component/s: Quiz
Affects Version/s: 1.9
Fix Version/s: 1.9.3

Issue Links:
Blockers
 
Duplicate
 

Participants: David Mudrak, Jeff Sherk, Mathieu Petit-Clair, Pierre Pichet, Ray Lawrence, Tim Hunt and Tom Trueluk
Security Level: None
QA Assignee: Mathieu Petit-Clair
Resolved date: 19/Aug/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
Choosing 'Review Options: Feedback' displays feedback for ALL answers instead of only feedback for answers that student picked.

I just upgraded from Moodle 1.6 to 1.7 to 1.8 to 1.9, and everything seems to be working fine, except I noticed the following issue:

With a quiz created in the Quiz Module (using True/False, Multiple-Choice Single Answer, and Multiple-Choice Multiple Answer), in Moodle 1.6 when I set the Review Options to show FEEDBACK (and to NOT show Answers), it would only show the feedback for the particular answers that the student picked and would not show feedback for the other answers that the student did not pick. But now, in 1.9, this option will display the feedback for ALL the answers regardless of which ones the student has actually choosen.

This is a severe problem, because the individual feedback for each answer tells our students which answers are the correct ones, which I obviously don't want to do. If this is a bug, then it is severe and needs to fixed ASAP.

If the functionality has been purposefully changed since 1.6, then this feedback option needs to have two option choices added:
Option 1: Show only feedback for answers that the student has choosen.
Option 2: Show feedback for ALL answers.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Pierre Pichet added a comment - 02/May/08 01:02 AM
Perhaps I don't understand well your explanations but I cannot reproduce the problem on the latest 19_STABLE version CVS in the last ten minutes.
Try on http://132.208.141.198/moodle_19/
user: moodle pw: moodle
quiz: test calc, num,short
and give your comments.
You can create quiz or questions

Jeff Sherk added a comment - 02/May/08 02:30 AM
Okay, I created a new quiz called Jeff's Test Quiz.

-----------------------------------------

HOW TO REPRODUCE BUG:

Login with the user: moodle pw: moodle

From My Courses click Testing 1.9 STABLE and go to Topic Outline page.

Switch role to: Etudiant/Student

Click on Jeff's Test Quiz.

Click on Attempt #1 to review the answers.

Notice for Question #1 (the multiple choice question) that it displays the feeback for ALL three answers, instead of showing just the feedback for the answer that the student picked.

Now click on Return To My Normal Role.

Click on Jeff's Test Quiz again and then click on the EDIT tab.

For the Question #1, click on the magnifying glass (Preview question).

A new window will open with the question in it. Select any answer and click on SUBMIT PAGE.

Notice that it will ONLY display feedback for the selected answer and not for the other answers. This is how it should function, but it does not work that way as seen above.

---------------------------

Let me know if you need more explanation.
Thanks


Pierre Pichet added a comment - 02/May/08 03:52 AM
I think it is more on the way the different options interact.
I you set in the quiz editing page to adaptive mode, you will have the possibility for the student to submit each question independently and the only feedback will be for the answer checked.
This is what you want.

If adaptive is off, Moodle understand that the result is final and then all the possible responses and there feedback are shown if you allow them.
I have set adaptive on for Jeff's Test Quiz and look at the results.


Jeff Sherk added a comment - 02/May/08 04:59 AM
No, I definitely do NOT want adaptive mode on. It should be off!

But I see what you are saying... from the Preview Question page if I hit Submit Page (adaptive mode) it only displays feedback for the one answer, but if you hit Submit All And Finish it displays all the feedbacks.

Here is the problem... in Moodle 1.6 Submit All And Finish displayed feedbacks the same way Submit Page does... it did not show you all the feedbacks. But now in 1.9, it has changed the way it does this. This is a HUGE problem because our students are allowed unlimited attempts on the exam, so we NEVER want them to see the correct answers unless they actually get it right. The feedback for each individual answer contains the words 'correct' or 'incorrect', so this option now gives away the answers to the students.

Because this functionality has changed from 1.6 to 1.9 I would consider it a bug. Unless of course it was purposefully changed. If it was not purposefully changed then it is a bug.

MY OPINION:
In my opinion,
with Adaptive Mode: Off
and Review Options: Answers is selected
then Review Options: Feedback should display all the feedback for all the answers as it does now.

But
with Adaptive Mode: Off
and if Review Options: Answers is NOT selected
then Review Options: Feedback should NOT display all the feedback ... it should only display the feedback for the selected answers (as it would with adpative mode on).

FURTHER EXPLANATION:
The reason why we need to put 'correct' or 'incorrect' in the answer feedback field is because of Multiple-Choice quesiton types with MULTIPLE answers. I've added another test quiz called Jeff's Other Test Quiz to demonstrate the problem.

Set Review Options: Feedback to selected and then go review the attempt. You will notice it gives away the correct answers.

Now set Review Options: Feedback to UNselected and then go review the attempt. There is now NO WAY to tell the student which answers were correct and which ones were incorrect. They simply get a score of zero, but have no idea which answers were right and which ones were wrong. Even the nice little red-x and green-checkmark are gone.


Pierre Pichet added a comment - 02/May/08 08:23 AM
I have to trace back where the change happened.
If it was set as Moodle standard, I could find a patch that you could apply locally.
If not, this is a bug.

However I don't understand that you allow your students unlimited attempts on the exam without any penalty...
So they can test any response until they find the good ones.
Take note what is the good response for each question then submit a final version with all the good responses and have a 100% grade.
And you call this an exam...

The adaptative was built to get progressive knowledge building more as an exercice than as an exam...


Jeff Sherk added a comment - 02/May/08 11:09 PM
Thanks for looking into it Pierre...

Quick Explanation:
We allow the students unlimited attempts, so they can (if they choose) eventually achieve 100%, but they only need 85% to move on to the next quiz. The problem with adaptive mode is that it lets them submit their answers and then they can easily just change them and keep submitting them right away until they have all correct answers, without actually having to search for the correct answer. Our quizzes are all Bible related, and we want people to actually search out the answers, not just guess until they get it right. Each quiz has over 150 questions and we shuffle both the questions and the answers for each attempt... this way, if somebody actually does want to redo the quiz and try to attain 100%, it becomes a very time consuming process, and they had better make sure they double check the answers they had incorrect before they put all their time into redoing the quiz.
Hope that explains it!


Pierre Pichet added a comment - 03/May/08 12:47 AM
If I understand well, you allow them unlimited attempts but "we shuffle both the questions and the answers for each attempt..."
So "it becomes a very time consuming process".
In practice they rarely do the quiz 2 times .If they do it twice with the actual setting, they will have all the responses after the first attempt.

They can access to the next quiz if they have a 85%score.
So the teacher has to check their grade before allowing the second quiz.
You set a 30 minutes delay before reattempting the quiz.

"and we want people to actually search out the answers" and "but they only need 85% to move on to the next quiz."
This seems a case where feedback and which responses are bad are not necessary.
So
Perhaps you can manage something if you set only the responses diplayed. (no answers and no feedback).
On submitting the quiz, the students will know their grade and their responses.

As I see your problem, it is more an improvment than a bug...

As an improvment unless other peoples ask it , it won't be fix .

I am waiting for other comments before closing it.


Jeff Sherk added a comment - 03/May/08 01:39 AM
The problem with displaying NO answers and NO feedback, is that the student does not know which of their answer choices were correct and which ones are incorrect (on a Multiple Choice Multiple Answer type question), which was why (on Moodle 1.6) we added the feedback for each answer to display whether it was correct on incorrect.

Since this won't be resolved (as I need it), then I will need to hack the code and 'fix' it for myself.

Can you point me to which file or files I need to hack in order to make this change.

Thanks


Pierre Pichet added a comment - 03/May/08 03:30 AM
Your problem is mostly with multichoice response.
In this case all is done in question/type/multichoice/questiontype.php in the
function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
the main control is the options parameter and the one that display everything is the $options->correct_responses

// Print the control
$a->control = "<input $readonly id=\"$a->id\" $name $checked $type value=\"$aid\" />";

if ($options->correct_responses && $answer->fraction > 0) { $a->class = question_get_feedback_class(1); }
if (($options->feedback && $chosen) || $options->correct_responses) {
if ($type == ' type="checkbox" ') { $a->feedbackimg = question_get_feedback_image($answer->fraction > 0 ? 1 : 0, $chosen && $options->feedback); } else { $a->feedbackimg = question_get_feedback_image($answer->fraction, $chosen && $options->feedback); }
}

// Print the answer text
$a->text = $this->number_in_style($key, $question->options->answernumbering) .
format_text($answer->answer, FORMAT_MOODLE, $formatoptions, $cmoptions->course);

// Print feedback if feedback is on
if (($options->feedback || $options->correct_responses) && ($checked || $options->readonly)) { $a->feedback = format_text($answer->feedback, true, $formatoptions, $cmoptions->course); } else { $a->feedback = ''; }

To understand how everything is working I added in http://132.208.141.198/moodle_19/ at the beginning of the function the following lines to display of $cmoptions and options.

echo "<pre>cmoptions ";print_r($cmoptions);echo "</pre>";
echo "<pre>options ";print_r($options);echo "</pre>";

the options are "prepared" in /**
679 * Determine review options
680 *
681 * @param object $quiz the quiz instance.
682 * @param object $attempt the attempt in question.
683 * @param $context the roles and permissions context,
684 * normally the context for the quiz module instance.
685 *
686 * @return object an object with boolean fields responses, scores, feedback,
687 * correct_responses, solutions and general feedback
688 */
689 function quiz_get_reviewoptions
(in mod/quiz/localib.php).
To understand the code flow use
http://xref.moodle.org/nav.html?index.html

I will keep it open and wait to see how you solve your problem.


Jeff Sherk added a comment - 03/May/08 05:05 AM
Okay, here's a mod that does what I want... only needed one simple IF statement!

For Moodle version: 1.9
Modified file: question/type/multichoice/questiontype.php
Version of questiontype.php file: 1.29.2.3 2008-01-08 18:29:17 tjhunt

Here is the chunk of code including the mod... the modification is well marked:

--[START CODE]-------------------------------------------------------

// Print feedback if feedback is on
if (($options->feedback || $options->correct_responses) && ($checked || $options->readonly)) {
$a->feedback = format_text($answer->feedback, true, $formatoptions, $cmoptions->course);
} else {
$a->feedback = '';
}
////////////////////////////////////////////////////////////////////
// Begin MOD - by Jeff Sherk - May 2, 2008
// When Review Options: Feedback is selected, it will normally
// display ALL the feedbacks for each individual answer whether
// the student selected that answer or not.
// This mod will cause it to only display feedbacks for the
// answers that the student had picked, and will not display
// individual answer feedback for answers that the student did
// not pick.
//
// Moodle version: 1.9
// Modified file: question/type/multichoice/questiontype.php
// Version of questiontype.php file: 1.29.2.3 2008-01-08 18:29:17 tjhunt
////////////////////////////////////////////////////////////////////

// If there is feedback to display, but the box is not checked, then don't display it
if (($a->feedback != '') && ($checked == '')) { $a->feedback = ''; }

////////////////////////////////////////////////////////////////////
//End MOD
////////////////////////////////////////////////////////////////////
$anss[] = clone($a);

--[END CODE]-------------------------------------------------------


Pierre Pichet added a comment - 07/May/08 03:30 AM

This could solve your special problem but ...

Jeff Sherk added a comment - 07/May/08 03:59 AM
As a future feature, it could probably look something like this...

When editing a quiz, there will be a new option right underneath the Feedback option box, called something like 'Display Only For Selected Answers.
[ ] FEEDBACK
[ ] Display Only For Selected Answers

When Feedback is NOT checked, then this selection is greyed out.

When Feedback is selected, this new option becomes available.

It would be assigned a variable, somthing like $a->FeedbackOnlySelected

When this new option is NOT checked, then everything operates as it did before ($a->FeedbackOnlySelected = false)

When this new option is selected, then it does the mod above ($a->FeedbackOnlySelected = true)

The code above would simply be modified as follows:

// FEEDBACK -> Display Only For Selected Answers - If there is feedback to display, but the box is not checked, then don't display it.
if (($a->feedback != '') && ($checked == '') && ($a->FeedbackOnlySelected == true)) { $a->feedback = ''; }


Jeff Sherk added a comment - 07/May/08 05:32 AM
And one further note...

I suppose this would apply to all question types. In the above example, the mod only affects Quiz Muliple Choice questions. But it could also apply to True/False, as an example, as well.

In the True/False case, if the new option was selected, then it would only display the little image (X or Tick) beside the correct answer, and no image beside the incorrect answer.

Not sure how it would apply to other question types because I don't use any other type of question.


Tom Trueluk added a comment - 12/Jun/08 05:02 AM
This is definitely a problem in my opinion. And, as far as I can tell, there is no way around it through the user interface. Here's a summary of what I've discovered as far as Multiple Choice questions go:

In type/multichoice/questiontype.php in the "print_question_formulation_and_controls" function it fills each answer object ($a) with the feedback if certain conditions are met as seen below. The problem comes with the second group in the conditional statement: ($checked || $options->readonly). $checked is True if the current answer is selected by the user, and empty otherwise. This is what we want.
But $options->readonly is set to True always thus displaying answer feedback for all answer choices. I traced this back to \mod\quiz\locallib.php in the function "quiz_get_reviewoptions" where the $options object is first created. And in this function the object is delcared with readonly set to true.

\mod\quiz\locallib.php: line 690

$options = new stdClass;
$options->readonly = true;

******Each answer choice object is filled with feedback under following conditions ********
\question\type\multichoice\questiontype.php: line 324

// Print feedback if feedback is on
if (($options->feedback || $options->correct_responses) && ($checked || $options->readonly)) { $a->feedback = format_text($answer->feedback, true, $formatoptions, $cmoptions->course); } else { $a->feedback = ''; }

I'm not sure what the $options->readonly boolean is used for at the moment, but obviously the user has no control over it. Removing $options->readonly from the above conditional fixes the problem, ( if (($options->feedback || $options->correct_responses) && $checked) { )


Pierre Pichet added a comment - 12/Jun/08 08:13 AM
Thanks for your analysis.
I will try to construct a complete thruth table of all these quiz options and put them on the docs before making any changes.
However, if you want to build it, go.
start from http://docs.moodle.org/en/Development:Quiz#The_options_object

Pierre Pichet added a comment - 12/Jun/08 08:17 AM
In general use, we want to show to the student all good and bad responses when the quiz is finished.
Your use of the quiz is also a valid one but perhaps it requires a new option (or combined options) in the quiz settings.

Pierre Pichet added a comment - 12/Jun/08 08:51 AM
Tim,
I will appreciate your comments on this. What should be the general case : correct_responses on all question or only questions answered ?
Should we add a new option setting on quiz editing page?

Pierre Pichet added a comment - 12/Jun/08 09:07 AM
Sorry, I wrote correct_responses instead of feedback although this could be also the same logic for correct responses...

David Mudrak added a comment - 13/Jun/08 07:41 AM
I have just discovered this and I agree with Jeff that this is a serious bug. Moodle ALWAYS displayed feedbacks just for the option the user selected. This is the behaviour documented in the wiki - see http://docs.moodle.org/en/Multiple_Choice_question_type:

"...So, when the student submits the question, they will see the answer-specific feedback next to the option(s) they selected, the overall feedback in a box below the options, and if applicable, the general feedback underneath everything else..."

I believe a lot of educators has relied on this Moodle behaviour and put (as recommended by docs and other resources) feedbacks starting with "Yes, this is correct answer!" or "No, this is not correct answer". Therefore, we must fix this ASAP - this bug makes a lot of quizes all around useless. I propose to change the type of the issue from Improvement to Bug and increase the priority from Minor to Major.

The option might be fine, but default behaviour should be the traditional one:
"Show feedback" settings means "Show feedback next to the option(s) THEY SELECTED"


Pierre Pichet added a comment - 13/Jun/08 07:53 AM
I will look at the different moodle version to see where the change happens

Pierre Pichet added a comment - 13/Jun/08 08:09 AM
You'rb rigth. There is a problem in 1.9, the feedback is shown for every answers. For precedent versions(1.8,1.7,1.6), there was only the item check that get the feedback.
However when the correct response is shown, the feedback for the correct response is not shown unless you check the good response.
I will look to see where are the diffs between the versions.

Pierre Pichet added a comment - 13/Jun/08 09:17 AM
This was set by Tim with the comment

Tim Hunt - 16/Aug/07 12:24 AM You are right Joseph. I was thinking about what the situation would be after the adaptive-mode changes we are working on here. I have only changed this in head, because it does affect how questions work in a way that teachers might not want to change unexpectedly on a supposedly stable branch. However it is a tiny patch if anyone wants to add it to an earlier version after due consideration.
But as time goes by, head becames 1.9...
So Tim?


Tim Hunt added a comment - 18/Jun/08 02:28 AM
It was changed in 1.9 for what we thought were good reasons. However, you have identified a significant flaw with the changes. Blegh! what to do now? ...

David Mudrak added a comment - 18/Jun/08 02:48 AM
All my +1's for reverting the change. The fine scenario might be to have an per-question option whether to show all or just the one feedback. Of course, the default value should be the old fashion one. The problem is that such an option would require DB changes which we should not do on MOODLE_19_STABLE. So, let us come back to the previous behaviour and implement this as an optional feature for 2.0 (or any other future release if we know how to handle DB structure changes on stable branches.

Pierre Pichet added a comment - 18/Jun/08 02:50 AM
As some teachers want all the responses and others not, they should be able to do so when editing the quiz.
So adding a new option could ( or should) be the solution

Ray Lawrence added a comment - 13/Aug/08 10:47 PM
+1 for reverting (asap!)

This is such a significant change that impacts on many existing sites. If it's to be retained it needs an option of it's own.


Tim Hunt added a comment - 19/Aug/08 10:38 AM
OK, change reverted.

If people think it is really a good idea to put in an option for display of feedback for all answer on the multichoice editing form, please open a new bug to cover that.


Mathieu Petit-Clair added a comment - 19/Aug/08 11:41 AM
Reviewed & closed. If a new request is created for an option to control this behavior, it should probably be linked with both this issue and MDL-10841.