Moodle

Error in Item analysis report for short aswers

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.4
  • Fix Version/s: 1.8.8, 1.9.4
  • Component/s: Quiz
  • Labels:
    None
  • Environment:
    OS : LINUX RedHat
    Moodle Version : 1.8.4
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

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;
}

  1. patch18.txt
    20/Jun/08 5:35 PM
    1 kB
    Joseph Rézeau
  2. patch19.txt
    20/Jun/08 5:37 PM
    1 kB
    Joseph Rézeau
  1. En-2008-06-19_090348.png
    22 kB
    19/Jun/08 5:27 PM
  2. exemple.png
    24 kB
    19/Jun/08 5:27 PM

Activity

Hide
Joseph Rézeau added a comment -

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

Show
Joseph Rézeau added a comment - 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
Hide
Joseph Rézeau added a comment -

patch file for moodle 1.8.4

Show
Joseph Rézeau added a comment - patch file for moodle 1.8.4
Hide
Joseph Rézeau added a comment -

patch file for Moodle 1.9.1

Show
Joseph Rézeau added a comment - patch file for Moodle 1.9.1
Hide
Tim Hunt added a comment -

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.

Show
Tim Hunt added a comment - 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.
Hide
Joseph Rézeau added a comment -

Tim,
The approach you suggest is fine with me.
Joseph

Show
Joseph Rézeau added a comment - Tim, The approach you suggest is fine with me. Joseph
Hide
Tim Hunt added a comment -

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.

Show
Tim Hunt added a comment - 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.
Hide
Jerome Mouneyrac added a comment -

tested on 1.9. Fixed. Thanks for reporting and thanks for fixing it.

Show
Jerome Mouneyrac added a comment - tested on 1.9. Fixed. Thanks for reporting and thanks for fixing it.
Hide
Jerome Mouneyrac added a comment -

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

Show
Jerome Mouneyrac added a comment - 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
Hide
Tim Hunt added a comment -

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.

Show
Tim Hunt added a comment - 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.
Hide
Tim Hunt added a comment -

The regression was actually related to MDL-15332

Show
Tim Hunt added a comment - The regression was actually related to MDL-15332
Hide
Tim Hunt added a comment -

Regression fixed. Sorry about that.

Show
Tim Hunt added a comment - Regression fixed. Sorry about that.
Hide
Jerome Mouneyrac added a comment -

Thanks for the information Tim. I forgot to change back my debugging settings.

Show
Jerome Mouneyrac added a comment - Thanks for the information Tim. I forgot to change back my debugging settings.
Hide
Jerome Mouneyrac added a comment -

bug fix, perfect Thanks for the report and participations.

Show
Jerome Mouneyrac added a comment - bug fix, perfect Thanks for the report and participations.
Hide
Tim Hunt added a comment -

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.

Show
Tim Hunt added a comment - 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.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: