New version of algebra filter added to main CVS tree

New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Number of replies: 24

Martin,

I've now added a new version of the algebra filter to cvs.../moodle/filter/.  This uses the same database caching technique as the existing tex filter. I've tested it under both Linux and WinXP/EasyPHP.  This filter requires that Perl be installed on the server, which of course is standard on Linux.  For WinXP I used ActivePerl, downloaded from http://www.activestate.com/Products/ActivePerl/ - no customization is required.

For those who have not seen prior discussions here, the algebra filter allows mathematics to be entered in a calculator style syntax, simpler  than that used by the TeX filter.  On the other hand, it is more limited in the type of expressions that can be entered.  However it should be adequate for courses at the secondary school level and lower level university courses.

Zig

PS.  Perhaps you should move the texh filter out of the main cvs tree and into contrib.  It is not fully functional without the hevea/imagen/CAML binaries, and may confuse users.

রেটিং এর গড়: -
In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Core developers এর ছবি Documentation writers এর ছবি Moodle HQ এর ছবি Particularly helpful Moodlers এর ছবি Plugin developers এর ছবি Testers এর ছবি
It could be argued that Perl could confuse users too চোখ টিপ but I agree there's no need to have the hevea version in the distro when the mimetex version is performing so well.
Thanks, Zig.

Likewise, there's no need for the algebra filter to include another copy of all the mimetex binaries - it should just use the ones from the "tex" filter.

Actually, while I'm here I would also like to rename the main filter files to make them shorter and consistent (thus easier to type). eg

tex_filter.php --> filter.php
algebra_filter --> filter.php

The upgrade process should take care of renaming existing textfilter lists.
In reply to Martin Dougiamas

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Core developers এর ছবি Documentation writers এর ছবি Moodle HQ এর ছবি Particularly helpful Moodlers এর ছবি Plugin developers এর ছবি Testers এর ছবি
(the other reason for consistent naming is that we will probably later have a better GUI for managing the active filter list)
In reply to Martin Dougiamas

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

Martin,

Could you turn on the algebra filter on moodle.org?

Zig

In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Core developers এর ছবি Documentation writers এর ছবি Moodle HQ এর ছবি Particularly helpful Moodlers এর ছবি Plugin developers এর ছবি Testers এর ছবি
OK, for a little while.  হাসি   @@dy/dx@@

If I need to slim down then it's the first to go, though.  One Maths filter is enough for this site.  হাসি
In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

I have install Active Perl, add "filter/algebra/algebra_filter.php" into tex filter list, and then test with typing @@dy/dx@@ in the html editor. I can't see any maths expression but just the following error message.

Undefined variable: title in c:\inetpub\wwwroot\coursework\filter\algebra\algebra_filter.php on line 76

In reply to Yip wing chiu

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Have you upgraded to the latest version of Moodle?  Does the TeX filter work?
In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

I have upgraded to the lastest version. Both the algebra and TeX filter can't work with different behaviour, for algebra, it displays error message, for TeX, it don't display any error message. All of them displays a "X" box (missing file) and the URL link of properties of missing file is as follow

Warning: system(): Unable to fork [c:\inetpub\wwwroot\coursework/filter/tex/mimetex.exe -e c:\upload/filter/tex/c6095277ed8b7f21992a555fa2d19462.gif "\Large dy/dx"] in c:\inetpub\wwwroot\coursework\filter\tex\pix.php on line 57
Image not found!

In reply to Yip wing chiu

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

It looks like there is something wrong with your mimetex.exe and algebra2tex.pl

  1. Is your server using the NTFS file system?  Make sure that the web server has "Read and Execute" permissions for mimetex.exe.  [Hit control-alt-delete to bring up the Task Manager to see what username the web server is running under. ] Also algebra2tex.pl should have "Read and Execute" permissions.
  2. Open a command prompt window, navigate to your filter/tex directory and type mimetex. What happens?  Similarly go to filter/algebra and type "algebra2tex.pl  x^2+y^2".

In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

Yes, my server using in NTFS file system. I am the administrator and have all permissions. I have download the lastest version, no error message displays now. However, it is still no maths expression display. Directly access the URL of the red X box display the following message :

"Invalid keyboard code specified This program cannot be run in DOS mode. Image not found!"

In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

In tex directory, when I type mimetex, nothing happen. It seem it run okay.  .

In algebra directory, when I type algebra2tex.pl x^2+y^2,

it display x 2 + y 2 on command line prompt.

@@x^2+y^2@@

In reply to Yip wing chiu

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

In tex directory, when I type mimetex, nothing happen. It seem it run okay.

Something is supposed to happen.  Something like this:

+-----------------------------------------------------------------------+
|mimeTeX vers 1.40, Copyright(c) 2002-2004, John Forkosh Associates, Inc|
+-----------------------------------------------------------------------+
| mimeTeX is free software, licensed to you under terms of the GNU/GPL, |
|           and comes with absolutely no warranty whatsoever.           |
+-----------------------------------------------------------------------+
Ascii dump of bitmap image...
....................................................**..
.............*...........*.........................*..*.
......***...*.............*........................*..*.
......*.....*.............*...........................*.

If not, then there is something wrong with your mimetex.exe.

If mimetex.exe works from the command line, try uploading the attached file texed.php into your moodle/filter/tex directory (where mimetex.exe is located).  Then go to the following url with your browser:

http://yoursiteaddress/moodle/filter/tex/texed.php

and click on the "Submit Query" button.  What happens?

Also what web server/php are you using? I have only tested the filter with EasyPHP/Apache.

In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

I follow your suggetion to try texed.php and click "Submit Query", the following message display :

Invalid keyboard code specified This program cannot be run in DOS mode. Image not found!

I'm using Apache 2.0.48, php 4.3.4.

Is it possible that the mimetex.exe cannot run under Chinese Windows XP?

In reply to Yip wing chiu

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Possibly. Another possibility is that mimetex.exe was unzipped incorrectly, as an ascii file rather than binary file. What is the size of mimetex.exe on your system?

What happens when you type "mimetex" from a command window? Do you get any output? What happens when you type "mimetex x" from a command window?
In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

I found that mimetex.exe does not display nothing. It just display too fast, so I try the following command "mimetex.exe > log" and then I found that the content of the file log is always :

"This program cannot be run in DOS mode"

In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

Oh! I found that the size of the minetex.exe download through CVS is of 324k. And the file you post in forum is of 314k. Also, I use the file you post on forum. It display correctly as you describle but it still can't product maths expression. However, when I directly access the URL of the red box that represent the missing gif file. It now diplay as follow :

Cache-Control: max-age=7200 Content-type: image/gif GIF87a8 [&-%)ÓYªn§U¼SÐ< ÖK2ëS¤NÍr}KËÉ!¹*J83kªUÔÔÖ[§pÖG©³ShÙJÄèØD¹LtÖBfÓ9éÜèÉíþ"::õ*Õ¬¶~§lØ´kw±][0îÕæÚ <ø2ÝÂWõ.®áßAImage not found!

In reply to Yip wing chiu

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Core developers এর ছবি Documentation writers এর ছবি Moodle HQ এর ছবি Particularly helpful Moodlers এর ছবি Plugin developers এর ছবি Testers এর ছবি
Anonymous CVS can sometimes be very behind.  To get the latets code, you can now download filters from the Modules page.
In reply to Yip wing chiu

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
The 314k version is an earlier version of mimetex.exe which does not work with the current version of the scripts. I am attaching the latest version of mimetex.exe with this post. Make sure that when you download it to your hard disk, its size is PRECISELY 328192 bytes.
In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Core developers এর ছবি Documentation writers এর ছবি Moodle HQ এর ছবি Particularly helpful Moodlers এর ছবি Plugin developers এর ছবি Testers এর ছবি
In reply to Martin Dougiamas

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

Ha! Ha! Thak you!!! Now I can display maths expression. But I have found interesting thing :

@@x^2+y^2=14@@

@@dy/dx@@

The first expression shows prefectly. But the 2 nd expression cause the following error message :

Undefined variable: title in C:\Apache\Apache2\htdocs\coursework\filter\algebra\filter.php on line 76

In reply to Yip wing chiu

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
That's because you typed @@@dy/dx@@@ previously, before the algebra filter was properly setup on your system. Consequently the cache_filters database entry for that expression is corrupt. You can fix that by using phpMyAdmin to delete the corrupt database entries. You can easily recognize the corrupt ones. The valid ones will have TeX expressions like x^2+y^2 in the rawtext field. The corrupt ones will have blank entries in the rawtext field.
In reply to Martin Dougiamas

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Sorry, I had the mistaken recollection that everything in download/ was a zip, and he was evidently having problems unzipping.
In reply to Zbigniew Fiedorowicz

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা
Hi Zig,

Thanks for your work on this - this is a great enhancement.

One question:
How do I enter calculator notation? do I still use double dollar signs? I tries to enter $$$sqrt(5)$$$ and it came out like this: $$sqrt(5)$$. Is this supposed to work with the algebra filter? If the Algebra filter for student input into quizzes? Or what exactly does the algebra filter do?

Thanks,
Lars.
In reply to Lars Jensen

Re: New version of algebra filter added to main CVS tree

{$a->নাম} - {$a->তারিখ} দ্বারা

The $ signs are reserved for the TeX filter.  Use double @ signs for the algebra filter:

@@@int(x^3 dx,0,1)=1/4@@@ ==>   @@int(x^3 dx,0,1)=1/4@@