Advanced Math Tools - Moodle Crashed

Advanced Math Tools - Moodle Crashed

by Ryan Schopp -
Number of replies: 11

Hello, I was adding the advance Math Tools and ended up crashing my local moodle. When I pasted in the code for the Addtitional Code missed that i had to update the code with my kocal site info.

This is what i pasted in.

<link rel='stylesheet' type='text/css' href='http://111.121.101.131/lib/jsxgraph/distrib/jsxgraph.css' media='screen' />
<script type='text/javascript' src='http://111.121.101.131/lib/jsxgraph/distrib/jsxgraphcore.js'></script>;
<script type='text/javascript' src='http://111.121.101.131/lib/jsxgraph/distrib/GeonextReader.js'></script>;
<script type="text/javascript" src="http://111.121.101.131/lib/mathjax/MathJax.js">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
tex2jax: {displayMath: '@d','@d', inlineMath: '@i','@i' },
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
}
});

</script>

when I saved the moodle crashed. I can not get it to open again.

How can i fix this without getting into the moodle?

I am running 2.2 locally on my mac.

Your help is greatly appreciated!

Average of ratings: -
In reply to Ryan Schopp

Re: Advanced Math Tools - Moodle Crashed

by Mauno Korpelainen -

That's part of the old guide for MathJax 1.0 times... mixed

If you can't change the additional HTML directly I might try first adding to site config.php:

$CFG->additionalhtmlhead='';
$CFG->theme='standard';

You should be able to change additional HTML then from administration menu (press Save changes with empty textarea) and remove these $CFG settings from config.php once site access is OK.

 

In reply to Mauno Korpelainen

Re: Advanced Math Tools - Moodle Crashed

by Colin Fraser -
Picture of Documentation writers Picture of Testers

mm I tried the same settings, and found that the issue seems to be around the 111.121.101.131 ip adress. It is not connecting and the connection at http://cdn.mathjax.org is giving a 404 error. If the CDN is down then would that not cause a number of issues? Could replacing the 111.121.101.131 ip with the local ip be a fix?

In reply to Colin Fraser

Re: Advanced Math Tools - Moodle Crashed

by Marc Grober -

Using the appropriate URLs mathjax is responding as it should. See http://www.mathjax.org/docs/2.0/start.html

In reply to Marc Grober

Re: Advanced Math Tools - Moodle Crashed

by Colin Fraser -
Picture of Documentation writers Picture of Testers

mm OK, I agree with your suggestion in that the 111.121.101.131 ip is not appropriate, but what is it replaced with? I tried accessing the cdn and it too failed so  tried the full adress ad it worked. But what is the ip replacing the 111.121?  If nothing else, I at least need to update the Docs...smile

In reply to Colin Fraser

Re: Advanced Math Tools - Moodle Crashed

by Mauno Korpelainen -

