Can Moodle Include Matrix Answer Options in Cloze Question Type?

Can Moodle Include Matrix Answer Options in Cloze Question Type?

Dorbor Jallah發表於
Number of replies: 3

Hi Everyone,

I am a user of Moodle and want to include matrices as options in the MCV cloze question type but keep having difficulty. Here is the syntax I have used which is not working:

{1:MCV:=<span class=$$\left[\begin{array}{cc} 1 & -1\\ 2 & 3\end{array}\right]$$~$$\left[\begin{array}{cc} 1 & 6\\ 2 & 2\end{array}\right]$$~$$\left[\begin{array}{cc} 6 & -1\\ 2 & 3\end{array}\right]$$~$$\left[\begin{array}{cc} 6 & 2\\ 2 & 3\end{array}\right]$$}" width="611" height="85" />

I am using Moodle 1.9.7+ (Build 20091230).

Can someone plese help me out?

Dorbor

評比平均分數: -
In reply to Dorbor Jallah

Re: Can Moodle Include Matrix Answer Options in Cloze Question Type?

Jeff Forssell發表於

The Cloze question type sometimes requires certain characters to be escaped and the TeX expression has a lot of characters that might fall into the category.  So it might be difficult to get them to work together. The docs say:

If the correct answer contains { } # ~ / " or \ you will have to escape them by putting a \ in front of each such character. In the feedback ~ and } must be escaped otherwise it will be interpreted as the next answer or end of the short answer section respectively. Quotation signs: " can lead to trouble anyhow in both places. Use the HTML entity: & quot; (without the space between & and quot;). If you want to have Mathematical symbols there can be problems with the \ used in TeX expressions. One alternative can be to use unicode characters.

There is of course the option to mark your matrixes (matricii?) with a) b) c) d) and have the cloze expresssion just have the choices  a b c d.

Is there no way for you to use the ordinary multiple choice questions?

If you show the complete question it can be easier to find a solution.

In reply to Jeff Forssell

Re: Can Moodle Include Matrix Answer Options in Cloze Question Type?

Adriane Boyd發表於

The cloze question parser seems to handle { and } a little strangely.  I think it looks for a matching } to end the question, but doesn't care about { in between, since you can't nest questions.  To get a similar question to work, I only had to escape }, but not {.  If I escaped {, I ended up with large latex curly braces and bunch of gibberish.  I did try this out with the most recent 1.9.9, so it's possible older versions handle this differently.

A demo question that works for me:

(I tried to include it as text, but the editor tries to interpret the latex and weird things happen.  I'm not sure how to get around that.)

評比平均分數:Useful (1)
In reply to Adriane Boyd

Re: Can Moodle Include Matrix Answer Options in Cloze Question Type?

Jeff Forssell發表於

Nice work!

I tried putting that into a 1.9.5 Moodle and it worked there too (Once I had checked where I had misscopied some geekiness 眨眼 )

I'm trying to display (here) the TeX by writing 3 $s instead of 2 $s:

{1:MCV:=$$$\left[\begin{array\}{cc\} 1 & 3 \\ 2 & -2 \\ \end{array\}\right]$$$~$$$\left[\begin{array\}{cc\} 1 & 3 \\ 2 & -3 \\ \end{array\}\right]$$$}

and that seemed to work.

Once you have a good expression for the first matrix you just have to change the  1 & 3 \\ 2 & -2 parts.

I have now changed the docs to:

If the correct answer contains } # ~ / " or \ you will have to escape them by putting a \ in front of each such character. The { shouldn't be escaped, this can be vital in getting TeX expressions to work.