Newbie Algebra Filter Problem

Newbie Algebra Filter Problem

by none none -
Number of replies: 27

Hi All,

I've been experimanting with the math filters & have hit a wall that could use some help.

I've activated the Tex & Algebra modules.  The Tex works fine. 

Algebra returns "Undetermined error:"  in the field instead of the gif.  Can anyone point me in the right direction to troubleshoot this result?

Matt

Average of ratings: -
In reply to none none

Re: Newbie Algebra Filter Problem

by Don Quixote -

Hi Matt,

which command did you type? I will then check if I get the same error, too. (Trying with @@@a^2@@@ works fine with my 1.2...)

Greetings

Andreas

In reply to Don Quixote

Re: Newbie Algebra Filter Problem

by Harald H -
hi,
i got the same error, tex is working fine,
when i do the algebradebug i get the following: Notice: Undefined variable: cmd in /srv/www/htdocs/moodle/filter/algebra/algebradebug.php on line 227


Notice: Undefined variable: cmd in /srv/www/htdocs/moodle/filter/algebra/algebradebug.php on line 229

Notice: Undefined variable: status in /srv/www/htdocs/moodle/filter/algebra/algebradebug.php on line 229
The shell command

returned status =

Notice: Undefined variable: status in /srv/www/htdocs/moodle/filter/algebra/algebradebug.php on line 230

Notice: Undefined variable: status in /srv/www/htdocs/moodle/filter/algebra/algebradebug.php on line 232

Notice: Undefined variable: status in /srv/www/htdocs/moodle/filter/algebra/algebradebug.php on line 234

Notice: Undefined variable: commandpath in /srv/www/htdocs/moodle/filter/algebra/algebradebug.php on line 237

Notice: Undefined variable: commandpath in /srv/www/htdocs/moodle/filter/algebra/algebradebug.php on line 249
mimetex executable not found!
Image not found!

any idea?
tia
harald
In reply to Don Quixote

Re: Newbie Algebra Filter Problem

by none none -

andreas,

i used your arguement in a weekly outline field and got the same result: "undetermined error".  im in 1.2 also.

TeX returns "ebc3d7bedc1f11e08895c3124001cbb5.gif" in the same field after replacing the "@" 's with "$" 's.

i checked my modules and algebra is active.  i also checked my permissions to see if taht had anything to do with the problem.  they are the same as TeX, so i ruled that out.

In reply to Don Quixote

Re: Newbie Algebra Filter Problem

by none none -

i found the instructions in the algbra debugger and am working on the perl location in the algebra2tex.pl. 

matt

In reply to none none

Re: Newbie Algebra Filter Problem

by none none -

problem solved.  i had not properly set permissions on algebra2tex.pl.

In reply to none none

Re: Newbie Algebra Filter Problem

by Harald H -

so what are the permissions that algebra2tex.pl need?

and...the algebra filter needs the perl script?

just ask because the tex filter worls without

tia

In reply to Harald H

Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -
If your server is running Windows, you first need to install Perl.  You can obtain a suitable distribution of Perl from http://www.activestate.com/Products/ActivePerl/
In reply to Zbigniew Fiedorowicz

Ang: Re: Newbie Algebra Filter Problem

by Morten Brydensholt -

Hi

I'm running apache on win2000 (easyPHP) and I have installed Perl (ActivePerl). Everything is default.

Tex works ok but not algebra.

I get this message from the debugger when running algebradebug.php:

DB cache_filters entry for sin(z)/(x^2+y^2) not found.

I believe I have tried everything to make it work, so could someone please direct me.

Where do I put the algebra2tex.pl file? And the parser file?

Which modifications exactly should be made  to httpd.conf and algebra2tex.pl?

Best regards

Morten

In reply to Morten Brydensholt

Ang: Re: Newbie Algebra Filter Problem

by Morten Brydensholt -

I have uncommented

ScriptInterpreterSource registry

in "httpd.conf"

and added the following to "httpd.conf":

<Directory "C:/Programmer/EasyPHP1-7/www/moodle/filter/algebra">

Options +ExecCGI

AddHandler cgi-script .cgi .pl

</Directory>

The first lines of "algebra2tex.pl" is:

#!C:\Programmer\perl\perl.exe

use lib '.';

use AlgParser;

I'm pretty sure my Apache server executes the script.

Any clues will be highly appreciated.

Best regards

Morten

In reply to Morten Brydensholt

Re: Ang: Re: Newbie Algebra Filter Problem

by Richard Williamson -
If it's any use, I could not get algebra working for love nor money in 1.2.1. As soon as I upgraded to 1.3 it all worked fine.
In reply to Richard Williamson

Ang: Re: Ang: Re: Newbie Algebra Filter Problem

by Morten Brydensholt -

Thanks Richard

However I'm running the 1.3 version.

Does .pm-files need to be registered by windows/Apache?

Best regards

Morten

In reply to Morten Brydensholt

Re: Ang: Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -

I have uncommented

ScriptInterpreterSource registry

in "httpd.conf"

and added the following to "httpd.conf":

<Directory "C:/Programmer/EasyPHP1-7/www/moodle/filter/algebra">

Options +ExecCGI

AddHandler cgi-script .cgi .pl

</Directory>

Leave your httpd.conf alone, just as it was in the EasyPHP distribution.  The Perl scripts and mimeTeX are not executed by cgi calls from Apache but via the system() command, which invokes the native Windows command interpreter cmd.exe.

The first lines of "algebra2tex.pl" is:

#!C:\Programmer\perl\perl.exe

use lib '.'

Leave the first line of "algebra2tex.pl" as

#!/usr/bin/perl

 

