Problem with algebra, TeX and jsMath in Moodle 1.6

Problem with algebra, TeX and jsMath in Moodle 1.6

by Sjaak Kamerling -
Number of replies: 9

Just started with Moodle 1.6 on a Windows XP-system with MIE, Opera and Firefox. I tried the algebra- and TeX-filter and I tried js Math (which was a great success in my Moodel 1.5-environment). With the algebra- and TeXfilter the math-code is not recognized (within MIE I get: undetermined error). With jsMath (3.3c) nothing happens: no jsMath in the corner. BTW: using jsMath-filter I hide the algebra= and TeX-filter.

Who knows a solution?

Sjaak Kamerling 

Average of ratings: -
In reply to Sjaak Kamerling

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Davide Cervone -
With jsMath (3.3c) nothing happens: no jsMath in the corner.

This is probably a silly question, but did you remember to unpack the jsMath.zip and jsMath-image-fonts.zip files when you downloaded the jsMath filter?

Did you customize your jsMath filter settings when you used Moodle 1.5, and if so, did you copy those settings to the javascript.php file for the new version? For example, if you set processSingleDollars, you will need to set that again in the new javascript.php file.

If those are all correct, the next thing to check is to use your browser to load moodle/lib/javascript-mod.php and see if it includes the jsMath javascript (it should contain a copy of the jsmath/javascript.php file). If that's there, load moodle/filter/jsmath/jsMath/plugins/autoload.js and make sure that can be found.

If so, view the source for a moodle page that should contain mathematics and see if there is a tag <span id="Process_jsMath"></span> in the page anywhere (there may be several).

If all that goes well, look in your browser's JavaScript console (if it has one) or turn on javascript error checking and see if you get any error reports about jsMath.

Finally, if none of that shows up anything, send me a URL for your site, and I'll look into it myself.

Davide
In reply to Davide Cervone

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Sjaak Kamerling -
Thanks for your answer. I will answer your questions onen by one.

I did unpack: I have public_html/filter/jsmath with files javascript.php and filter.php and subdirectory jsMath with a lot of files and four subdirectories, one is d the fonts-directory;

I didn't do any editing; I use doubledollarsigns; I did so within Moodle 1.5 and I want to use these signs in my complete new Moodle-installation (with no old 1.5-files) at my new server;

public_html/lib/javascript-mod.php gives the content of javascript.php from the jsmath-directory (BTW there is also a file javascript.php with another content in the lib-directory);

public_html/filter/jsmath/jsMath/plugins/autoload.js shows the content of this file;

!
a tag !

maybe the problems have nothing to do with the jsMath-configuration, for there were also problems with the algebra-filter (@@x^2@@ should give math-text; but no success); maybe it has to do with recognition of a filter, but I am no expert in this topic;

I hope the above will help

Sjaak
In reply to Sjaak Kamerling

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Davide Cervone -
I'm not sure if your message is complete. What does
   !
   a tag
mean? Was there supposed to be more to your message?

It sounds like things are working correctly up to the point you stopped, so that is good, at least. Now can you say what happens for the last two questions (viewing source and JavaScript console)?

If you want me to look at it myself, please send a URL for your site (you can do this using Moodle's message facility rather than making it public if you want).

Davide

In reply to Davide Cervone

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Sjaak Kamerling -
Indeed, a part of the mail is missing; I don't know why. Here is the second part of the mail:

a tag in a moodle page with jsMath can be seen;

javascript error checking doesn't give error reports about jsMath;

at first I thought there were problems with all the filters, but only the algebra/TeX-filter combination and jsMath-filter(with algebra/teX-filter hided) give problems;

I will send you the name of my website; I made a course "test jsMath" with a forum with some jsMath; I hope that will help;
thank you for your response;

Sjaak
In reply to Sjaak Kamerling

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Davide Cervone -
Thanks for the site. I have checked it out and think I found the problem. The javascript-mod.php file contains lines that it shouldn't. In particular, it contains '<?php' and '?>' that should not be in this file (since it is a javascript file, not a php file, despite its name. The .php file executes and its OUTPUT is the javascript. That output seems to contain '<?php and '?>', which it is not supposed to.

The javascript-mod.php file is supposed to look through the module, filter and block directories that you have on your system and create it output by concatenating the contents of the javascript.php files in those directories. It simply copies the data from the individual php files, so it looks like the module/filters/jsmath/javascript.php file has '<?php' and '?>' in it when it shouldn't. Did you edit this file and add them yourself? They are not in the copy that is in the CVS, so I'm not sure where it came from.

Check the moodle/filter/jsmath/javascript.php file and see if it starts with <?ph and ends with ?>. If so, remove those lines. That should take care of it.

Davide
In reply to Davide Cervone

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Beng Pu Siang -

I am not sure whether to continue with this thread or start a new one.

I am trying to install jsmath into moodle 1.8

I think I face the same problem there... no jsmath button to be found.

I have checked those stuffs that are mention above.

Is there anything to be done?

the url is

http://www.bbss.edu.sg/moodle-latest-18/a/moodle/

In reply to Beng Pu Siang

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Davide Cervone -
It looks like you have everything installed correctly. Note that the jsMath button only appears on pages that actually contain mathematics. Try entering some on a page and see if it gets typeset properly. I have looked at your site and the jsMath components are loading properly, so I expect that it will work when you actually enter some mathematics.

Davide
In reply to Davide Cervone

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Beng Pu Siang -

I might sound naive and silly here... I was expecting jsmath to be something like Math Equation. I expected to have some button in the editor to choose to enter the symbols.

So when you mentioned that I have to write into the editor some equation. I really have no idea.

Bottom line question... how to write in the equations without a menu? Should there be one in the first place.

In reply to Beng Pu Siang

Re: Problem with algebra, TeX and jsMath in Moodle 1.6

by Davide Cervone -
Equations are written using the TeX or LaTeX typesetting language (a text-based means of representing mathematical notation). There are many tutorials on line where you can find out how this is done). A lot of people are asking for a more "intuitive" method of editing mathematical equations, and there have been some references for some approaches to that in other messages on this forum, but right now, all the solutions use text-based representations in one form or another.

Davide