Moodle 2.X math plugins

Moodle 2.X math plugins

by Mauno Korpelainen -
Number of replies: 139

I promised to publish today a package of some new (and old) demo tools - plugins, filters scripts and for rendering mathematical notations and graphs - so here some documentation about downloading and using them:

I created two packages that work with all versions of moodle 2.X. The larger package http://korpelainen.net/mpluga.zip has 3 folders:

filter
lib
theme

and if you unzip the package inside your test moodle 2 site (or download first from moodle.org the latest version of some moodle 2.X) only one core file will be overwritten, lib/dragmath/applet/Config.xml, because I added there new Export format with

<Format displayName="GoogleTex" fileName="GoogleTex"></Format>

and did not want to use another dragmath folder (then no core files would have been overwritten).

Inside filter folder you should find following moodle 2.X filters: geogebra (updated by Christoph Reinisch), jsxgraph (originally from jsxgraph-team and modified by me), math and mathml (by me), mathtran (updated by Jean-Michel Vedrine) and finally inside tex folder 3 new files that are needed for moving and rendering asciisvg graph, fmath and texviewer fallback images to/from moodledata subfolders (outside webroot).

Inside lib folder are the main libraries: in common some asciimathml scripts, in dragmath 2 modified files, in editor folder the main tool - tinymath editor with all the plugins - and other folders are for geonext, jsxgraph, jquery and MathJax.

Here is the only difference between package mpluga.zip and the lighter package http://korpelainen.net/mplugb.zip which does not have MathJax included. If you want you can download the latest version of mathJax directly from Github - it should go to folder lib/MathJax.

Finally in theme folder you get two moodle 2 themes - 'mathstandard' which is a modification of core standard theme and layout files have inside head tags included all demo script tags from file theme/mathstandard/layout/extras.php - and the other theme 'stylist' has a little more advanced tools for selections, I haven't however updated it for some time to check the recent tags (bug fixes) of standard/base themes.

Once the files are in correct folders it's time to go to your site, login and if nothing happens click Notifications link from your site administration menu. In fresh installs settings are checked during install process (or if you upgrade previous version of moodle). If it's a new site no filters are enabled, editor is tinymce and theme is standard theme so you need to change some settings to get plugins and filters functional. If you need the plugins with all themes one option is to go to

Site administration > Appearance > Additional HTML > Within HEAD

and add the necessary script tags (pointing to external or local scripts) there with absolute paths

Additional HTML

and then enable needed filters from Site administration > Plugins > Filters > Manage filters

Filters

and select tinymath editor to default editor from Site administration > Plugins > Text editors > Manage editors

Editor

Personally I prefer theme based selection instead of site wide selection because you may want to use different settings in different courses and if you for example enable course themes from

Site administration > Appearance > Themes > Theme settings

you can use right away theme mathstandard or stylist or some of your customized themes on courses with different plugins or editors and let other courses stay away from math plugins smile

So the other option is to select theme mathstandard or stylist from Site administration > Appearance > Themes > Theme selector and you are ready to test plugins without any additional tags in Site administration > Appearance > Additional HTML > Within HEAD and those themes make the editor selection for you as well - you still need to enable filters. MATH FILTER can be disabled, plugins can use settings from math filter even if it is disabled. I have tested settings from two levels: from settings of MATH FILTER you can change some settings of plugins and enable/disable demo plugins in tinymat editor toolbar

Settings

Settings

From settings of TINYMATH EDITOR you can also chage some demo plugin settings:

Settings

Remember to save changes from the bottom of long setting list! If something goes wrong try default settings under each box.

Once you turn editing on and start testing, you should see the editor content area with the following buttons:

Editor

and if you enable the other included plugins from math filter settings other plugin go to 3rd row that can be toggled with the top left button in toolbar. They are worth testing too, although partly buggy and unfinished and wiris editor is also included but since it is not free you need to get a valid license after 2000 test images so it's hidden by default. Fmath plugins reguire flash and are closed code (although free to use) so they are disabled by default. Asciimath plugin and mathml plugins are for a large part unfinished.

The most interesting "plugin" in my opinion - Googlecharts - is not yet a proper plugin because you need to manually drag and drop or copy and paste img tag from field to another to get google charts inserted to editor (because this plugin is using Chart Wizard inside iframe and cross browser policy does not allow us to move data directly from that iframe to editor plugin (for security reasons) - untill javascript api is some day included to plugin itself smile So once you open the plugin you can for example click some demo graph

Charts

to get to Editor mode

Editor

and there (after chages) you can move the img tags to the yellow box over Insert button to add the google chart api graphs to your site.

Note also that in Geonext plugin when you create a new graph you need to click top left button to create a new graph in applet if no new graph is automatically opened (do not press Insert image)

Step 1

and once the applet is open you can use all the nice tools of Geonext to create jsxgraphs - the tool looks very much like Geogebra applet and I hope I can create a similar tool for adding Geogebra strings once Geogebra 4 (mobile) is officially stable.

Open

In googletex plugin people may be confused when they try to create colored backgrounds - and need to untick transparent background first!

Googletex

and for example in mathJax plugin (and other similar looking plugins) it is easy to get confused with many boxes and outputs - this is a thing that should be further improved to avoid "mixed syntax" (and a couple of my plugins have relics from other plugins since I have been trying to fit them all to one math plugin smile )

Mathjax

Average of ratings: Useful (3)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

And since these posts seem to lengthen too much I will try to create a new public moodle 2 plugin demo site next week with some fresh examples and explanations.

My demo server may be down some time tomorrow - files are moved to another main server with new kernel - so if my site is not responding or you don't see these attached images it's not caused by your browser or thousands of eager math teachers trying to download moodle 2 math plugins. The break should not take many hours. smile

PS. By the way if you have problems with performance (scripts just keep loading and loading) try to disable (untick) theme designer mode from Site administration > Appearance > Themes > Theme settings ... particularly mathJax can cause a real performance hit if files are not cached on moodle 2 sites that are using many other scripts as well

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Bob Mathews -

Wow, great job Mauno. Thanks for the detailed explanation. Of course that's to your benefit as much as ours -- it will reduce the number of questions you have to answer by, oh, 12% or so. wink

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -

This should be default Moodle configuration.....  Perhaps in Moodle 3.6?

In the meantime this should be included in the contrib db...

Nice job Mauno smile  You even added the geonext functionality to the tinyMCE toolbar?  wink

Did you see the example David Lippman posted to the jsxgraph list?

In reply to Marc Grober

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I searched and found David's posts to jsxgraph group after reading your post and it's really interesting to see their new fruits of co-operation...

I haven't told much about my mathml tests but since core dragmath plugin changes '<' and '>' to '&lt;' and '&gt' (in tinymath editor dragmath plugin this is not done and you can use mathml export format) and moodle strips mathml tags from all users in all those activities that students are allowed to use I added that new "mathml" filter which changes 5 fullwidth unicode characters to normal symbols and MathJax then renders given mathml in all activities. Now if we have a plugin that adds tags like

math instead of <math>

moodle won't strip "tags" (because they are not html tags) and filter and mathJax take care of the rest - in a cross browser compatible way.

Filter accepts only tags starting with <m and </ so it's safe and for example <script tags are not allowed by students - from current math tools dragmath could do this with new export format ("safemathml"), fmath_mathml plugin already does this (if you enable it) and I tested also using Wiris editor with mathml output which is very stable but since it is propably not allowed (without a valid license) to use only the Wiris math editor applet with mathml filter and mathjax and without Wiris image renderer - Ramon would see red wink - I have been testing mostly dragmath and fmath integration for a new "safemathml" plugin.

It is also possible to add some code to plugins which can convert for example old Wiris images that use

 'tagOpener': '«',  // \xAB
 'tagCloser': '»',  // \xBB
 'doubleQuote': '¨',  // \xA8
 'ampersand': '§',  // \xA7
 'quote': '`'   // \xB4

in their code to normal mathml or "safemathml" - for example if some site has used Wiris before and license has ended. Wiris plugin saves images by default inside existing tinymce plugin folder /cache which is also a little problematic if you move/upgrade site - you should move also the old Wiris images from old tinymce folder and that is not at all practical - and saving images inside web root can be a tiny security problem as well, that's why I added those 3 files inside tex filter folder to move asciisvg, fmath and texviewer fallback images to moodledata subfolders...

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -

And we are full circle to maintaining universal and transparent tools for online math.....  this is great work Mauno and much along the lines I was arguing, but the user needs constancy and uniformity in mark-up, and everytime there is a tweak, there is an equal and opposite retweak - lol

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Carles Aguiló-Collado -

Hi Mauno,

I just saw your post already from a few months ago, but I still would like to add two things:

1. WIRIS editor can be used for free up to 2000 formulas per natural year (more info at www.wiris.com/store).

2. WIRIS editor can be integrated with MathJax and we have some users doing it. It is of course hard to understand that people prefer a harder-to-read LaTeX look on the screen than a designed-especifically-for-the-screen wink but it is possible!

Thanks for mentioning us in this post.

All the best,

      Carles Aguiló
      carles@wiris.com 

In reply to Marc Grober

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Marc,

since David had sent an email to both of us about his new Graphing Calculator I noticed that the JSXGraph files included to my editor package are old - version 0.81 - and therefore JSXGraph VMLrenderer failed to render garphs in IE9 standards mode for IE9 and I had to use <meta http-equiv="X-UA-Compatible" content="IE=8" /> in theme layout files with extras.php

I just upgraded my local JSXgraph files from SVN to version v0.91.b and will upgrade the files in math plugin packages next week (and fix a couple of tiny bugs i have noticed so far) - this tiny upgrade will allow IE9 to render SVG (in Asciisvg graphs for a start)

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -

ALfred et al hve been busy wink

In reply to Marc Grober

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

One IE9 issue almost made me give up today - if you happen to find an IE9 near you and go to http://jsxgraph.uni-bayreuth.de/wiki/index.php/Another_example_for_displaying_GEONExT you may see only a black box - unless you press F12 and start debugging in IE9 standards mode and then IE9 shows graph nicely. I had to trace this reason for hours until it was found from vrsion 0.91b file src/JXG.js and lines that I commented (debugging!!!)

    debug: function (s) {
//        var i;

//        for(i = 0; i < arguments.length; i++) {
//            s = arguments[i];
//            if (console && console.log) {
//                if (typeof s === 'string') s = s.replace(/<\S[^><]*>/g, "");
//                console.log(s);
//            } else if (document.getElementById('debug')) {
//                document.getElementById('debug').innerHTML += s + "<br/>";
//            }
            // else: do nothing
//        }
    }
});

Now IE9 can show both asciisvg as SVG and JSXgraphs without meta tags, debugging or extra browser plugins - sometimes in a IE-way anyway smile

IE9

One bug I haven't been able to solve is why geonext plugin does not insert graphs in IE - developer tools of IE9 say

java.lang.IllegalArgumentException: No method found matching name util.Compression and arguments [sun.plugin2.main.client.MessagePassingJSObject]
geonext.php, line 49 character 1

and it looks like

   function getEncodedGeonextString(){
    var gxt = document.getElementById('gxt');
    var src = "<GEONEXT>\n<VERSION>xxx</VERSION>\n"+gxt.getBoardPane().write();
    src += "\t<control>\n\t\t<lefttoolbar>\n\t\t\t<type>USER</type>\n\t\t\t<name>User Defined Toolbar</name>\n\t\t\t<description>Current User Defined Toolbar</description>\n\t\t</lefttoolbar>\n\t\t<selectedlefttoolbar>0</selectedlefttoolbar>\n\t\t<buttonsize>24</buttonsize>\n\t\t<order>0;</order>\n\t</control>\n</GEONEXT>";
    return (new gxt.Packages.util.Compression()).encode(src);
   }

might not return any content from applet in IE while this works fine in FF, Chrome and Opera.

And my Safari does not like java applets at all - not GeoNext or Dragmath - it prefers to crash in such plugins that use applets.

Maybe I should ask our friend Google again... or Alfred ?

 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -

I believe ALfred et al have been working through the vagaries of IE9,  so I would start with the jsxgraph google group as that will get ALfred's attention, as well as that of David and others.....

In reply to Marc Grober

Re: Moodle 2.X math plugins

by Colin Fraser -
Picture of Documentation writers Picture of Testers

