Posts made by Joseph Rézeau

Picture of Développeurs Picture of Développeurs de plugins Picture of Moodleurs particulièrement utiles Picture of Testeurs Picture of Traducteurs

Bonjour Fred,

Si ça peut te rassurer, tu n'es pas le seul. Tous les membres de l'un des "cours" de moodle.org sont devenus inscrits à tous les cours (depuis hier vendredi). Le problème a été signalé ici MDLSITE-97 et on attend une solution.

En attendant, tu peux toujours aller jeter un oeil au 简体中文 Moodle ou au Bulgarian Moodle. Bon week-end,

Joseph

Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi David,

Unfortunately the TeX filter is overzealous and will convert a number of Javascript lines in Hot Potatoes HTML files to maths images.

For instance:

Temp = InputStuff.replace(/ \ [ ClueNum\]/g, ClueNum);

---> Temp = InputStuff.replace(/<a href=".../moodle/filter/tex/texdebug.php"><img class="texrender" border="0" title="ClueNum" alt="" src=".../moodle/filter/tex/pix.php/eeed6d5...48.gif" style="vertical-align:middle" /></a>/g, ClueNum);

This unwanted conversion (which results in the HP crossword not working properly) happens in the following conditions:

  1. the TeX filter has been enabled sitewide by Admin
  2. a teacher puts a direct link to an HTML Hot Potatoes file placed in the course files

It does not happen if you use the "normal" Moodle interface to point to your HP HTML file, i.e. Add an Actitivy / Hot Potatoes Quiz.

I have identified the culprit (in Moodle 1.6.3). In file \moodle\filter\tex\filter.php line 125:

preg_match_all('/<tex>(.+?)<\/tex>|\$\$(.+?)\$\$|\\\\ \ [ (.+?)\\\\\]|\\[tex\\](.+?)\\[\/tex\\]/is', $text, $matches);

The part in red in the preg_match_all regular expression is too "greedy" and it matches the various /\[ClueNum\], /\[strParams\], etc. Javascript bits which are to be found in the Crossword HP files.

Questions for TeX filter experts (and mathematicians):

  1. Is the part in red in the preg_match_all really useful in the TeX filter? Or could it be made less greedy and more to the point?
  2. When the TeX filter is enabled sitewide, could there be a way to prevent it from operating on any uploade HTML resource file, e.g. using a <noTex></noTex> tag similar to the <nolink></nolink> used to prevent dynamic glossary linking?

Thanks,

Joseph

EDIT.- After posting my message, just realized that the overzealous TeX filter is at work on this forum too, and changes my bits of Javascript into images!!! So I have introduced a few extra spaces in my quoted Javascript to prevent this...

Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Tim,

"You can't have images in HTML dropdown lists" of course, but you can very well create a matching exercise with images in the Question text field and matching text in the Matching answer field. See attached screenshot.

Unfortunately, since the edit screen still does not offer the HTML editor facility for entering the images at the press of the Insert Image button, you have to resort to the folllowing tiresome manoeuvre.angry

  1. Use the Insert Image button to insert the image you need for pair 1A in the Question text window.
  2. Click on the Toggle HTML source button.
  3. Copy (or rather cut) the code for the image and paste it into Question 1 box.
  4. Then enter text 1B to match the picture in 1A, into box Matching Answer 1.
  5. Repeat operations 1 to 4 for all of your matching pairs.

Joseph

Attachment image-0000.jpg