apostrophe in embedded question syntax

apostrophe in embedded question syntax

by Russell Thomson -
Number of replies: 4

Moodle 2.6.5

Is there a problem with the apostrophe in the question below. Moodle marks it wrong.

I {2:SHORTANSWER:=had better call~='d better call} my mum to tell her I've arrived safely.

Regards

Average of ratings: -
In reply to Russell Thomson

Re: apostrophe in embedded question syntax

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

Tested in Moodle 2.7, and it does work as expected.

The probable reason for your problem is that the apostrophe entered when you created that Cloze question is not a "real" apostrophe (but a single quote character). This happens when you copy-paste text from a word processor or a Web page, etc. See http://en.wikipedia.org/wiki/Apostrophe#Computing.

screenshot #2

(1) is a single quote character

(2) is a real apostrophe

Result:

screenshot #1

Try again by typing your question text directly into the question editing interface text editor, it should work. Or copy-paste the example below:

I {2:SHORTANSWER:=had better call~='d better call} my mum to tell her I've arrived safely.

Joseph

 

Average of ratings: Useful (3)
In reply to Joseph Rézeau

Re: apostrophe in embedded question syntax

by Russell Thomson -

Thank you for such a wonderfully complete reply. It worked.

Regards

Russell



In reply to Joseph Rézeau

Re: apostrophe in embedded question syntax

by François Lizotte -
Picture of Particularly helpful Moodlers

Joseph,

Your answer is very clear. But let's say we have hundred of shortanswer containing an apostrophe, is there a trick that would solve the issue quickly? Running a script in the database to automatically add alternative answers sounds scary to me, but nothing is impossible.

By the was, is this a real apostrophe: ' ?





In reply to François Lizotte

Re: apostrophe in embedded question syntax

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

"let's say we have hundred of shortanswer containing an apostrophe, ..."

Well, if those are real apostrophe characters there is no problem. If they are not real apostrophes, I suggest exporting them (as Moodle XML), use a text editor to do the replacements and re-importing.

Joseph

Average of ratings: Useful (1)