tongueout   Mauno.. what a job!!! Unbelievable... What you do is really appreciated, even by those who may never know your name... Thank you for making my life a little easier, now I can beat my technologically challenged colleages around the head and shoulders with what I don't know..smile

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ravi Vare -

Hei Mauno,

Fanstatic Work !!! Well done !!! Thanks a lot (on behalf of all math teachers from all over the world)

You are the 'MahaGuru'- Teacher of the teachers. (indian word)

I installed it successfully. and playing with it.

If you put any opportunity for me in writing 'Documents'.

it will be glorious thing to me.

 

Best regards,

Ravi

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by khaled baloul -

Hi Mauno, Hello all!

I just put in place a new moodle 2 testing site!

It just is working smoothly and nicely!

I would be reporting any bug that i could encounter!

Thanks, thanks a lot!

khaled

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

There is one thing that has caused me headache for a long time - which public image fallback servers to use for those sites that can't install latex, can't change permissions of local mimetex, can't install any other image renderers...

Traditionally people have in that case used some (cgi) mimetex renderers or mathtran server - or mathtex from forkosh site or for example many wp plugin users have used http://www.quantnet.com/cgi-bin/mathtex.cgi , some sites used sitmo.com latex renderer (that stopped responding) and so on.

For example in mathjax plugin I had set a 3 level check for editor content area image fallback: if settings (of tinymath) have a fallback url set it will be used - if this is empty plugin checks if local convert binary given in $CFG->filter_tex_pathconvert is executable and if it is texviewer.php in filter/tex folder will create fallback image using tex filter - and finally if local convert binary is not functional plugin was using 3rd option

"http://www.quantnet.com/cgi-bin/mathtex.cgi?\png"

that used to be public mathtex renderer but seems to be down now.

(Furthermore there should be one space after png because some mathematical notations start with a letter instead of backslash...)

I could set the "final straw" to

http://chart.apis.google.com/chart?cht=tx&chco=000000&chf=bg,s,FFFFFF00&chl=

(or those sites that have problems with missing fallback renderer could do it in settings)

fallback

but google chart api is using mimetex syntax which causes some glitches since syntax of mimetex and mathtex & other latex renderers is not always similar - if people select to save notations as tex images.

And using http://www.forkosh.dreamhost.com/mathtex.cgi or my test server cgi mathtex is not reasonable - it might eventually make both forkosh site and my test site crash when more and more "free hosted sites" could use our sites instead of local latex renderers...

Or should I simply set this last option to use some tiny temporary image and make the plugin tell that if fallback is not functional it's better to use other tools like fmath plugin images (images saved locally to moodledata) and forget latex renderers?

Also DELIMITERS (or tokens or what ever you want to call them) and init code of mathJax need to be set configurable so that plugins can use correct delimiters in output (the same as in init code), tabs need more examples, translation of most plugins is still missing...

Lots of work to be done in the near future smile

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

For MathJax plugin I decided to hide the whole option to add latex images or tex filter tags if no mathjax fallback is selected in settings of tinymath editor or if convert binary of tex filter is not executable - and in that case users see only 3 options: to add inline maths, display maths or plain notations without delimiters. If fallback url is given they will see also option to add latex images or tex filter tags. If no fallback url is given (default empty) but convert binary is executable plugin will use texviewer script and tex filter files for latex images.

I added delimiters for inline maths and display maths to settings of math filter and both mathjax plugin and scripts in mathstandard theme and stylist theme take those delimiters from settings. This is not yet a perfect solution - for example some email addresses may have @i or @d inside and if that address is given twice on the same page something strange may happen. For more complex delimiter settings it is better to edit script tags directly - now people can for example disable tex filter and change inline math delimiters to double dollars in settings to make mathjax render tex filter tags...

Mathjax

