Testing TeX filter

Testing TeX filter

by Zbigniew Fiedorowicz -
Number of replies: 4

The TeX filter is supposed to work only in the "Mathematics Tools" forum. It shouldn't mess with the following text. Let's check:

  1. Down with Micro$$oft$$!
  2. Down with $$CO leeche$$!
  3. $$#!%$%$$!!

Hmm??

Average of ratings: -
In reply to Zbigniew Fiedorowicz

Re: Testing TeX filter

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Actually, I was wondering about that ... I couldn't see any code that could have been checking for Maths forum. But it doesn't matter, everywhere is better anyway (you get more beta testers). smile
In reply to Martin Dougiamas

Re: Testing TeX filter

by Zbigniew Fiedorowicz -

It was this code, just before the umask() call in the filter function:

    if (strstr($scriptname,'post.php')) {
      $parent = forum_get_post_full($_GET['reply']);
      $discussion = get_record("forum_discussions","id",$parent->discussion);
    } else if (strstr($scriptname,'discuss.php')) {
      $discussion = get_record("forum_discussions","id",$_GET['d'] );
    } else {
      return $text;
    }
    if ($discussion->forum != 130) {
      return $text;
    }

The id of the Mathematics Tools forum is 130. Seriously, I think it might be helpful to have something like this as a model, showing how one can customize the action of filters, so they act in only certain courses, or certain activities within courses.

In reply to Zbigniew Fiedorowicz

Re: Testing TeX filter

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Never saw it. Ah! Just realized the contrib directory I snagged it from was anonymous CVS. tongueout  Doh!  No matter.

Yes, some sort of tighter targeting would be a cool thing down the track ... perhaps each activity or course could choose their filters.
In reply to Martin Dougiamas

Re: Testing TeX filter

by Zbigniew Fiedorowicz -
Actually what might have confused you is that I put that version in cvs:.../moodle/filter/tex/ not cvs:.../contrib/tex/