Issue Details (XML | Word | Printable)

Key: MDL-15315
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Tim Hunt
Reporter: Céline Bissler
Votes: 0
Watchers: 2
Operations

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

Error in Item analysis report for short aswers

Created: 19/Jun/08 05:27 PM   Updated: 12/Dec/08 12:48 PM
Return to search
Component/s: Quiz
Affects Version/s: 1.8.4
Fix Version/s: 1.8.8, 1.9.4

File Attachments: 1. Text File patch18.txt (1 kB)
2. Text File patch19.txt (1 kB)

Image Attachments:

1. En-2008-06-19_090348.png
(22 kB)

2. exemple.png
(24 kB)
Environment:
OS : LINUX RedHat
Moodle Version : 1.8.4

Database: MySQL
Participants: Céline Bissler, Jerome Mouneyrac, Joseph Rézeau and Tim Hunt
Security Level: None
Resolved date: 12/Dec/08
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
The "short answer" does not display correctly in Item analysis report. The answers wich are verified with wilcard appears as false as you can see on En-2008-06-19_090348.png screenshot.
On the other hand, it works for user reports on the Overview.

It doesn't compare correctly strings with wildcards as we can see on the second screenshot (exemple.png) :
- For the answer "celine" it's correct. 1 user as answer "celine".
- But for the answer "c*line", the user who has answered "caline" must be count or it appears as false. (same problem for the answer "*line" for "aline")
 
The problem still in Moodle 1.9.1 on windows/Mysql

I've fix the problem : /var/www/moodle184test/question/type/shortanswer/questiontype.php.
I've replace the compare_responses function by :
function compare_responses($question, $state, $teststate) {
if (isset($state->responses['']) && isset($teststate->responses[''])) {
return $this->compare_string_with_wildcard(stripslashes_safe($state->responses['']),
$teststate->responses[''], !$question->options->usecase);
}
return false;
}


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Joseph Rézeau added a comment - 20/Jun/08 05:35 PM
Simple fix (provided by Céline Bissler) and tested in 1.8 and 1.9. See attached patch files for Moodle 1.8 and 1.9.
Should probably go to HEAD as well.

However, with this patch, the students' actual responses are not displayed at all, which is a loss of information. Ideally I would like a report which would display a) the Answer's text with correct R. count and b) the students' actual responses with their own R.count too.

Joseph


Joseph Rézeau added a comment - 20/Jun/08 05:35 PM
patch file for moodle 1.8.4

Joseph Rézeau added a comment - 20/Jun/08 05:37 PM
patch file for Moodle 1.9.1

Tim Hunt added a comment - 20/Jun/08 06:42 PM
I suggest we apply this patch to Moodle 1.8 and 1.9 branches to fix the bug.

Then, Jamie is doing some work for Moodle 2.0 (specification here http://docs.moodle.org/en/Development:Quiz_report_enhancements#Individual_Item_Analysis_report) that should mean that the report eventually works exactly the way you want it to.

Does this seem like the right approach? please comment.


Joseph Rézeau added a comment - 20/Jun/08 09:05 PM
Tim,
The approach you suggest is fine with me.
Joseph

Tim Hunt added a comment - 21/Jun/08 01:24 AM
So, I applied this fix to 1.8 and 1.9. I have not done anything in HEAD, I am assuming Jamie will change things as necessary as he works on the report code there.

Jerome Mouneyrac added a comment - 24/Jun/08 01:42 PM
tested on 1.9. Fixed. Thanks for reporting and thanks for fixing it.

Jerome Mouneyrac added a comment - 24/Jun/08 02:06 PM
Oups, I tested on 1.8 as well, and it doesn't work. The Item analysis page doesn't display anything.
I created a new course, with a quizz with only one short answer question. Answers are celine, c*line, and *line
In this course I have only one student which realise four attempts (celine,caline,aline,cabine)
The admin go on Quizz/Results/Item Analysis => empty page

Tim Hunt added a comment - 25/Jun/08 12:15 AM
If you turn on debugging, the blank page becomes

Fatal error: Call to undefined function question_has_capability_on() in /var/www/html/tjh238/1.8/mod/quiz/report/analysis/report.php on line 319

Which is a stupid merge error by me. Am fixing.


Tim Hunt added a comment - 25/Jun/08 12:17 AM
The regression was actually related to MDL-15332

Tim Hunt added a comment - 25/Jun/08 12:24 AM
Regression fixed. Sorry about that.

Jerome Mouneyrac added a comment - 25/Jun/08 09:33 AM
Thanks for the information Tim. I forgot to change back my debugging settings.

Jerome Mouneyrac added a comment - 01/Jul/08 04:06 PM
bug fix, perfect Thanks for the report and participations.

Tim Hunt added a comment - 12/Dec/08 11:38 AM
Grrr! This fix was wrong. While it fixed the item analysis issue, it caused MDL-17247 and MDL-17610. Am working in a proper fix.