That's what I have with EasyPHP and ActivePerl under WinXP, and it works for me. If you're still having trouble, open a Windows command prompt window, go into your moodle/filter/algebra directory and try the command
algebra2tex.pl  sin(z)/(x^2+y^2)
What error messages do you get?




In reply to Morten Brydensholt

Re: Ang: Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -
DB cache_filters entry for sin(z)/(x^2+y^2) not found.

This does not necessarily indicate any problem.  The DB cache_filters is updated only when you enter algebra expressions within Moodle itself, eg. within a forum, not when you enter an expression in the debugger.

What happens when you click on the "Show Image" button?  If an equation image is shown, then your algebra filter is working properly.

If "Show Image" doesn't work, what error message do you get?  Then try the "First Stage Tex Translation" and "Second Stage Tex Translation" buttons and tell us what happens.

You should not need to make any modifications to httpd.conf or to algebra2tex.pl.  [An early development version of the filter did require modifications, but not the current release version which came with Moodle 1.2.] Also you should not move any files -- all files should remain in the filter/algebra directory.


In reply to Zbigniew Fiedorowicz

Re: Ang: Re: Newbie Algebra Filter Problem

by Dick Tao -

I have the same problem stated above.

1. Error message for "Show Image" button:

Notice: Undefined variable: cmd in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 227


Notice: Undefined variable: cmd in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 229

Notice: Undefined variable: status in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 229
The shell command

returned status =

Notice: Undefined variable: status in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 230

Notice: Undefined variable: status in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 232

Notice: Undefined variable: status in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 234

Notice: Undefined variable: commandpath in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 237

Notice: Undefined variable: commandpath in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 249
mimetex executable not found!
Image not found!

2. "First Stage Tex Translation" and "Second Stage Tex Translation" buttons give the message of "No text output available"

Appreciate very much for any help.

Dick

In reply to Dick Tao

Re: Ang: Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -
You first need to get your tex filter working, since the algebra filter depends on the tex filter.  What error messages do you get when you run the texdebug.php script?
In reply to Zbigniew Fiedorowicz

Re: Ang: Re: Newbie Algebra Filter Problem

by Dick Tao -

 Tex filter works fine although I also get the error message of "DB cache_filters entry for f(x)=\Bigint_{-\infty}^x~e^{-t^2}dt not found" from pressing  Show DB Entry button. Show Image button showed perfect image.

Anything else that might be not correct?

Thanks,

Dick

In reply to Dick Tao

Ang: Re: Ang: Re: Newbie Algebra Filter Problem

by Morten Brydensholt -

Exactly the same as Dick above.

I'm only running the debug-thing because algebra notation does not work in forums ("Undetermined error").

The first and second stage Tex translations gives "No text output available".

Hitting the algebra2tex.pl directly gives "malformed header from script. Bad header=empty:".

Running the texdebug gives "DB cache_filters entry for f(x)=\Bigint_{-\infty}^x~e^{-t^2}dt not found".

And the Show image button displays the image ok. I have no problem running Tex what so ever.

Thanks

Morten

In reply to Dick Tao

Re: Ang: Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -
Have you installed ActivePerl?
In reply to Zbigniew Fiedorowicz

Re: Ang: Re: Newbie Algebra Filter Problem

by Dick Tao -
Yes. It was installed and running.
In reply to Dick Tao

Re: Ang: Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -
Have you tried this: open a Windows command prompt window, go into your moodle/filter/algebra directory and try the command
algebra2tex.pl  sin(z)/(x^2+y^2)
What error messages do you get?
In reply to Zbigniew Fiedorowicz

Re: Ang: Re: Newbie Algebra Filter Problem

by Dick Tao -
\frac{\sin\left(z\right)}{x 2+y 2}


In reply to Dick Tao

Re: Ang: Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -
OK try this: copy the text below into a Notepad window and save it as test.php in your moodle/filter/algebra/ folder.  Then invoke test.php the same way as you invoke algebradebug.php

<html>
<head><title>test</title></head>
<body>
<?PHP
system("algebra2tex.pl sin(z)/(x^2+y^2)");
?>
</body>
</html>

In reply to Zbigniew Fiedorowicz

Re: Ang: Re: Newbie Algebra Filter Problem

by Dick Tao -
\frac{\sin\left(z\right)}{x 2+y 2}
In reply to Dick Tao

Re: Ang: Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -
I just noticed that in the error messages you are getting from algebradebug.php the line numbers are different from what I have in the official release version.  Did you make any changes to the file?  Or are you using some old version?  Since the sourceforge cvs seems to be down, I am attaching my copy of algebradebug.php to this post.  Please retry with this version.

In reply to Zbigniew Fiedorowicz

Re: Ang: Re: Newbie Algebra Filter Problem

by Dick Tao -

I don't make any changes to the file. My version is 1.2. I have a testing computer that installed version 1.3 but experienced the same problem.

The following is the error message from your attachment:

Notice: Undefined variable: cmd in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 229


Notice: Undefined variable: cmd in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 231

Notice: Undefined variable: status in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 231
The shell command

returned status =

Notice: Undefined variable: status in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 232

Notice: Undefined variable: status in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 234

Notice: Undefined variable: status in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 236

Notice: Undefined variable: commandpath in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 239

Notice: Undefined variable: commandpath in D:\elearning\Apache2\htdocs\filter\algebra\algebradebug.php on line 251
mimetex executable not found!
Image not found!

In reply to Dick Tao

Re: Ang: Re: Newbie Algebra Filter Problem

by Zbigniew Fiedorowicz -
Dick,

I am taking this discussion offline to avoid cluttering up the bandwidth here.  Please check your email (the one in your profile here).  I'm sending you a modified algebradebug.php file.  Please reply to me by email.  Once we've figured out what the problem is, I'll post a summary here.

Zig