Possible display issues in Quiz Results Statistics page

Possible display issues in Quiz Results Statistics page

by Rajneel Totaram -
Number of replies: 1
Picture of Core developers Picture of Plugin developers

Today we got an interesting query from a lecturer who said that the Short Answer wildcard options did not work properly when marking student responses. He pointed out to a quiz in his course that did not seem to correctly mark the student attempts correctly for a particular short answer question. We spent a lot of time trying to find out why things did not work properly and this is what we found:

(We use Moodle v2.7.3 at the moment.)

Say there is a C++ programming short answer question as such:

Correct the line marked in red.

int main()
{
cout >> "Hello!" >> endl;

system("PAUSE");
return 0;
}


And lets say that the answer set defined for this short answer question is:

Answer Mark
cout << "Hello!" << endl; 100%
cout<<"Hello!"<<endl; 100%
cout*<<*"Hello*"*<<*endl;
50%
*end1*
0

When viewing the Statistics page for this question, you get something like this:
Screenshot

Notice how cout<<"Hello!"<<endl; isn't displayed correctly. Instead <endl; is treated as a HTML tag.

Perhaps, htmlentities() needs to be called before displaying the response data. I see that in /mod/quiz/report/statistics/staticstics_question_table.php, raw values are used.

Average of ratings: -
In reply to Rajneel Totaram

Re: Possible display issues in Quiz Results Statistics page

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes, it is a bug. I just filed it as MDL-49364 and did a fix.