I will check next (tomorrow) the most unfinished part of this package - asciimathml script and plugin. You can update your current files if you want - I updated both packages on my test server some minutes ago and will create that public test site at the end of this week (once asciimathml plugin has some more content inside... wink

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -
Mauno, It is unclear on face of package which one to use if you want to do mathjax cdn but local hubconfig. Also, I suggested to Alfred using cdn for jsxgraph casual users so that might be other option - so, I am thinking reference lib directory for script source and fallback to CDN... That way it works no matter whether you havefiles installed or not.
In reply to Marc Grober

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I think I'll add the option to use either local MathJax or http://cdn.mathjax.org/mathjax/latest/MathJax.js available in the next update (may take a day or two) - like settings of current geogebra filter is giving 3 options to use http://www.geogebra.org/webstart/geogebra.jar (latest version), http://www.geogebra.org/webstart/3.2/geogebra.jar (version 3.2) or local applet with $CFG->wwwroot.'/filter/geogebra/32/geogebra.jar'

Geonext applet is in version 1.7.3 but I have not seen new development there during the last years so that must be the latest version of applet in lib/geonext. Sadly it's not a complete package, at least some help files are missing (for example lang_fi.jar) and when I looked at the apache error log some missing java utility file might explain this IE behaviour. I have not asket from Alfred yet.

JSXGraph files are in the latest version with one modification (commented out that debugging to enable graphs for IE9 in IE9standards mode) - if you set scripts to use the latest files for example with

<script type='text/javascript' src='http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js'></script>
<script type='text/javascript' src='http://jsxgraph.uni-bayreuth.de/distrib/GeonextReader.js'></script>

 some examples fail in IE9.

If sites need to use moodle offline local files are always better, if they need the latest versions external files can be all the time up-to-date but that can cause also problems for sites like http://cdn.mathjax.org/ - imagine that all moodle sites, WP sites, Drupal sites, Joomla sites... might start to use cdn mathtex some day - no server can handle such amount of http requests, it would make cdn mathjax down like sitmo latex is down now and forkosh site seems to be the only functional public mathtex site now... smile

For moodle sites that are not allowed to install any non-core things or change any settings or permissions (keytoschool etc) the only option to use maths might be some link to an external palette that can be attached to any forum, labels etc

For asciimathml I will most likely set those traditional 3 types of fallback scripts (in AMMathtex.php for texlive type syntax, AMMimetex.php for Mimetex/Google Chart api tex and AMMathtran.php for Mathtran/old style Tex - only AMMathtex.php is now available in my package file - and one of these files will be loaded as a part of AM.php according to selection in settings) but we could use also mathJax fallback for pure LatexMathML already without any browser detections or mathML plugins (latexmathml script must be first and then MathJax renders mathML for all browsers). So we need again more settings there to choose which options to use - in AM scripts I had 2 fallbacks AMTcgiloc (MathML in FF) and Gemcgiloc (fallback also in FF to force latex)...

In mathml I have noticed one major problem - it is easy to add math tags inside math tags and then mathjax throws errors so ideally mathml should be in editor content area in a non-editable (protected) element (img title/alt etc) and editor plugin should be a little more advanced - like moodle_emoticons plugin is showing images in editor content area but saves emoticon filter code when you press Save.

Average of ratings: Useful (1)
In reply to Marc Grober

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I just made a huge leap forward - Thanks to your ideas and emails that we changed with David.

Asciimathml can use MathJax fallback and it was much simpler than I never thought - we just need to set asciimathml scripts to output always MathML and let mathjax output that mathml with best ever browser support!!!

The main trick can be done with

var isIE = false;

but in moodle's case we can go much further. We can set input/output tables configurable with php and settings which makes a sort of multilang code possible. For example if I want to let students in Finland write

`kulma alfa`instead of english asciimathml code `angle alpha` to render $$\angle\alpha$$ it will be possible since we can set php code to use local translated code (still it takes time to write that code)

I am now so excited I could jump 3 meters up smile smile

I must take a short break now but I will try to write the basic code for the plugins today - our schools start on Thursday so I will be busy with my daily job during the coming weeks but I have now 2 days good time to make this new plugin code the most flexible ever seen smile

 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -
Yes, just saw email. Also was writing to Alfred about future of geonext as I recall he was mentioning another app format they were working on. I am excited to see Frederic active re mathjax and David active w jsxgraph. We desperately need to get folk together but never could get much response to that effort. I am as always concerned that kludges not make transparency and universality impossible - math wars (as in browser markup wars) will work against the user. Math folk should understand need for babblefish* more than anyone. We really need a superset of math tags that are uniform (or so I have argued in the past) so that math can be used with same tags no matter the app. While your clever duck < math > is handy, it is a bit of ouroborus if you know what I mean. BUT-SEE needs to be packaged for tinyMCE so it can be used in any web2 app - a bit of an order, I know, but that is arguably the future of numeracy (assuming there is a future after Finnish steel pan bands and falling US bond rating - lol) Thanks, Mauno. And thanks to your wife wink * Hitchhikers Guide wink
In reply to Marc Grober

Re: Moodle 2.X math plugins

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Hi Mauno, got it working first time everything is great, except I had the setting for the gif graphic at what seems too low a resolution, making it almost almost unreadable. Doubled the density and the obvious happened, the image is now too large, but quite readable. It is now dropped back to 150 and while it is large it is almost unreadable again. 

Density at 120

Image at density of 120

Density at 150 

Image a density of 150

Anything larger is obviously ridiculous and this is the best compromise, but it is not that tidy. I have tried a number of things but nothing seems to improve the quality of the image, without an increase in size.. thoughtful  Any suggestions would be most appreciated.. Cheers..

In reply to Colin Fraser

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

In tex filter density 120 is fine but you should change gif to png in that tex filter settings list. If it does not help there might be some problem in you version of Imagemagick or Ghostscript (convert binary) that are used to convert tex images to png files. Mimetex outputs always gifs.

I have asciimathml plugin now about 80% ready with MathJax fallback and also LatexMathML has in coming file mathJax fallback which gives a huge output quality improvement - I suppose that I will get new files ready in 3 or 4 hours - and will some cool things later... wink

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -
If I wasn't so disillusioned I suppose I would have finished the Tex tweak to bypass convert as one would have to have a very outdated TeX distro to still need it...
In reply to Marc Grober

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Well... that's a little unfinished procedure...

The first idea in my fallback settings was that those sites that want to use Latex and tex filter have some fully functional distro of Latex with convert binary (with ImageMagick or Ghostscript) and since most problems are caused by missing / non executable convert binary  most sites are forced to use mimetex or some external fallback. The second idea was that many sites may want to set fallback in settings and this setting is chosen first, if fallback setting is empty plugin checks that convert binary and if it is executable outputs images with texviewer.php file that is based on files of core tex filter - we could of course use dvipng etc but it would require changes booth to tex filter and texviewer. You can simply pass this by giving fallback url like http://korpelainen.net/cgi-bin/mathtex.cgi? in those Latex fallback settings.

BUT I don't think we need Image fallbacks after MathJax fallback anymore - my beta version of AMMathjax and asciimathml plugin and mathjax plugin are now included to both packages - you can for example download http://korpelainen.net/mplugb.zip and unzip the files over current test files - you already have MathJax and I changed the new files to use as default setting cdn files so mpluga.zip is needed only if you want to download all the files of mathjax again to your local site.

Tabs are still pretty empty but AMMathJax supports both asciimathml ( `...`), latexmathml ( $ ... $ ) and "forced fallback" ( @ @ ... @ @ - double @:s seem to cause here in moodle.org a syntax error wide eyes ). These settings are not yet configurable like mathjax delimiters - you can also use \textcolor , \colorbox and \density{value} in latexmathml (no plugin for that yet but I will implement full color support later) - try for example

$ \density{300}{{\textcolor{#fe6805}{#fe6805}}}$

colors

It is of course possible to change colors with editor textcolor and background color tools if you need only one color / notation but the benefit of latexmathml colors is that you can give notations like

$\colorbox{red}{testing dollars}\sum_{i=1}^{p}\sum_{j=1}^{q}\sum_{k=1}^{r}\textcolor{blue}{a_{ij}} \frac{\textcolor{green}{b_{jk}}c_{kl}}{\colorbox{Orange}{ text}}$

and asciimathml script converts this to mathml and Mathjax convert it to visible output for almost all available browser including mobiles and old browsers that just can use javascript.

I will start collecting the demo site examples tomorrow... smile

You can find the new settings from Site administration > Plugins > Filters > Math > Settings (and may need to click Notifications link first)

New settings

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Just read an email from David L saying that "IE before 9 did not have createElementNS, so you'll need to modify the createMmlNode function..."

I will check those IE versions 8, 7 and 6 tomorrow - and get back when that issue is sorted - mixed

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Thanks Mauno, done and better.. At some point, when I get a bit of time, in the not to distant future, maybe..smile  I will strip all this out and reinstall it, a couple of times I think then note it as I go reinstalling it. Would you object if I was to write up all of it for Moodle Docs. I know it is here, but over time, this will become more obscure and buried under the volume of discussions. Or you prefer to do it yourself? I can't help you coding the plugins but I can write some documentation for it.. Cheers.

In reply to Colin Fraser

Re: Moodle 2.X math plugins

by Ravi Vare -

Hi Colin,

That's the spirit !!!

Best of Luck for Documetation of mplugin.

Ravi

In reply to Colin Fraser

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Documentation of these plugins will take a long time so all the help you can give is welcome.

I think I sorted this IE6-8 issue very late last night our time and I have 2 possible/optional IE fixes but right now I must go to a teacher meeting and current versions of asciimathml and asciisvg are broken in IE6-8 in latest packages on my test server. I will try to find that time to update packages to fully functional code as soon as possible (later today)

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Thanks Mauno, won't be able to start on it for a couple of weeks but will let you know when is up and running. The installation pages are going to be fairly large so might break it down a bit, which means there might be some editing for you, but not too much I hope. wide eyes

In reply to Colin Fraser

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

My packages are now upgraded to new code.

Script lib/common/AMMathjax.php looks relatively stable now and renders MathML / MathJax fallback at least in latest versions of FF, Chrome, Opera, Safari and IE9 - browsers that support 'document.createElementNS' - and all of these render good quality output in asciimathml/latexmathml and asciisvg.

Those browers that do not support 'document.createElementNS' are handled like IE6, IE7 and IE8 and they use (sadly)
image tag fallback with asciimathml fallback url (if given in settings of tinymath editor) or texviewer.php / Tex filter latex or as a 3rd option my cgi mathtex server. I tried to render first fallback texstring from asciimathml script with MathJax latex fallback but it is not initialized so I had to use image fallback for old IEs until I find some way to "re-render" fallback texstrings in old IEs - I might try jQuery next...

I also fixed a couple of JSXGraph issues and all versions of IE show now JSXGraphs correct.

Themes might need some tiny css fixes too since graphs can be pretty large - particularly in mobiles and tablets such modifications are necessary. Graphs can be scaled to fit to small screens but it does not happen automatically...

My schedule looks busy right now since our schools start tomorrow but I will do my best to create that demo site next and once it is up and running you get some more material to add to Moodle Docs. I don't think we are even near the halfway yet - many modifications and new features & better tools should be available at the end of this year or next year but this is exactly the spirit of these open source projects: some ideas come and some go but something new is created every day smile 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Colin Fraser -
Picture of Documentation writers Picture of Testers

OK Mauno, will dl the newer packages and install them...and track them

Marc, Yes you Marc... you said.

"If I wasn't so disillusioned I suppose I would have finished the Tex tweak to bypass convert as one would have to have a very outdated TeX distro to still need it..."

You know yourself that there is always someone who gets comfortable with what they have and will not move. But reading between these two lines it would seem you have been supporting Mauno by adding code and ideas and suggestions. (And with me trying to follow some of your discussions and getting lost after the first comment or two.) So you have anything that can be used in the Docs?  Care to share??? .. tongueout  

In reply to Colin Fraser

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Don't be surprised if your navbar is in some odd place or missing... wide eyes

I noticed today a very funny bug that is caused by class .navbar that both jsxgraphs and moodle use.

If you edit file lib/jsxgraph/distrib/jsxgraph.css and add a new class .jxgbox before .navbar you will get navbar back to your moodle (where it belongs).

I tried to inspect where jsxgrahs actually use .navbar and it may be some relic from jsxgraph home site and we may not need at all

.jxgbox .navbar {
    color: #aaaaaa;
    background-color: #f5f5f5;
    padding: 2px;
    position: absolute;
    font-size: 10px;
    cursor: pointer;
    z-index: 100;
    right: 5px;
    bottom: 5px;
}

navbar

In reply to Colin Fraser

Re: Moodle 2.X math plugins

by Marc Grober -

Sorry Colin, but you seem to have me confused with someone who is being productive....

There is a Tracker item http://tracker.moodle.org/browse/MDL-23350 on the item I was talking about. The current config is that Moodle anticipates rather old TeX distros, which ended up requiring the convert binary. With the exception perhaps of Ubuntu that is no longe the case. And since with any current install of TexLive all the requisite binaries are in the core distro of that package, we cold make the TeX filter much easier to manage by avoiding convert as possible.  In fact, in as much as TeXLive is built to install by a user without root perms, one could arguably build an admin script somewhat along the lines I recommended for MathJax and use it to install Tex in the users designated location, which would get rid of a huge number of issues where users are lost because they do not have access to a system TeX install...  it could also make adding TeX macros (like longdiv, lol) easier by providing a way to install and reference them.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I started to design the demo site today and at first modified a little moodle 2 book module by Petr Skodak - it can be used like good old book module for documentation and it supports all my scripts and many other features... and for printing our nice looking graphs and mathematical notations with perfect quality and print css like a real "book".

At the same time I fixed a tiny IE6/7 theme bug in Stylist and added new buttons for book module to Stylist theme.

Mathbook

"Mathbook" is found from http://korpelainen.net/mplugbook.zip separately (tiny download) but it requires either files of mpluga.zip or mplugb.zip anyway (these packages do not have book module inside).

If you have downloaded MathJax before (in mpluga.zip or separately) or use cdn MathJax there is no need to download mluga.zip - mplugb.zip and optional mplugbook.zip have all the latest files but I do upgrade also mpluga.zip for new testers if I make some major changes.

Some people have wished that I could upgrade stylist theme to a standalone moodle 2 theme so I will do that also during the coming weeks... with some more options to drop or add theme settings (some sites want to have only one logo etc and this current version allows users to select some styling and editor (tinymath/tinymce/no editor in this math plugins package.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -

Mauno,

1) Wiki Book work is Very nice and reminds me of ASciencePad (btw,  if you hadn;t seen this yet: http://wiki.paranormalcop.org/index.php?title=Conic_section_in_polar_coordinates)

2)You need a staff to keep up with you and document what you have been doing. You should apply to someone and get a grant wink

3) Re MathJax... I had started toying with a php based install script for mathjax via svn based on a script developed for creating cutom php.ini files  with the idea that this would make installing mathjax simple and would allow automation of updating a local install, as one issue with installing any library is keeping it up todate, and that is especially applicable to matbhJax because of the huge amount of development. I am concerned about install systems that do not address upgrading of the underlying libraries. If the Moodle install basically pulled the libs and provided for update then the package would arguably include for mathjax a default hubconfig, a default js that called the CDN unless the actual lib was present, and a php script for pulling the lib via git or svn. No Mathbjax libs need be included in the plugin files.  The same could be done with jsxgraph, especially if Alfred et al move to hosting jsxgraph on the cloud as well.

In reply to Marc Grober

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I agree.

For JSXGraphs I need to use modified local files right now since there are 3 "bugs" that cause problems in current "latest jsxgraph" files:

- debugging of jsxgraphs causing trouble for ie9 (won't render jsxgraphs in standard ie9 mode if debugging code is there)
- some "magic mousemove code" that was used to make ie8 faster caused trouble for ie6 and ie7
- css in jsxgraph.css for .navbar made moodle's navbar vanish or jump to the bottom right corner depending on browser

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -

Chicken and the egg issue...  have you asked Alfred about his crew's intentions on these? I thought I saw something that suggested they were addressing at least the first two ...... 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Marc Grober -

Mauno,

In case you have not seen yet, David L has come up with jax for asciimathml, as well as new plugins for asciimathml under tinyMCE.

see google groups for Mathjax and asciimathml. also hoping to hear from Alfred re CDN for jsxgraph and info on jsxgraph gui.

Exciting times wink

In reply to Marc Grober

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

Don't get too excited yet, Marc!

David is going through similar browser testing as I did 2 days ago and http://dlippman.imathas.com/asciimathjax/ does not render yet mathjax in IE, Chrome, Opera or Safari correct - on the other hand Davidine's comments in http://groups.google.com/group/mathjax-users/browse_thread/thread/d78c8fce0ad88d8c do not recommend using asciimathml and mathjax in queue even if it works in all other browsers than IE6-8 (it does work in IE9).

The svg overflow tip by David was very valuable to get IE9 behave smile

IE9

I could also update moodle 2.X asciisvg plugin to render svg whenever it is possible (now my plugin version is intentionally set to render images inside the plugin to forget all kinds of browser/svg plugin checks) - and in David's demo plugin itself is rendering svg but the output page is set to use IE7 mode with meta tags and IE9 renders images instead of svg wink

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Marc Grober -

Mauno,

As I read the thread, that is why David L built an input jax, which seems to be what the example is using.

 MathJax.Hub.Config({
    extensions: ["asciimath2jax.js"],
    jax: ["input/AsciiMath","output/NativeMML"],
    "NativeMML": {  }
  });

per Davide's suggestion????

In reply to Marc Grober

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

In fact I just checked David's example and mathjax extension file asciimath2jax.js and was able to render a sort of combination of different input/output formats successfully in all browsers including IE6 (Quirks mode), IE7 and IE8.

I must make some further tests but this looks like a fully successful crossbrowser compatible non-image-fallback configuration that renders asciimathml/latexmathml in all browsers with mathJax wide eyes

Kudos to David L. smile

PS. I have not tested what happens with MathPlayer...

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Documentation started at Advanced Maths Tools. I could not think of a better name, and the intial page will simply be a description of the packages, the installation and then the configuration. Documenting the use of the tools is going to take a lot-lot-lot longer..smile  Please feel free to tidy up anything written, correct any errors or add further details I have missed. One small step at a time as, unfortunately, time is at a premium right now. 

Average of ratings: Useful (1)
In reply to Colin Fraser

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

Thanks Colin!

It might be good to remind all plugin testers that they are not yet bug free.

Just yesterday I noticed that Google Charts plugin throws some error messages in IE(9). Safari may not work at all with those plugins that use applets. And some other (tiny) bugs...

On pages/resources all browsers should render either good quality maths and graphs or some fallback images (mainly IE6-8) so a good option is to use always a good modern browser like Firefox or Chrome when you use the actual plugins for adding content to resources of moodle. IE9 is already a premium class browser - very close to the latest Chrome and Firefox smile

I am going to add comparisons of different syntax to docs during the coming month (for example roots and matrices but also some symbols can use different syntax in different tools and output may vary depending on tools you use) - and some more options to choose fallbacks (mathjax/mathtex/mimetex/mathtran) since all of these have some issues (syntax/environment/use of colors...)

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Thought that might be the case so included such a note at the head of the page.

Basically, user beware, test it thoroughly and complaints to be made in this forum.. big grin

 

In reply to Colin Fraser

Re: Moodle 2.X math plugins - new developments...

by Ravi Vare -

Hei Mauno &  Colin,

"Advanced Maths Tools' is nice idea.

I am very curious about how to colour Maths Symbol.

Now There are number of weapons for 'Maths symbol'.

If there will be chart which show comparatively features of each one.

Then we use each weapon smartly.

Best Regards,

Ravi

In reply to Ravi Vare

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

In mathjax syntax you can can add colors (text, background or border, in fact any css elements) by selecting the mathematical notations you have written and then using Select text color and Select background color buttons/palettes in editor toolbar (or html). Mathjax also supports colors in mathml but only \color in latex expressions.

In my asciimathml script latexmathml was written to give full color support and it works nicely with combination mathml & mathtex fallback with \textcolor and \colorbox syntax but requires \usepackage[usenames]{color} or \usepackage{color} either in tex filter tex preamble or in fallback tags if color package is installed in that existing latex distribution. Again if I set asciimathml script to use mathjax fallback it can use in latexmathml (latex) syntax colors with all other browsers than IE6-8 that would require mathtex fallback...

Even if mimetex supports only a few named colors with custom syntax like \red, \blue or \green google chart api tex (that otherwise is using mimetex syntax) can use all colors + gradient & striped fills with chart api syntax and you can change both textcolor and background color in editor googletex plugin with color tools at the top of plugin - background is set to transparent by default.

Mathtran does not support colors at all - here some background from year 2009: http://moodle.org/mod/forum/discuss.php?d=133132#p587630

More about this kind of issues in the coming docs - it may take some time to get the docs finished...

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

In fact MathJax has a much wider color and other style support than I knew before weekend when I visited an excellent test page by Dr. Carol J.V. Fisher in

http://www.onemathematicalcat.org/MathJaxDocumentation/TeXSyntax.htm

It is a huge page and gives much detailed information about special features of MathJax that are not all documented on main pages of MathJax.

I wonder if core developers and site administrators of moodle.org could allow adding mathjax script tags with some acceptable tokens to Moodle Docs - I was testing yesterday documentation with mediawiki (not with mathjax extension but with mathjax script tags in mediawiki theme) and it works fine using CDN mathjax. Here an example page:

http://korpelainen.net/m2mathwiki/index.php/Style

One more good point in using mediawiki is that it has printable pages available and if output of mathjax is set to HTML-CSS printing should give good quality output in all browsers - example

http://korpelainen.net/m2mathwiki/index.php?title=Style&printable=yes

The other option to add some more documentation to moodle docs might of course be to use current latex which can render most example as images.

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Marc Grober -

Seems to me discussions along those lines with respect to ASCIIMathML went, well, nowhere. Seems to me that you and I, Mauno, were demonstrating use of maths in mediawiki for some time and are arguably lucky to have what we have now in Moodle docs (Blahtex,as I recall?)  as Maths is not central to Moodle, to paraphrase one Moodle dev.....  Even the suggestion that a separate space in the docs for use of math fell on deaf ears and tracker items litter the tracker system.

In reply to Marc Grober

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

Well...  asciimathml was just not crossbrowser compatible then and still today official scripts aren't and we are talking about "our files", "Peter's files", "David's files"...

On the other hand MathJax is today both production ready and well documented in http://www.mathjax.org/ , it has great sponsors (supporters) and adding support of MathJax to moodle docs would require just adding a couple of lines to moodle docs skin (moodledocs). Mediawiki of moodle docs seems to be in version 1.16.5 and my examples are in mediawiki version 1.17.0 so modification of skins may have some differences but in my case I have in skin file Vector.php and function initPage lines

$out->addHeadItem( 'mathjax','<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
MathJax.Hub.Config({config:["TeX-AMS-MML_HTMLorMML.js"],jax:["input/TeX","input/MathML","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],tex2jax:{displayMath: [ ['."'XX','XX'] ],  inlineMath: [ ['Y','Y'".'] ]},TeX:{extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]}});
</script>'
);

to output cdn mathjax script tags in mediawiki. The mediawiki extension option is also available.

In the place of XX I use double dollars and in the place of Y tokens single dollars (did not want to output latex here).

On the other hand we see in moodle 2 (compared to moodle 1.9) what happens when lots of new features are added, number of lines of code doubles,... so I will use a compromise option and add some things to moodle docs with the tools that are in current mediawiki and use links to my personal wiki and demo site tools in such cases where moodle docs can't be used. One good point in Petr's book module is that it can be used to demonstrate also geogebra mobile examples so we will be able to show some things from the future tools... wink

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Marc Grober -

No, I agree that MathJax will be good for the web and great for Moodle. I am just not going to hold my breath....  As far as Moodle Docs, I am thinking that it would be much better to try to agree on a public mediawiki which could be by design focused on supporting Math in Moodle and the like along the lines of what you, I, and other have done.  It sems to me rather foolish to discuss using geogebra, geonext, jsxgraph etc in an  environment that can't support their illustration. I tried to do something of the sort through the University here and they are simply not interested in getting involved with supporting computer aided Math instruction (I guess that in part explains why so many kids in Alaska can't do Math....)

In reply to Marc Grober

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

I was a little suprised to see that most of the things we have in this package can be seen (both maths and graphs) also in mobile devices. Just tested with mymobile theme (with script tags in layout files / extras.php and $CFG->texteditors = 'textarea'; in theme config.php since mobile devices do not yet support editing of content with tinymce and therefore can't use editor / plugins) .

Here some screenshots from Opera Mini simulator:

Mobiles

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Hilary Lai -

Mauno, Thanks your everything you did. It just is so good.

I followed your method described in the post trying to turn mymobile theme to be friendly to your tools. I find that Mathjax can only be displayed properly if I refresh the page after it is loaded. For other things like google chart and jsxgraph, they just do not load. It happened on my 3Gs iphone and android phones.

Could you give me some hints to make it work?

In reply to Hilary Lai

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -
I have been really busy with my actual work - teaching - so I have not tested mobile themes or upgraded these files lately... or a couple of months... Anyway mymobile is not a typical moodle 2 theme - it is using jQuery and some custom elements and not loading all javascripts like other moodle 2 themes do. When I tested mobiles before last Christmas I was using stylist theme as a "prototype theme" for mobiles and those screenshots in previous post were taken from my test site running stylist theme in opera mini browser. Most javascripts seemed to work ok even in simple mobiles if those javascripts were rendered in theme layout files - but I never did a large scale testing with all sorts of mobiles. Thinking about myMobile theme javascripts should probably be initialized before jQuery or some other timing issue could explain this behaviour you described. I could try to check these issues and upgrade the files you mentioned in another post (jsxgraph etc) next week during our short skiing holiday. The asciimathml files in the package were very experimental and asciimathml extension for mathjax 1.X (modified version of David Lippman's asciimathml extension) was included only to local files but did not exist in cdn files so adding configuration for asciimathml with cdn files could not work as those files did not exist in cloud server. And if MathJax 2 is going to have a fully functional asciimathjax extension it makes using asciimathml with MathJax much simpler. At the same time the whole configuration of these plugin files might need some rewriting to make changing configurations and different settings of configurations more user friendly and to avoid conflicting settings. If days were just longer... smile
In reply to Marc Grober

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

As a proof of concept that opinions of core developers can change check http://tracker.moodle.org/browse/MDL-27622 where Martin D says:

 (In related news I hope that sometime soon we might even switch from YUI to jquery even for all the other core stuff).

This kind of news are sensational - even inside parentheses - core moodle using jQuery !!! And it's not April!

For several years jQuery has been a "bad word" here in moodle.org - if you have mentioned that you like jQuery more than YUI since jQuery can do some things in a much quicker, shorter and simpler way than YUI you may have gotten "freezing feedback" since YUI is the choice that we use... wink

Times change like we do.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Marc Grober -

Well, that is good news.....  but I am  not going to be holding my breath wink

In reply to Ravi Vare

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

The most important thing in using colors or other formatting is that in mathjax all css and html MUST be outside delimiters/tokens so when we select mathematical notations we must remember to select also delimiters - mathjax renders first valid code and then adds styles to fonts. In editor and on screen it looks like this (fonts do not look always the same in different browsers)

colors

But as soon as you need more than one color inside the same notation you need either mathml or such latex that supports syntax like \(text)color and \colorbox

- old examples like

colors 2

with code like \colorbox{red}{testing dollars}\sum_{i=1}^{p}\sum_{j=1}^{q}\sum_{k=1}^{r}\textcolor{blue}{a_{ij}} \frac{\textcolor{green}{b_{jk}}c_{kl}}{\colorbox{Orange}{ text}}

For students and most teachers this kind of code is impossible to use - luckily you have also that flash based tool Fmath editor (disabled by default) and you can use most styles there

to render either images with the other plugin I have added or mathml with the other plugin - latex syntax is too buggy in this plugin to be used right now.

colors 3

If you need to print your pages I recommend using in most cases MathJax (when possible) and these other tools mainly for "special cases" (notations or symbols that are not supported by mathjax)

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Ravi Vare -

Hei Mauno,

Nice Explanation as usual.

i will read it number of times.

Thanks again.

Best Regards.

Ravi

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Ravi Vare -

Hei Mauno,

I installed new package from http://docs.moodle.org/20/en/Advanced_Maths_Tools (MplugA)

Now,

Is there any need of 'Additional HTML' ? (For MathJax).

Do i remove it?

I can give colour to maths Symbol (using MathJax)

Thanks a lot

Regards,

Ravi

In reply to Ravi Vare

Re: Moodle 2.X math plugins - new developments...

by Ravi Vare -

I think, No need to delete 'Additional HTML'.

There are different scripts for diff. renderer.

But,

'This Script(s)' can be included in Package.

-----------------

Hi Colin,

We can include 'read me' file in Package

 

Best Regards,

Ravi

 

[P.S. - I know mission is going on]

In reply to Ravi Vare

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

If you are using a theme that already has script tag code in theme's layout files included (from extras.php) - in this case mathstandard and stylist theme - you don't need any additional html tags.

In fact I should add some more details about possible extra css required/not required for jsxgraphs, latex images (class 'texrender' is needed for vertical alignment of tex images - or images need some style themselves) and for example editor.css (styles that you see in editor content area & styles list)

More about these next week... after weekend smile

 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Steffen Fahl -

I am a bit puzzeld by Mathjax. If I klick on the button it starts a popup with an extreme long working script. If I am lucky I can see and use the tabs, but except the dragmath interface in tab2 I really dont find anything. OK I am no mathematician, so perhaps this might be of more practical use than I would imagine, but imho I really dont know of what use this could be. What is that endless script for? What might be the content of the tabs? Why should'nt I just use the dragmath editor directly? If I paste the default code in the textfields of the math configuration I just get the code in the corresponding tabs of the Mathjax-popup. Is all this really the way Mathjax is intended? 

Meanwhile all other mathfunctionalities of thoses mathplugs are really awesome.

great work

best

Steffen

In reply to Steffen Fahl

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

Can you tell some more details about your environment - which browser, which operating system, which version of java..., which theme? Or is it a https site? Mac? (I have not tested all environments)

Can you debug any errors with your browser/moodle/java console,site error log ?

My dragmath opens in about 1-2 seconds after clicking tab 2.

Mathjax does not render images so you can't render actual result in editor content area and plugin should find and use the same delimiters you have given in settings - themes mathstandard and stylist use the same delimiters from settings - and tabs should render the code you have given in settings in about second if your mathjax is properly configured and in the correct place. Https sites may have difficulties with CDN address http://cdn.mathjax.org/mathjax/latest/MathJax.js - See http://www.mathjax.org/resources/faqs/ for more details.

It is possible to use mathjax to just render latex or mathml that you get from Dragmath plugin directly - if you use the same delimiters for mathjax that dragmath outputs with selected export format (MoodleTex is using double dollars) - if no other renderer like tex filter is using the same delimiters and does not render maths before mathjax. The idea of using configurable tabs is that teachers/administrators can add custom content to tabs and when they click that notation they get the code to textarea as many times as they need it. Writing code can be slow anyway.

Ideally tabs should be preconfigured and I was planning to add most symbols from http://www.mathjax.org/docs/1.1/tex.html#supported-latex-commands to the first tabs and some examples to the last tabs but have not found the time to select such "good examples".

I was also testing a mathml plugin where I had Wiris in one tab, dragmath in another tab and Fmath in 3rd tab and they all could add mathml to this textarea to be PREVIEWED before adding to main editor content area that does not render any other type of maths than images. So the main purpose of using one textarea before adding content from plugin to editor was to see what code looks like in preview window and when it is later rendered with MathJax scripts - latex syntax and mathml is not always similar with different renderers and different versions of mathml and you don't always (often) get things WYSIWYG...

Dragmath, Wiris and Fmath plugin (fmath_formula) with image output are most suitable for such users that do not understand syntax of latex, asciimath or mathml - and these 3 plugins help also those people who can write code but want to make things with click - click - method wink

+ you can disable such plugins that you don't need/use.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Steffen Fahl -

Hello Mauno,

Thank you very much for your detailed response. It definitly helps me to understand a bit more what it is about if I am right to take it as kind of a Latex and other Math-Symbol-Preview option.

I also have no problem with the Dragmath-Editor neither opend from its own button in the Tinymath-Editor nor in the GoogleTex-Plugin (which seems to me a bit similar to Mathjax).

I use the decaf theme which at least needs som scripting for its dropdown menus. Perhaps this might cause any conflict. Might there be perhaps any parts of the additional added html code of the header, which are not necessary beside the code of decaf, so deleting this might perhaps stop the endless working script when opening Mathjax.

I think I should keep an eye on your work it definitly brings moodle 2.1 a large leap forward Yes 

best Steffen

In reply to Steffen Fahl

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

Javascript conflicts are possible (any errors you get to find out the reason are valuable) and like I said to Colin in one of the previous posts these plugins are not bug-free and they are still in alpha/beta level - some part of code may not be cross browser compatible and even if I have tried to test all the modern browers on my computers it is impossible for one person to test all kinds of combinations of different environments, browsers and so on.

For example in the old moodle 1.9 plugins overlib javascripts (different kinds of onmouseover things) caused conflicts and freezing of IE.

MathJax itself is a huge package of javascript and it has all kinds of special features - when I was testing how to use mathjax as asciimathml fallback (last week) everything seemed to work fine, even in IE6-8 with a tiny "trick" until I tested this "trick" in printing pages of book module that do not use theme header the same way as other modules do - and mathjax fallback was not rendered although those pages were using exactly the same code for mathjax as other pages! And image fallback did not have such problems at all wide eyes

Last winter I had lots of problems with some scripts that did not seem to work until I noticed that the culprit was actually outside browsers - a local performance testing script...and for example the list of different kinds of IE issues in the past is huge... wink

I will use next 4 days for documentation of customization of plugins and some guide about syntax. At the same time I will create that public demo site to my test server and update the packages on next Friday (26th of this month) and post more details here.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

This is actually harder than I remembered - new IE issues every week...

After upgrading moodle Decaf/IE problems vanished so it was probably a temporary issue in some version of moodle 2.X (??)...

Today when I was testing at work the coming public test site IE8 there told me that I have no access to mathjax javascript files on my test sites local folder (??) - CDN files were accepted...

Book module has same header tags both in Print book- and Print Chapter- options, still IE9 prints the whole book ok and does not render mathjax in chapter printing (??)...

And when you print something Mathjax needs to use output format HTML-CSS since output format NativeMML can drop such symbols like "+" so we should most likely drop NativeMML output format from mathjax configuration. We can still input also MathML and MathJax can output this MathML (to screen or printer) in HTML-CSS format.

Anyway I have uploaded the latest test versions (upgraded packages) to http://korpelainen.net/mlugatest.zip , http://korpelainen.net/mlugbtest.zip and corresponding book http://korpelainen.net/mplugbooktest.zip

I did not replace the original packages yet since there are a couple of IE issues that need some more testing and rewriting of code - on the other hand these new files have some bug fixes and new features that were not included to previous files. I have been separating asciimathml fallback to 3 optional fallbacks: mathjax fallback, mathtex fallback and mimetex fallback and IE6-8 have different problems with each of them. Mathjax fallback is a temporary solution that converts asciimathml and latexmathml tags first to latex syntax with mathjax tokens but since IE6-8 do not fire mathjax in correct time I needed to add extra "fakeIE" input format and then IE6-8 tries to find this format first and since it does not find such format asciimath script gets the time needed for rendering latex and then IE6-8 renders mathjax code. It means that IE6-8 is not doing anything sensible during the first 5 seconds but it renders asciimath-mathjax queue finally. Hopefully David L gets the straight asciimathml input format for MathJax done so that it can output HTML-CSS for IE as well smile

Mathtex fallback for IE6-8 works pretty well since mathtex can cache fallback images and it is this way relatively fast even in IE but very few sites can install mathtex and mimetex fallback has the worst support of different latex symbols. And experimetal (tex filter based) texviewer is at the moment too slow since it does not cache images and tex filter code can't be used since filters render code before javascripts mixed

I did use a lot of time this week in comparing input/output syntax of different formats and it looks like the best way to go forward is to add support for all the (AMS) latex symbols that MathJax supports

http://www.mathjax.org/docs/1.1/tex.html#supported-latex-commands

to Asciimath mathtex fallback first and eventually to mimetex fallback (by combining old symbols) too.

At the same time I added new settings for tab 3 and 4 with tool tips mathjax plugin to allow picking up those most common (AMS) latex symbols from these tabs - and other tabs will have more content next week smile

Since these symbols are ordinary links that send symbols to textarea with javascript they could be as well "buttonized" (to make them look like a button) with css once the structure and order of the most common symbols is clear.

MathJax tabs

I'll be back next week.

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

IE6-8 renderer problem solved!!!

It was finally simple:

I had to add to function strarr2docFrag(arr, linebreaks, latex) in file lib/common/AMMathjax.php

 if (expr && isIE) {newFrag.appendChild(AMTparseMath(arr[i],latex));MathJax.Hub.Queue(["Typeset",MathJax.Hub]);}

to make MathJax launch at the correct time for IE6-8

(after creation of mathjax tags with mathjax tokens in function AMTparseMath)

and IE6-8 rendered asciimathml with mathjax faster than ever!!!

All packages upgraded to new versions and testpackages deleted.

The next step is to add full support of mathjax symbols to asciimath input/output tables - next week smile

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Marc Grober -

hooray!  Make sure to keep David and Davide up to date.

In reply to Marc Grober

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

This same method could be used with any normal asciimathml javascript fallback version - it requires only 3 things:

Tiny changes to fallbacks:

var isIE = !(document.createElementNS);

Later

function  AMTparseMath(str,istex) {
 if (istex) {
 var texstring = str;
 } else {
 var texstring = AMTparseAMtoTeX(str);
 }
 //alert(texstring);
 if (mathcolor!="") {
 texstring = "\\"+mathcolor + texstring;
 }
 texstring = texstring.replace(/textcolor/g,"color");
 var node = createElementXHTML("span");
 node.innerHTML = "<?php echo $CFG->filter_math_mathjaxi1; ?>" + texstring + "<?php echo $CFG->filter_math_mathjaxi2; ?>" ;
 return node;
}

where these red mathjax delimiters could be given with a variable at the beginning of asciimathml javascript (for example double dollars)

and then this line

if (expr && isIE) {newFrag.appendChild(AMTparseMath(arr[i],latex));MathJax.Hub.Queue(["Typeset",MathJax.Hub]);}

in function strarr2docFrag(arr, linebreaks, latex) to render given fallback in those browsers that can't use "document.createElementNS" (mainly IE6-8).

But to make this even better we need to upgrade also AMsymbols to give full support for mathjax latex tags. I will do that during the next week and after those changes it will be possible to add "translated" asciimathml tags to output different mathematical symbols with local names in addition to english asciimathml tags.

I will also add one more version of asciimathml-mathjax fallback next week - a minimized script without latexmathml since mathjax can output all the things that latexmathml does and this way we can avoid also conflicts between such jquery scripts that reserve single dollar for custom use (some themes use jquery for menus etc)

I did test also David's asciimath input format in mathjax configuration and in the long run it might be good to have such format to mathjax but we can as well use this kind of workaround since it may take some time until asciimath input format can be used in core mathjax - IF it is implemented to mathjax core files.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Ravi Vare -

Hei Mauno,

Some Long Mathematical Expressions can't adust in Moodle 2.1

Plz.

http://moodle.org/mod/forum/discuss.php?d=182130#p795680

TIA

Ravi

In reply to Ravi Vare

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

That looks like a tiny css bug in Quiz module, maybe Tim Hunt could help in that issue - similar problems were seen in many resources about year ago but Sam H. fixed most of them with a code that adds scrollbar under long content like long text or large images to avoid overlapping or cutting of content. It's partly a theme issue and partly a core code issue.

Long text

Some graphs and other embedded content can also have issues with small screens or large graph widths so all themes will need more css and possibly javascript for scaling large content if necessary - particularly in mobile themes and tablet themes.

And one of the related bugs still remaining is that forum posts can get pretty narrow after many posts shown nested - for example this post looks like this  with a little smaller screen width, no more space for graphs, time to start a new post next week smile Note however that the scrollbar is there at the bottom of the long and narrow box!

Looks like this

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Ravi Vare -

Hei Mauno,

Yes, i want that- Scroll bar at the bottom if Long expression is there.

BTW, OK

i am waiting Moodle 2.1.2

(It is OK with Moodle 1.9- At the Bottom Scroll bar appear automatically)

If it happen with Moodle 2.1.2, then i will raise the Post.

How was weekend ?smile

Ravi

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

One more annoying IE6-8 fallback issue - if there is no original MathJax content on the page the previous procedure still does not seem to launch AsciimathML - MathJax fallback in IE6-8 !!!

A workaround could be for example to add to theme layout files (or additional body tags) something like

<?php echo $CFG->filter_math_mathjaxi1 . " ~ " . $CFG->filter_math_mathjaxi2; ?>

to render space with mathjax and this makes mathjax scripts run...

On the other hand it might be good to have some kind of "prechecker" of existing code to prevent loading of these javascripts if page has no MathJax tokens or asciimathml tokens - for performance reasons mixed

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Marc Grober -

The deeper the kludges the more difficult to maintain.

Remember back to when we were talking about an asciimathml core script that would call the various libraries and set switches as necessary for the environment? There is your pre-checker - lol. That is really what we are talking about, and it would make more sense to do as much of that via mark-up...

Or you can throw your hands up in disgust and abandon IE  wink

In reply to Steffen Fahl

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

Steffen,

I was able to reproduce the problem you described in IE9 set to different modes in Decaf theme but don't know yet what code there might freeze IE/MathJax - probably some "header hack" in Decaf.

From other themes avoid Mymobile theme (beta) until it is stable and fully tested - it is using heavy customization with mobile jQuery and most likely does not show any course content with math scripts. Core themes work fine with math plugins.

If you want to use some custom theme without site wide code in additional HTML you can edit either theme config.php or theme lib.php and add there (inside php tags)

$CFG->texteditors = 'tinymath,textarea';

to set tinymath the default editor for that theme

and add to theme layout files (general.php, frontpage.php etc inside theme folder layout)

      <?php require ("extras.php"); ?>

just before </head>

and copy from attached extras.zip file extras.php to your theme layout folder.

Note also that if you use sitewide additional HTML for all themes with absolute paths you need to make sure that you have set delimiters ( in settings of math filter, $CFG->mathjaxd1 to $CFG->mathjaxi2) the same as in additional HTML where you can't use php.


 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Steffen Fahl -

MathJax problem in 2.1.2

When I try to update my moodle 2.1.2 to install new plugins I get an errormessage:

"Plugin "editor_MathJax" ist defekt oder veraltet. Der Prozess wird abgebrochen."

Debug info: Invalid plugin directory name.
Stack trace:
  • line 286 of /lib/upgradelib.php: plugin_defective_exception thrown
  • line 1466 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 317 of /admin/index.php: call to upgrade_noncore()

I hope this will be nothing serious. Right now it keeps me from upgrading my system with new plugins.

best

Steffen

In reply to Steffen Fahl

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

Well... it sounds a little worrying since there should be no editor called MathJax... wink

You may have accidentally moved files of MathJax from folder lib to folder lib/editor.

I am going to upgrade all my Math plugin files during the next 2 days and add new packages to my test server on Friday or Saturday (15th of October) and before that I should test all the latest files of moodle 2.1.2 with math plugins.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins - new developments...

by Steffen Fahl -

Oops!

Thanks for your help!

fahl5

In reply to Colin Fraser

Re: Moodle 2.X math plugins - new developments...

by Marc Grober -

Did a quick add to DragMath and Mathematics 2.x doc pages.  I suppose someone should address 1.9 pages and discuss the plugins or 1.9....

When Mauno has a "release" I think it sould be published to the contrib db so he should create an entry or coordinate with someone else to get tat done.

I suppose the hack to the Tex filter eliminating convert if not necessary cold be included in the plugin package if Mauno wanted to do that just to tidy things up.

In reply to Marc Grober

Re: Moodle 2.X math plugins - new developments...

by Mauno Korpelainen -

I have not upgraded the 1.9 plugins since 2009 (if I remember it correct) and most of the 2.X plugin code could be modified to 1.9 - with math filter code and either theme based editor integration or the lib file based integration on other forums.

You could remind me that I should address different environment based issues next week - some plugins may not work on https sites ( I am not an administrator of such sites so I haven't tested but for example MathJax may need a different path...), I need to explain how to change custom themes to use settings (layout + css), how to change plugins, how to use different plugins in different themes or different plugins for teachers and students, how to change fallbacks and things like that - how to customize these tools for local needs smile

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Just a short note:

These files were upgraded 27th of August and I have been testing/fixing some issues further but have been rather busy with other school things during the past month...

I am planning to doublecheck and upgrade all the files of packages on 15th of October (next week)

Thank You for all the feedback I have received directly from these forum posts and from private emails smile

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I was too optimistic to get it all done before 15th of October...

You can actually download either (upgrading) package http://korpelainen.net/mlugaup.zip with all files or http://korpelainen.net/mlugbup.zip (only local asciimath extension inside lib/MathJax in case you already have MathJax in lib/MathJax) but do not install them to production sites...

Some things added:

- latest geogebra filter from GIT
- setting to select JSXGraph main file from cdn cloud, local minimized file or local non-minimized file / latest version (in settings of Math filter)

- setting to use LOCAL Asciimath extension (Mathjax) and separate AS.php for asciisvg instead of old fallback files (in settings of Math filter). Note that if you test asciimath extension you MUST also select LOCAL MathJax (not cdn) since those extension files do not exist in cloud... Asciimath extension is totally crossbrowser compatible in HTML output (used in all browsers with MMLorHTML: { prefer: "HTML" } to make sure that everything is printed OK - mathml output is not crossbrowser compatible) but it does not support latexmathml (you can use for example MathJax itself for old Latexmathml examples) and it does not support my old "forced fallback" delimiters (double @s or GeMs in some script versions). Themes Stylist and MathStandard (layout/extras.php) and mod/book/print.php & plugins of tinymath can select files according to this setting but if you want to use site wide additional HTML (in administration menu) for all themes you will need to enable either Stylist or MathStandard after changes in settings and copy from browser source the script tags before </head> to additional HTML which is at this point a little complex...

- latest version of tinymce (3.4.6) upgraded to editor tinymath with support to iOS, iPods and iPads, but most likely some plugins won't work in iPads/iPods. If somebody could test this with theme stylist or mathstandard (and local asciimath extension selected with local mathjax) I would be very happy since I don't have any iPads or iPods available, only an iPad simulator...

- some tiny changes to themes and plugins

More details coming next week...remember to visit settings of math filter and click Notifications link + purge all caches from administration menu to make sure that all settings have been saved and upgraded.

EDIT: One more note - the book module (with script tags in print.php) included to these two packages can be used in any version of moodle 2 but there will be separate 2.0 and 2.1- versions available with more modified code soon since Petr did upgrade his files last week. I could also create a different module (mathbook) that could be used in addition to standard book module to avoid conflicts in the future smile

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Francisco Perez Garcia -

Mauno,

Thank you very much for your work with the math plugin.

There is a mistake in the link to download your plugin. I understand you forget a p. The latest version correct link is NOT http://korpelainen.net/mlugaup.zip or http://korpelainen.net/mlugbup.zip, but:

CORRECT LINKS ARE http://korpelainen.net/mplugaup.zip or http://korpelainen.net/mplugbup.zip ??????, but

I am not sure because it also exists http://korpelainen.net/mplugaup.zip.

Which links have the latest version of the math plugins?

Thank you very much

In reply to Francisco Perez Garcia

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Yes, of course - the packages mplugaup.zip and mplugbup have the newer code but they had some very experimental code that was not fully tested a month ago so I did not replace the packages mpluga.zip and mplugb.zip with the latest files.

But it might be time to collect the "latest versions of files" again during the weekend and upload fully checked packages to my test server next week. smile

 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Francisco Perez Garcia -

Thank you very much for your help. This weekend I will download the latest versions at our different test servers: www.formaciovirtual.com, www.tecnologies.net and innovation servers of University of Barcelona (UB): http://cvinnovacio.ub.edu and www.xarxaicampus.net/moodle.

Our idea is to test first at my test servers and after more professors, mainly from Economy and Math Faculties from our network of innovation projects using Moodle, will test at the UB innovation servers.  At the UB innovation servers we will test with small groups of students and course 2012-2013 we would like to use it at the Virtual Campus of UB http://campusvirtual.ub.edu

As soon as Moodle 2.2 is been released we will also test your math plugins there.

In reply to Francisco Perez Garcia

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Sounds great!

There are several optional configurations in these plugins that are not yet properly documented and in my opinion the best approach for testing is to limit testing first to some themes instead of site wide additional html in header but there are a couple of settings that I really should try to document better as soon as possible. Personally I might like to get a new version of mobile theme tested with some math plugins included and maybe separate mobile editor version (tinymobile?) tested during the next months - all mobiles can render most maths (graphs may not be scalable) but for example flash in FMath plugin (disabled by default)  can't be used in such mobiles that do not support flash. Anyway all content should be editable on desktop devices and readable on mobile devices...

Moodle 2.2 should be released within a couple of weeks (in December) so it's a good target to get my package files upgraded at the same time smile

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Francisco Perez Garcia -

Mauno,

As you know Moodle 2.2 was released last week.

Are your package files upgraded for Moodle 2.2?

In reply to Francisco Perez Garcia

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Yes,

you can use the same files with all moodle versions 2.X - including 2.2.

Note that the official book module version 2.1 was upgraded in November and if you use book module check http://moodle.org/mod/forum/discuss.php?d=191666

The plugin packages have one version of book included that has math script tags and it can be used with moodle 2.2 as well - or the zipped 2.1 version found from http://moodle.org/mod/forum/discuss.php?d=191666

I have been busy with teaching so I have not made many changes to files lately. After Christmas I have again more time to test new and existing features - I will start a new post then. smile

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

Hello,

I have installed math plugins in version 2.2 and I got this error message after some seconds

Script http://cdn.mathjax.org/mathjax/latest/config/TeX-AMS-MML_HTMLorMML.js:49  don't finish (or so).

What can I do?

Ralph

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I don't understand where that ...config/TeX-AMS-MML_HTMLorMML.js:49  comes from... ???

Switch you theme to "mathstandard" or "stylist" for testing and try to visit Site administration > Plugins > Filters > Manage filters and there click settings of Math filter (it does not need to be enabled).

If you set there URL of MathJax files to "Latest MathJax in cdn.mathjax.org your site should have in source code

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

If you choose "Local MathJax in lib/MathJax" your site source should have

<script type="text/javascript" src="http://path_to_your_moodle/lib/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

Have you created mathjax tags yourself or is your theme using extras.php for custom theme or Additional HTML for all themes?

cdn.mathjax.org does not have a file that your site is trying to use - the rest of address after latest/ is simply wrong.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

Help please! I have changed the theme to mathstandard and now it is not possible to log in.

With firefox I see the screen, but I can nothing type in. With IE I see a white screen.

Please look there:   http://moodle.schule.de

How I can get the old theme back. I have root rights for the server.

Ralph

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

Sorry, it is not the correct URL.

The correct URL is

http://moodle.osz-lise-meitner.eu

Ralph

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

I have back my old theme and I can login!!! I had used lynx and there is no problems with themes and so it was possible to switch back to my old theme.

Ralph

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

It was not possible to switch to "mathstandard" or "stylist" (see my other articles in this group). So I have changed "Latest MathJax in cdn.mathjax.org" to "Local MathJax in lib/MathJax" and I get the same problem:

I call the editor, click on the button "insert mathjax" and I see a MathJax window. Left is Tab 1 to Tab 11 and in the middle:

"Info

Administrators can fill thes tabs with customized mathematical notations (and so on)......"

Firefox hangs and after a while comes the warning:

"A script on this page ist perhaps busy or do not answer.....

Script:  http://<my site>/moodle/lms/lib/MathJax/config/TeX-AMS-MML_HTMLorMML.js:49 "

I hope, this ist helpfully for you.

Ralph

 

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I am no sure how you have configured your server but when i followed your link my browser came to http://ods4.schule.de/moodle/lms/

Changing the settings of math filter don't help if your site or theme layout files do not load the necessary script tags. If you want to use Formfactor theme you can copy file extras.php from theme/mathstandard/layout/ to theme/formfactor/layout and add to formfactor layout files general.php, frontpage.php and embedded.php just before </head> tag

 <?php require ("extras.php"); ?>

To make tinymath default editor copy file theme/mathstandard/lib.php to theme/formfactor/lib.php (that theme does not have a lib.php file but all moodle 2 themes can use a lib.php file)

If you still get a blank page delete all files from your moodledata cache folder (usually cache is purged from administration menu > Development)

If this does not help revert the previous changes (remove previously added lib.php and the tags for requiring extras.php)

I suppose you might have some old (cached)  additional HTML (script) tags in Site administration > Appearance > Additional HTML > Within HEAD that might break source - or some really strange address rewrite rules on your site - I can't find any other explanation for this

/config/TeX-AMS-MML_HTMLorMML.js:49

(where has MathJax.js before ?config gone - how does ? change to / and finally your path has :49 at the end...)

Edit: ... or it might be possible that some url rewrite rule could cause MathJax.js to search configuration file from /config/TeX-AMS-MML_HTMLorMML.js:49 and MathJax.js itself can't find named configuration file with this :49 mixed

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

This is a virtual server. If you write  http://moodle.osz-lise-meitner.eu , httpd makes a redirect to  http://ods4.schule.de/moodle/lms .

I have all tried what you had written, but nothing has changed. I get the same message and NO formula appears in the editor.

Perhaps I had made a mistake in "Additional HTML"? First I had forgotten to insert this code.

Then I have insert the code without any modification.

Then I have changed all words with "yourserver" (or similar) to "ods4.schule.de/moodle/lms" ,

but nothing has changed.

Ralph

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Basicly you should need only additional HTML in Head OR tags of extras.php in theme but not both. Current tags in source are

<link rel='stylesheet' type='text/css' href='http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css' media='screen' />
<script type='text/javascript' src='http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js'></script>
<script type='text/javascript' src='http://jsxgraph.uni-bayreuth.de/distrib/GeonextReader.js'></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
    jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML"],
	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>
<script language="javascript" type="text/javascript">
var AScgiloc = "http://ods4.schule.de/moodle/lms/lib/common/php/svgimg.php";
var dsvglocation = "http://ods4.schule.de/moodle/lms/lib/common/";
var AMTcgiloc = "http://ods4.schule.de/moodle/lms/filter/tex/texviewer.php?action=Mimetex&tex=";//Primary fallback
var Gemcgiloc = "http://ods4.schule.de/moodle/lms/filter/tex/texviewer.php?action=Tex&tex=";//"Forced fallback"
</script>
<script src="http://ods4.schule.de/moodle/lms/lib/common/AM.php" type="text/javascript"></script><link rel="stylesheet" type="text/css" href="http://ods4.schule.de/moodle/lms/lib/jsxgraph/distrib/jsxgraph.css" media="screen" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/jsxgraph/0.92/jsxgraphcore.js" type='text/javascript'></script>
<script src="http://ods4.schule.de/moodle/lms/lib/jsxgraph/src/GeonextReader.js" type='text/javascript'></script>
<script src="http://ods4.schule.de/moodle/lms/lib/common/AS.php" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    MMLorHTML: { prefer: "HTML" },
    extensions: ["asciimath2jax.js"],
    jax: ["input/AsciiMath"],
	tex2jax: {displayMath: '','',  inlineMath: '','' }
  });
</script>
<script type="text/javascript" src="https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Ralph,

see http://moodle.org/mod/forum/discuss.php?d=191666 for more details.

I would remove all your current additional HTML tags from administration menu and change math filter to use local files for mathjax, jsxgraph and asciimath + check the delimiters for mathjax in settings of math filter.

If local files of mathjax are version 1.1 it should just work...

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

If you have loaded the latest package "mpluga.zip" it should have all the local files including MathJax 1.1 and if you want to use those files with additional HTML (without extras.php) your tags in additional HTML might be

<link rel="stylesheet" type="text/css" href="http://ods4.schule.de/moodle/lms/lib/jsxgraph/distrib/jsxgraph.css" media="screen" />
<script src="http://ods4.schule.de/moodle/lms/lib/jsxgraph/distrib/jsxgraphcore.js" type='text/javascript'></script>
<script src="http://ods4.schule.de/moodle/lms/lib/jsxgraph/src/GeonextReader.js" type='text/javascript'></script>
<script src="http://ods4.schule.de/moodle/lms/lib/common/AS.php" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    MMLorHTML: { prefer: "HTML" },
    extensions: ["asciimath2jax.js"],
    jax: ["input/AsciiMath"],
    tex2jax: {displayMath: [ ['@d','@d'] ],  inlineMath: [ ['@i','@i'] ] }
  });
</script>
<script type="text/javascript" src="http://ods4.schule.de/moodle/lms/lib/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

and in this case Math filter should have the same tokens/delimiters set for inline and display math.

Note also that you can't use local asciimathml extension for MathJax with cloud (cdn) files because cdn does not have asciimathml extension so if you want to use cdn files you can't use local asciimathml extension with mathjax and then you need to use some other asciimathml fallback...

I am going to add some more rules to filter settings after Christmas to prevent mixing different renderers and to allow administrators disable unnecessary tags if they don't need some scripts...

Finally all the tinymath plugins are using settings of math filter to render correct paths so if you want to use custom scripts without filter you need to modify also plugins and that makes things more complex again. In a clean install the easiest thing to do is to check the settings of math filter (use local files with mpluga.zip files), enable jsxgraph filter, select mathstandard theme or stylist theme and go... and if everything looks good you can then start modifying custom settings, custom theme settings etc.

And: remember to purge caches after major changes (from administration menu > development - moodle 2 is able to keep both css and javascripts cached for quite a long time.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

I'm sorry, but it did not work. I get the same error message (script busy). At best I can write ONE letter and then firefox hangs totaly.

Thank you very much for your support.

Greetings

Ralph

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Obviously some script conflict (if you have several versions of the same scrips in source) ???

At least your MathJax is fully functional - test http://ods4.schule.de/moodle/lms/lib/MathJax/test

The problem might be caused by mixed settings of asciimathml files and editor plugins - I could try to reproduce such conflicts next week...

On possible reason for hanging might be that you have have chosen such fallback script that tries to use Mathtex/Mimetex fallback from your server and if there is no functional latex renderer or Mimetex does not work (tex filter does not work) "3rd fallback texviewer.php" might hang - could you check which settings you had for fallbacks in settings of math filter.

Did you check server (Apache) error logs? Any missing files in access/error logs? Or did you try debugging errors in moodle or browser (for example firefox error console)?

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

I had updated from 2.1 to 2.2 ome week ago and have nothing changed in this part of moodle. I am not a developer.

In access.log I find this lines around my click on the mathjax button:

66.249.72.38 - - [20/Dec/2011:22:08:21 +0100] "GET /moodle/lms/lib/MathJax/docs/html/tex.html HTTP/1.1" 200 69653
79.247.143.188 - - [20/Dec/2011:22:08:25 +0100] "GET /moodle/lms/lib/editor/tinymath/tiny_mce/3.4.6/plugins/mathjax/mathjax.php HTTP/1.1" 200 12503
79.247.143.188 - - [20/Dec/2011:22:08:25 +0100] "GET /moodle/lms/lib/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML HTTP/1.1" 304 -
79.247.143.188 - - [20/Dec/2011:22:08:25 +0100] "GET /moodle/lms/lib/editor/tinymath/tiny_mce/3.4.6/plugins/mathjax/testpage.php HTTP/1.1" 200 616
79.247.143.188 - - [20/Dec/2011:22:08:26 +0100] "GET /moodle/lms/lib/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML HTTP/1.1" 304 -
66.249.72.38 - - [20/Dec/2011:22:08:51 +0100] "GET /moodle/lms/lib/MathJax/docs/html/startup.html HTTP/1.1" 200 13519
79.247.143.188 - - [20/Dec/2011:22:08:57 +0100] "POST /egroupware/json.php?menuaction=notifications.notifications_ajax.get_notifications HTTP/1.1" 200 15
79.247.143.188 - - [20/Dec/2011:22:08:58 +0100] "POST /egroupware/json.php?menuaction=felamimail.ajaxfelamimail.refreshMessageList HTTP/1.1" 200 26398
79.247.143.188 - - [20/Dec/2011:22:08:58 +0100] "POST /egroupware/json.php?menuaction=felamimail.ajaxfelamimail.refreshFolderList HTTP/1.1" 200 2130

66... is a "Google bot" (??) an 79.... is my IP number.

There is no entry in error.log.

Asciimath fallback file is "Local MathJax extension"

Ralph

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I created a test account to my test site and sent you a private message - to make sure that the problem is not in your browser or for example version of your java (dragmath and other applets can crash in certain versions of java - and Safari)

If you can add content to my test site we should try to find out the setting that is causing failures on your site - it can be one variable or one setting - for example in settings of tinymath editor

Site administration > Plugins > Text editors > Tinymath editor

both mathjax fallback and asciimathfallback could be empty or you could set them use temporarely

http://korpelainen.net/cgi-bin/mathtex.cgi?

to make sure that texviewer script in filter/tex folder is not causing the hanging.

Or it might be some setting of php or apache but to know that we should get some help from debugging

Site administration > Development > Debugging > Debug messages -> ALL

MathJax entries in your access log are normal - and google bots searching files - I don't know if the last entries have something to do with http://www.egroupware.org/ but they don't look like moodle access log entries.

 

 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

Hello Mauno,

thank you for setting moodle account. Yes, it works. I can create formulas.

After switch on debugging in moodle on my system I find in access.log the following line:

79.247.191.36 - - [22/Dec/2011:23:08:11 +0100] "GET /moodle/lms/lib/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML HTTP/1.1" 304 -

You know, this is the script which don't finish.

Greetings

Ralph

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

OK - so now it's clear that the problem is in your site settings.

Status code 304 should not cause a problem - if the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server SHOULD respond with this status code. And 200 means that the request has succeeded.

I still suspect that delimiters/tokens for inline math and display math are not properly set - see for example http://groups.google.com/group/mathjax-users/browse_thread/thread/4f2db23d7902493b# where Mitar had set in configuration

'inlineMath': [ ],'displayMath': [ ],

(nothing inside arrays) that made firefox freeze, mathJax did not know what to do when it should have replaced some code inside "nothing"...

Some old examples about mathjax configuration had wrong code since in moodle.org moodle docs links are using double square parentheses [ [ ... ] ] . Basicly these plugins have only a few requirements - delimiters/tokens for mathjax in settings of math filter (defaults @i for inlinemaths and @d for displaymaths) should be the same in mathjax configuration in script tags. If you use extras.php plugins should automatically take the same values from database, if you use additional HTML you need to set them manually to script tags. One extra/missing character can sometimes break such code.

Javascript can be broken by various reasons - but you should see in such cases some real errors in browser developer tools like FF error console, Google Chrome code inspector or IE8/9 Developer tools/script debugging. Anyway, we know that the test page of mathjax works on your site so you should just find the tiny piece of code breaking javascript in editor. If tinymce / tinymath editor is instantly freezing the problem might be also in some (corrupted) plugin or missing setting of plugin. So I am going to reinstall the latest files to my local test PC today (a fresh install) and try to figure out possible reasons for freezing editor (both core tinymce and tinymath).

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Ralph Ballier -
Picture of Particularly helpful Moodlers

Hello,

I have mathjax new installed, but it is not better.

I have nothing changed in moodle, except what you hade told to me. Therefore I can not say whether brackets are empty or not. Where I have to look for this in the code?

Greetings

Ralph

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I should probably have admin rights to your site to be able to check the settings and source of a page using editor on your site. Your current front page source shows only cdn mathjax script tags without any extra configuration.

But let's try one more time:

if you have not already tried this create one test course and then go to

Site administration > Appearance > Themes > Theme settings

Select (tick) "Allow course themes" and press Save changes

Go to your test course and click link Edit settings (=edit course settings)

Select from "Force theme" > "mathstandard" and save changes

Turn editing on and try to edit some topic with some editor plugin...

-------------------

I am not sure what tokens/delimiters you are using for maths, what filters are enabled and so on. Even if you had no math plugin packages you should be able to use mathjax with local files or cdn files if you know the delimiters (for example double dollars, single dollars, plugin package should use by default @i and @d for inline maths and display maths...)  - see http://www.mathjax.org/docs/1.1/options/tex2jax.html and http://www.mathjax.org/docs/1.1/start.html

It is 100% sure that mathjax itself is fully functional on your site - because  http://ods4.schule.de/moodle/lms/lib/MathJax/test/ renders mathjax - and you can also use mathjax without my plugin packages and tinymath editor to render maths - you only need those script tags and some functional delimiters to render maths just the same way as $ $ \alpha $ $ renders here $$\alpha$$ with tex filter.

But if your site does not seem to render maths no matter what setting you choose the problem (reason for possibly broken source/javascript) might be elsewhere - for example in site config.php (saved in wrong file format or with whitespaces + with php end tag at the end). In such cases you should however have also other issues with javascript / editor so most likely the reason for these problems is in some setting. And I simply can't reproduce such issues on my test sites.

Moodle has so many settings that some other kinds of conflicts are also possible - conflicts like http://tracker.moodle.org/browse/MDL-30624 - but I am just guessing here...

EDIT: One more thing - REMOVE your current additional HTML tags from

Site administration > Appearance > Additional HTML > Within HEAD

If you have only the following tags in additional HTML

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

moodle will load the script tags right before </head> but after the settings that mathstandard theme (or extras.php) gives and since default delimiters of cdn mathjax are not the same as your site delimiters nothing is rendered between delimiters given in settings of math filter. If you try doubledollars (for example $ $ \alpha $ $ - no spaces between dollars) and if your tex filter is disabled cdn mathjax should render that alpha using default display math delimiter of cdn mathjax...

In reply to Ralph Ballier

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Ralph,

just in case that you want to try one optional way without math plugin packages you could also check http://moodle.org/mod/forum/discuss.php?d=193064

What ever you choose to use make sure that you are not mixing several configurations, use either theme based scripts or additional HTML but never both at the same time wink (otherwise the latter tags can make former tags non functional). And remember to check the delimiters...

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Hilary Lai -

I really really like the things you brought to this community. Its just marvellous!

I tried your things on ipad 1 and android 2.3.5. My android phone does not work while ipad 1 works flawlessly.

By the way, I posted in another thread asking if it is possible to have JSXGraph 0.93 instead of 0.92 currently in the download. Is it just editing certain php file? I am just a normal user.

In reply to Hilary Lai

Re: Moodle 2.X math plugins

by Hilary Lai -

Found the setting!

Thanx anyway!

In reply to Hilary Lai

Re: Moodle 2.X math plugins

by Hilary Lai -

Hi there,

I find that I always have errors in loading asciimath2jax.js and config.js from MathJax cdn. Any help?

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -

FYI!

MathJax 2.0 beta is now available via CDN at http://cdn.mathjax.org/mathjax/2.0-beta/MathJax.js  See the announcement here: http://groups.google.com/group/mathjax-users/browse_thread/thread/73c6c7ae6eb09e8d  but note that the URL for the beta in the announcement was corrected (use the URL above)  MathJax 2.0 include ASCIIMathML functionality,  which means if you alter your config and eliminate any independent ASCIIMathML installation, MathJax will handle your ASCIIMath.  REMEMBER!!!!! This IS beta software.

Additionally, jsxgraph is now at .93 - while some users have asked for a CDN URL for the latest code, the jsxgraph folk have yet to move in that direction,  but a thread has been started here: http://groups.google.com/group/jsxgraph/browse_thread/thread/348e388bb5fc14f0?hl=en

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Éva Rácz -

Hello Mauno,

I have installed the plugin in mpluga.zip; so far, everything seems to be working fine except the spell check button. After having installed aspell and php5-pspell, spell-checking works as expected with the regular TinyMCE editor (version 3.4.6); however, with TinyMath I only get a pop-up saying that some page has not been found (404). Also, changing the language list in the settings does not have an effect on the dropdown list in the TinyMath editor. Do you have an idea why that might be?

Thanks,
Éva

In reply to Éva Rácz

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Most likely I have forgotten to change the settings that core tinymce is using to settings that the latest tinymce 3.4.9 in tinymath should use.

Ideally all this kind of settings should be made in core editor (like adding new plugins) but it's really a long story why we had to use a different (modified) editor (tinymath) for these plugins. I have also been terribly busy with other things during the past weeks and months so I have had very little time to play with these packages but I will check this spell-checker issue as soon as possible... wink

In reply to Éva Rácz

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

As a first (really quick) check it looks like I had in lib/editor/tinymath/settings.php

    $options = array(
        'PSpell'=>'PSpell',
        'GoogleSpell'=>'Google Spell',
        'PSpellShell'=>'PSpellShell');
    $settings->add(new admin_setting_configselect('editor_tinymce/spellengine',
            get_string('spellengine', 'admin'), '', 'GoogleSpell', $options));
    $settings->add(new admin_setting_configtext('editor_tinymce/spelllanguagelist',
            get_string('spelllanguagelist', 'admin'), '',
            '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,' .
            'Portuguese=pt,Spanish=es,Swedish=sv', PARAM_RAW));

and those settings should of course be taken from tinymath. I have not tested this yet so I am going to make a proper check of all settings during the weekend and upgrade the files on my test server on late Sunday.

In reply to Éva Rácz

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

I had some extra time today so I upgraded the packages ( http://korpelainen.net/mpluga.zip with MathJax 2.0.2 and http://korpelainen.net/mplugb.zip without MathJax 2.0.2 )

Local files of JSXGraph (included to packages) are now in v0.94rc2 and I made changes to 3 files to get spell-checker fully functional in tinymath (settings.php, lib.php and the actual spellchecker plugin config.php to make them use correct settings for tinymath and correct path for rpc.php)

Remember to purge all caches after upgrading the files and click Notifications link (or check the settings of Math filter in Site administration > Plugins > Filters > Manage filters & settings of Tinymath editor in Site administration > Plugins > Text editors > Tinymath ) to make sure that all settings have been upgraded...

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Éva Rácz -

Great smile Thanks, the spellchecker does not throw a 404 anymore, however, the languagelist still could not be changed. By a lucky coincidence, I looked into the code of tinymath lib.php and tinymce lib.php and noticed that the following line was missing from the tinymath version (line 159):
'spellchecker_languages' => get_config('editor_tinymath', 'spelllanguagelist')
After having added this line, the spellchecker seems to be working as expected; no problem with changing the language list.

In reply to Éva Rácz

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Thank You, Éva!

I added that line to both packages (file lib/editor/tinymath/lib.php) and uploaded again the latest files to my test server smile

 

In reply to Mauno Korpelainen

회신: Re: Moodle 2.X math plugins

by Jong-Dae Park -

Hi,

Thanks for your great work.

Recently, I tried to install nanogong for moodle 2.x.

http://moodle.org/mod/forum/discuss.php?d=203460#p893327

I could not make both plugins(mplug and nanogong)  work together.

Thanks.

JD Park

In reply to Jong-Dae Park

Re: 회신: Re: Moodle 2.X math plugins

by Marc Grober -

In the past, the issue with getting nanogong to work with DragMath was simply that both plugins were writing over the htmlArea files that controlled what buttons appeared in the editor.  If you are referencing the plugins developed by Mauno, you likly replaced tinyMCE with what Mauno called tinyMath,  which is simply a cobbled version of tinyMCE. Monsieur Vedrine hopes that changes to Moodle will soon allow transparnt use of plugins,  which would/could render tinyMath moot (by allowing the transparent use of the math plugins without havging to cobble the editor.  In the meantime,  if the issue you re encountering sounds like it is based on interface (as opposed to function) then your best hope is having Mauno identify a kludge for it (it seems thats what I did when this first popped up a handful of years ago.)

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Marc Grober -

Mauno! Good News from Bayreuth if you have nmot seen it yet:

The new release [of jsxgraph version 0.94] should appear soon at the CDN at http://cdnjs.cloudflare.com/ajax/libs/jsxgraph/0.94/jsxgraphcore.js and at http://cdnjs.cloudflare.com/ajax/libs/jsxgraph/latest/jsxgraphcore.js.

This means your Moodle plugins can now finally use a latest directory to a cloud source for both MathJax and jsxgaph.  Sorry the news did not come before you recently updated the plugins, but that is how that cookie crumbles.  As you are undoubtedly in the process of redoing them so as to place them in a  form amenable to the new plugins system and directory evil  it will be easy to tweak this wink

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Enrique Castro -
Picture of Core developers Picture of Particularly helpful Moodlers

Hi,

I have been reviewing the math plugins to use them at ULPGC web site. Everything is working fine but two things:

a) GeoNext
The applet runs, and I can draw, but I do not see how to save/insert image into moodle editor. If I click on "insert image" (after getting new canvas and actually drawing) nothing happens.

b) asciisvg
Again, I get the thing running, an generate an image - I see the graphed function in the editor (and image file is in dataroot/filter/math/) but image is inserted in an embed tag.

In our site trusttext is NOT enabled, so embed tags in a forum post, for instance, are removed. ¿Is there other way to insert the image?

If I enable trusttext I do get an HTML with the tag showed below, but I only see a blank space, not the graph.

¿Any ideas?

 

<embed class="ASplugin" sscr="-7.5,7.5,-5,5,1,1,1,1,1,300,200,func,sin(x),null,0,0,,,black,1,none" style="width: 300px; height: 200px; vertical-align: middle; float: none;" src="http://localhost/moodle22ulpgc/lib/common/d.svg" type="image/svg+xml">
<svg id="root" xml:space="preserve" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http:///www.w3.org/1999/xlink">
</embed>

 

 

In reply to Enrique Castro

Re: Moodle 2.X math plugins

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

I have had a similar problem with the a) Geonext plugin from Mauno. I think this is a Java problem. I can insert Geonext strings using Windows browsers with recent Java upgrade 7.17.  Linux IcedTea does everything, but insert the string into the editor. It throws an error into the firefox console about geonext.Packages.Compressor() not existing. (Browser may be disabling this because of security holes or it may be a more advanced feature). I have a lot of windows machines with old Java on campus that have problems with this plugin. However, when this is working it is a wonderful plugin as well and his newer Geogebra plugin.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Dima Pikulin -

does it can work with other languages, for example with russian? I don't mean the translation but using russian letters in a formula. 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Tania Ramirez -

Hi, I just want to ask, is there somewhere else from where I can download the plugins? Because I can't download them from the links you posted =S

In reply to Tania Ramirez

Re: Moodle 2.X math plugins

by Marc Grober -

The links that are included in the the forum below and in the 2.0 docs is for Mauno's server and is for plugins for 2.0<Moodle<2.4
At some point I had hoped that Mauno would move the files to the old plugin db, and with Moodle 2.4 the replacement of tinyMCE is no longer necessary so I believe he is in the process of repackaging plugins as he posted elsewhere that he has been working and has produced some plugins for 2.4 along the lines of what he had done for <2.4 by providing a drop in replacement for the core tinyMCE.

We probably need a new thread to differentiate among the three versions, and some updated documentation...... 

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Sairam Mukkamala -

Hello  Mauno Korpelainen,

I followed your steps to install the tinymath editor in my moodle and when i opened the editor by making the TinyMath Editor

as My first Preference

TinyMathEditor

 

 I got the editor as follows

 

Tiny Math

 

now, i don't know what to do and please help me to get out from this

Thanks in advance

In reply to Sairam Mukkamala

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

You are trying to use the plugins / Tinymath with moodle 2.4 or later and the package can be used with moodle 2.0 to 2.3.

Switch back to core tinymce ( and disable or uninstall tinymath ) in moodle 2.4+

If you want to use Wiris (commercial) you can download the 2.4 version of Wiris filter and plugin from http://www.wiris.com/en/plugins/moodle/download

Moodle 2.4 has book module as core that should not be overwritten with book from previous versions (included in mpluga.zip) - if you did you can reupload and/or reinstall the files of moodle 2.4 or at least folder mod/book to get core 2.4 book back.

Most tinymath plugins could be rewritten to moodle 2.4 tinymce plugins but I did not get it done on January and have been busy again with other things on February so there is no "complete update package for moodle 2.4+" available yet - sorry.

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Sairam Mukkamala -

Is there any editor for moodle 2.4+  for creating graphs for mathematical quiz and some science quiz's. 

And is it possible with wiris to create a graph for equations.

And if any editors are there please give me the link.

Thank you

In reply to Sairam Mukkamala

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Try JSXGraphs (with GeoNext applet plugin) in moodle 2.4 - see

https://moodle.org/mod/forum/discuss.php?d=218873

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Sairam Mukkamala -

Hello Mauno 

I need a functionality in moodle that 

If a created a course with both start date and end date, and if any user does not made an attempt to that course, i want to send an email to that user like  " You did not come across this course" and to administrator like "this user does not attempt this course" , and this functionality should run before 5 days of the course  end date .

 

Please help me 

Thanks in advance

In reply to Mauno Korpelainen

Re: Moodle 2.X math plugins

by Sairam Mukkamala -

Hello Every one

I need to add some graph to my course in moodle like 

Graph of Trignometric functions like sinx, cosx, tanx etc and

Graph of mathematical functions like logx, $$x^{2}$$+2x, and some other

how can i achieve them please name some editors which can achieve those graphs and i'm using moodle 2.4 version

Thank in advance

In reply to Sairam Mukkamala

Re: Moodle 2.X math plugins

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Geogebra has a new Moodle plugin, might want to look at that, that would be my first guess...

In reply to Colin Fraser

Re: Moodle 2.X math plugins

by abdelkrim samik -

Hi,

thank you for the great job, I've followed Mauno Korpelainen procedure https://moodle.org/mod/forum/discuss.php?d=182627 I'm using moodle 2.5+. So when I edit the text editor (add new course) I don't have any button in the text editor as in the attached picture. please advise to fix this issue.

thanks for your help,

Attachment text-editor.jpg
In reply to abdelkrim samik

Re: Moodle 2.X math plugins

by Colin Fraser -
Picture of Documentation writers Picture of Testers

mmm That looks like Internet Exploder is playing up again. There is a fix for this, but I cannot remember if it has been detailed in v2.x.  From memory, the error was something to do with the compatibility settings or some such. 

The other issue is that the icons for the toolbar are not where they are supposed to be. Have a look at the TinyMCE web site, there is a lot of information about this and other errors that crop up from time to time.

In reply to abdelkrim samik

Re: Moodle 2.X math plugins

by Mauno Korpelainen -

Tinymath plugin package was compatible with moodle 2.0 to 2.3.X

Moodle 2.4+ ... and 2.5+ ... and all the coming versions of moodle use different tinymce plugin integration so you simply can't use that old package with moodle 2.5. There is no moodle 2.4+/2.5+ TinyMath package available - and most likely never will be, sorry.

I did upgrade a couple of those math plugins to 2.4+ versions (see the other posts) like https://moodle.org/mod/forum/discuss.php?d=182627#p967907 and they can be used with core tinymce but I did not find anymore interest to create separate TinyMath-editor packages ( mpluga.zip and mplugb.zip )

If you can't uninstall the plugins or tinymath editor from administration menu (manage text editors) you should be able to simply delete folder lib/editor/tinymath (and other non moodle 2.4+ parts) from server and moodle should use default editor tinymce. If you are trying to use old themes (mathstandard or stylist) with moodle 2.5 those themes may not be at all 2.5 compatible (also themes have gone through lots of major changes) and you could swich back to standard theme or some of core themes. Finally check the (necessary) scripts in Additional HTML (Administration menu) - if you need for example MathJax or JSXGraph.

 

In reply to Mauno Korpelainen

Moodle 2.5 - MathJax and TeX Notation

by Sarah Huibregtse -

Good afternoon. We completed the installation of the files on our Moodle Server and unfortunately the them MathStandard is not available upon completion.

I attempted to use the Within HEAD code but I lose the breadcrumb trail on the entire site if I use that approach.

We need to be able to use MathJax for an instructor that is using TeX Notation for the page content.  Using the DragMath doesn't keep the consistent look for include equations such as "x = 0" within the page/paragraph content.

I'm in need of recommendations and help to make this happen.

Thanks for you suggestions.

Sarah

In reply to Sarah Huibregtse

Re: Moodle 2.5 - MathJax and TeX Notation

by Marc Grober -

1) DragMath does not in any way have anything really to do with the display of TeX (save that in some versions of Moodle you have to have the Moodle TeX filter on in order to use DragMath as it is not visible otherwise.)

2) I am not sure what you mean to convey by, "the them MathStandard is not available upon completion."

3) "I attempted to use Within HEAD code but I lose breadcrumb" tells us nothing about your Moodle version or exactly what you did. The instructions for a late version Moodle is to place the MathJax code, if that is what you are trying to, in AdditionalHTML -> HEAD and if you wish someone to comment it would be helpful to show what is in that location now that you have edited it (just in case you corrupted the HEAD when you edited it?????)

In reply to Marc Grober

Re: Moodle 2.5 - MathJax and TeX Notation

by Sarah Huibregtse -

Thank you very much for the response.  We actually were able to get the "Within Head" code to work and are now able to use the TeX notation to work in the editor

Thanks again for your help.