Question page not recognizing answers with apostrophe

Question page not recognizing answers with apostrophe

by Shawn Hodgson -
Number of replies: 1

Hello,

I have a few questions after my lesson content that have short form answers.

Example:

Julie _____ (not / drink) tea very often.

answers are either doesn't drink, or does not drink. For some reason it won't take doesn't drink for an answer. When I change doesn't drink to doesnt drink it will accept it. I have this problem with other short form questions as well. Any ideas how I can fix that? I'm using Moodle version 2.0.1+ (Build: 20110105).

Regards,

Shawn

 

Average of ratings: -
In reply to Shawn Hodgson

Re: Question page not recognizing answers with apostrophe

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Shawn,

Thanks for reporting this bug, of which I was already aware. I have posted a bug report (MDL-26281) for which you can vote and where you will find an easy fix.

Joseph

Fix (for moodle 2.0)

in file lesson/pagetypes/shortanswer.php
around line 80
replace:

foreach ($answers as $answer) {
$i++;
$expectedanswer = $answer->answer; // for easier handling of $answer->answer

with

foreach ($answers as $answer) {
$i++;
$expectedanswer = s($answer->answer); // for easier handling of $answer->answer