There are a couple of issues... Since MathJax 1.1 the old configuration style was replaced with new style (under your 1.0 example in Moodle Docs http://docs.moodle.org/20/en/Advanced_Maths_Tools#Additional_HTML ) and you should be able to access http://cdn.mathjax.org/mathjax/latest/MathJax.js directly if the path for that file is correct. It is already running version 2.0 of MathJax. MathJax 2 has some new configurations - for example

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script>

as such should load a pretty heavy configuration.

The other issue is that editor plugins need to take the configuration from settings of math filter while additional HTML is mainly good for browsing the site with any themes. The better option might be to use theme layout files and add a "standard" extras.php to all such themes that need these plugins. I had in previous versions of package the option to select the latest cdn mathjax from settings of mathjax or local files and several versions of these asciimath configurations but now mathJax 2 supports asciimath input (no latexmath or asciisvg anyway) and for example SVG output... and therefore it might be better to use separate /lib/common/AS.php to render asciisvg graphs with Asciimath input through MathJax...

I did test different configurations last weekend (noticed mainly some issues with old cached files) and basicly MathJax 2.0 files are working nicely both from cdn and from local files. I have not yet upgraded the packages on my test site - tinymce, jsxgraph, mathjax, fmath, wiris (CAS),... practically 90% of these files have new versions and need some changes to settings of editor, math filter and theme files ( + book module ) ... or additional HTML if people wish to use it smile

I just wish I had more time to test these tools - right now I have 4 math lessons ahead and a large pack of exams to check smile

Finally - I have never tested how these files work on Mac server so there is no quarantee that freezing could not be caused by some mac issue. I have tested the files on PC environment and Linux (Debian). Most likely freezing is caused by some typo error in configuration ( missing [ [ ... ] ] around delimiters) or missing delimiters for mathjax in settings of math filter, some configuration conflict (local files and cdn files used at the same time with different configuratio by theme layout files AND additional HTML) or most likely wrong path for some file (capital/small letters like /MathJax vs /mathjax) ... or some server side path rewrite rule (port etc).

Such things can be checked from source (in browser Show source)

In reply to Mauno Korpelainen

Re: Advanced Math Tools - Moodle Crashed - Files upgraded

by Mauno Korpelainen -

Marc, Colin, ... just a short note:

I tested during the weekend all kinds of (possible) java(script)/filter/browser conflicts and have rewritten many parts of plugin code - upgraded to new version of tinymce 3.4.9 (in tinymath), latest jsxgraph, MathJax 2.0.2, latest FMath, latest Wiris editor and CAS and "fixed" a strange problem of dragmath in old plugins crashing with the latest Java ( took back code="Display/MainApplet.class" archive="DragMath.jar,lib/AbsoluteLayout.jar,lib/swing-layout-1.0.jar,lib/jdom.jar,lib/jep.jar" ) - by the way http://www.dragmath.bham.ac.uk/demo.html has this same issue...

One interesting experimental feature is that at the same time as the package can use new Wiris filter modified to use tinymath instead of tinymce and you can test Wiris editor (2000 formulas/year) and Wiris CAS (1000 calculations/year) you can also disable Wiris filter and let MathML filter render the same "customized mathml" with MathJax. Or you can use also FMathml plugin to render this "customized mathml" with similar "tags" as Wiris does and let Wiris filter show the result (if you have a Wiris license)

Both of these filters are now basicly using tags like

«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«mroot»«mrow»«mi»x«/mi»«mo»+«/mo»«mn»3«/mn»«/mrow»«mtext»4«/mtext»«/mroot»«/math»

to render maths like

Example 1

but there are still some "code compatibility issues" with font sizes, colours etc - output is not always similar even if both plugins basicly output mathml.

I may have said some not-so-nice comments about Wiris team (advertising) in some of my posts but I really DO like their new javascript based editor.  smile

Most site wide settings are controlled from settings of math filter in administration menu (math filter itself can be disabled) but it might be better to test the new files with preconfigured themes (mathstandard or stylist) - not with additional HTML in head at this point - and purge all caches from administration menu > development - because this is still very experimental code and not suitable for production sites yet. One thing that needs particularly detailed testing during the coming months is mobile devices, I am most likely going to test a modified set of mobile compatible tools in mobile themes next month...

The test package with MathJax 2.0.2 is downloadable in

http://korpelainen.net/mpluga2.zip

and I have so far tested it only with the latest moodle 2.2.2 (fresh install and upgrading from 2.1)

Not-yet-public-demo-site http://korpelainen.net/m2math/ seems to be running smoothly even if it is using the largest configuration available in MathJax 2: config=TeX-MML-AM_HTMLorMML-full

With MathJax 2 we might be able to say goodbye to asciimathml fallbackscripts since MathJax can render nicely asciimathml in all browsers, AS.php script can render asciisvg created by the asciisvg plugin and with a new setting old latexmathml examples can also be rendered with MathJax ( inside single  dollars ) without extra code. wink

In reply to Mauno Korpelainen

Re: Advanced Math Tools - Moodle Crashed - Files upgraded

by Marc Grober -

Assuming you are using CDN for both MathJax and jsxgraph,  then you might want to join me in  asking Alfred to implement a jsxgraph/latest URL (as opposed to the bit.ly that I used to sugest a redirect.)

AsciiMathML performance of MathJax is now at ASCIIMathML2.x and as long as AS.php libs handle ASCIIsvg and Davide tweaks MathJax to reflect core updates to ASCIIMathML (which seem dubious at this point) MathJax appears to be best in class solution unless one installs TexLive (though it would be nice if MathJax did polynom so that one could more easily handle long division example for primary students and polynomial division for HS students.)

In reply to Marc Grober

Re: Advanced Math Tools - Moodle Crashed - Files upgraded

by Mauno Korpelainen -

In this package ( http://korpelainen.net/mpluga2.zip ) settings of math filter suggest http://cdnjs.cloudflare.com/ajax/libs/jsxgraph/0.93/jsxgraphcore.js from CDN or local files (in package) downloaded from SVN - version 0.94rc1

I agree that getting the latest version of JSXGraph from http://cdnjs.cloudflare.com/ajax/libs/jsxgraph/latest/jsxgraphcore.js could be ideal (this file does not yet exist)

Files of included Asciimathml extension (in local MathJax 2.0.2) are now the same as in GIT MathJax 2.0.2, I did have a custom version of asciimathml extension but I replaced it with the "official" version. I am also planning to delete many old files from the package  (for example the optional asciimathml fallback renderer files) and the old jquery files used in the oldest demo plugins (for theming mainly) and create a much lighter package for CDN file users and upgrading.

In reply to Mauno Korpelainen

Re: Advanced Math Tools - Moodle Crashed - Files upgraded

by Marc Grober -

Yes, Mauno, as a recap of the discussion in jsxgraph google group, Alfred was initially concerned that using a redirect for "/latest" would be counterproductive. I had discussed a number of ways this could be done; link from the cloud provider, a redirect from their own dns,  or even a http://bit.ly/jsxgraph (though it appears that bit.ly has blocked thr ability to change a custom url,  so that http://bit.ly/jsxgraph can't be point to version .93 from version .91though I have inquired about the limit on untility this presents.)  I still think that "/latest" would be really handy and I invite you to bring to Alfred's attentin again in the jsxgraph googlegroups

The loss of service as a result of the mathjax.org DNS change is disconcerting and hopefully has been the subject of enough discussion that the mistakes involved will not arise again, but the situatin does make it all too apparent how fragile our virtual world is.

In reply to Marc Grober

Re: Advanced Math Tools - Moodle Crashed - Files upgraded

by Hilary Lai -

I am using this plugin to do math in moodle 2.2x. I find it working very good except in myandroid phone. When I mix the mathjax with jsxgraph, only half of the board appears. There is no such error in iPad. Just wonder why.

In reply to Marc Grober

Re: Advanced Math Tools - Moodle Crashed - Files upgraded

by Hilary Lai -

I am using this plugin to do math in moodle 2.2x. I find it working very good except in myandroid phone. When I mix the mathjax with jsxgraph, only half of the board appears. There is no such error in iPad. Just wonder why.