Extra backslashes when exporting Tex

Extra backslashes when exporting Tex

od Art M -
Število odgovorov: 3

Hi all,

I'm creating the following numerical question in Tex in Moodle 1.9 (without space between $$):

Simplify $ $\frac{4}{4}$ $.

After exporting as a gift format, this is what I get in the file:

Simplify $ $\frac\{4\}\{4\}$ $.

Can anyone explain why the extra backslashes? When imported back, it reads fine. Thanks.

Povprečje ocenitev: -
V odgovor na Art M

Re: Extra backslashes when exporting Tex

od Tim Hunt -
Slika Core developers Slika Documentation writers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers

Yes. { and } are special characters in the GIFT syntax, so they need to be escaped.

V odgovor na Tim Hunt

Re: Extra backslashes when exporting Tex

od Art M -

Thanks for the quick reply. I understand that the gift filter needs these escapes, however, knowing that anything between $$ is a Tex expression, why couldn't the gift filter interpret it literally?

V odgovor na Art M

Re: Extra backslashes when exporting Tex

od Tim Hunt -
Slika Core developers Slika Documentation writers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers

You seem to be assuming that the GIFT import is intelligent.

It actually just parses the input using some regular expressions.