Super equation editor (SEE) development

Super equation editor (SEE) development

by Marc Grober -
Number of replies: 46
Mauno,

I created a new thread here for discussion of SEE
Average of ratings: -
In reply to Marc Grober

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

A metadiscussion, Marc ...big grin

The latest mathplugin package is available in http://korpelainen.net/mathplugins.zip (step 2) and instructions should pop up during the next few days.

Todo list grows - next I should

1) write the documentation

and after 2-3 weeks break I am planning to continue with

2) mimetex version: input/output values and some workarounds for mimetex (current version is using some features that work ok with mathtex fallback to Tex Live but are not all supported by mimetex)

3) editable buttons and skins for calculator - different sizes, look and functions for different use. For example some resource for kids might have a calculator with big basic buttons for counting some simple calculations. Can be done with different classes and css.

4) Better image fallback for density/colors/asciimath inside asciisvg - they work rather well with FF and some parts work well in Safari, Chrome and Opera but IE fails almost in everything

5) Configurable variables - current AM.js has list of variables that can be made editable with php (without changing default values in AM.js)

6) More documentation...

I'll be back when I have written some more instructions about installing the plugins, settings and possible commands, syntax, symbols etc

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

And maybe I should add

1.1) create some symbol and example files for tabs for various user groups  - these files can be included to tabs of each plugin and if 10 tabs is not enough it is possible to make "clones" of each plugin and fill toolbar with new plugin buttons...

In reply to Marc Grober

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

And the first instructions are here:

http://korpelainen.net/mediawiki/index.php/How_to_install_TinyMCE_math_plugins_for_moodle

Note also that if you have used the previous version of asciisvg plugin you may need to edit once the old plugin based graphs because latest version of this plugin is adding class="ASplugin" to embed and image tags and renders only those tags that have class="ASplugin" included - plugin can do this but only if you edit the old graphs.

I needed to add this class so that it can be used later when modifications of media plugin are ready - current media plugin of tinymce cuts embed tags (allows only certain object types) and is not included to package and moodle 2.0 has also a separate modification for youtube video embedding...

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hi

I'm trying http://korpelainen.net/mathplugins.zip.
I can insert ASCIISvg graph to TinyMCE editor. But when I click Save button the graph is not shown in View page.
When I click Edit, I can see the graph.
I have set Allow EMBED and OBJECT tags checkbox under Security-->Site Policies
I'm using Firefox 3.5.5.
Login to moodle as Administrator role.

Is this issue relate to http://tracker.moodle.org/browse/MDL-15979 ?
How can I workaround it?

Thanks
In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

I have not upgraded those files for several months but there might be some possible reasons:

- are you using Math theme when you view the page?

(init code of tinymce and paths of scripts for rendering maths and graphs are given there...)

Check that in AM.js script

var AScgiloc = "xxx/svgimg.php";//AsciiSVG fallback
var dsvglocation = "yyy/"; // path to d.svg (blank if same as ASCIIMathML.js loc)

and in tinymce init code

AScgiloc : "<?php echo $CFG->wwwroot ?>/lib/editor/common/php/svgimg.php",
ASdloc : "<?php echo $CFG->wwwroot ?>/lib/editor/common/d.svg",

use the same folders and files and that $imgdir in svgimp.php is writable & readable

and

valid_elements rule set in tinymce init code (added to init code with fullrule.php) should have embed tag with allowed attributes.

This nice plugin originally created by David Lippman and modified by me is basicly working ok but there are some issues with using EMBED tags and saving fallback png files (created by GD library) that should/could be changed to use JSXraph library (SVG/VML) in the future. I have lately made some upgrading to actual AsciiSVG part of that AM.js script too (to use SVG for FF, Safari, Chrome and Opera and always png for IE) but have not included yet these changes to mathplugins.zip or my plugindemo site. I could try to upgrade some files during the coming weeks anyway...

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hi Manuno

Thanks for your reply.
Please ignore this error, I just re-install new moodle 1.9 and apply mathplugins, it is working well now on my Windows XP IIS.
But still other issues in my Linux CentOS apache server,
1. When I open pages that include Asciisvg graph in firefox, it ask "Additional plugins are required to display all the media on this page" Insall Missing Plugins top bar in my browser.
I tested on Firefox 3.5 and 3.0. Both show same message.
But all graph and formula are show correctly and also mouse cursor move on graph show coordinate.

2. When I open pages that include math symbols in IE, I got message in red box
"Only 168.1.108 may use mimetex on this server. Please read www.forkosh.com/mimetex.html and install mimetex.cgi on your own server. Thanks you, John Forkosh"
I rigtclick and check properties of this red box
The address is link to http://192.168.1.108/cgi-bin/mimetex.cgi?%5Cdisplaystyle%5Calpha%5Cbeta
I copy this url and open in mozilla it is changed automatically to
http://192.168.1.108/cgi-bin/mimetex.cgi?\displaystyle\alpha\beta
and show correct symbols.
Then I change all %5C to backslash in url manually and open in IE, it now show correct symbol.

I think at IE %5C is not known as backslash.
But when I try this link to korpelainen sample cgi in IE, it show correct symbol.
http://korpelainen.net/cgi-bin/mimetex.cgi?%5Cdisplaystyle%5Calpha%5Cbeta


Thanks

Zaw
In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

I suppose the first message might be caused by original plugin check code of asciimathml/asciisvg script. Original scripts tested if user has installed Math Player or Adobe SVG viewer (for IE) but that check should not be made for Firefox.

Anyway I have cleaned all plugin tests and future code of my scripts will be using only browser detection - not plugin/ActiveX etc detection - as soon as I find time and motivation to update those files on my demo server. During the past 6 months I have used mostly my local test PC.

This Mimetex issue is caused by changed security settings of Mimetex scripts since July - see for example http://www.ocert.org/advisories/ocert-2009-010.html 

So basicly people should allow rendering of their cgi Mimetex scripts only from the same server they have installed cgi mimetex but it depends on compilation of Mimetex and version of mimetex. If server supports cgi but compilation of mimetex http://www.forkosh.dreamhost.com/source_mimetex.html  is not possible you can as well copy and rename mimetex.exe (from filter/tex) to mimetex.cgi on Windows servers or copy and rename mimetex.linux to mimetex.cgi on Linux servers and use it as cgi script.

Url encoding is normal behaviour http://www.w3schools.com/TAGS/ref_urlencode.asp

and fallback scripts do replace unsafe ASCII characters automatically. In addition to mimetex it is possible to use for example Google Chart API tex or MathTran as image fallback - this AM.js was written to use the cgi MathTex fallback to Tex Live2007 on my test site but different distributions of latex have a little different syntax. The "rewriting of scripts"-process has been going on slowly because I am lazy and this is only a hobby for me but we'll see if I get all rewritten plugin scripts "ready" before moodle 2.0 stable is out...not before Christmas anyway.

If you have difficulties with getting mimetex to work try for example

var AMTcgiloc = "http://chart.apis.google.com/chart?cht=tx&chl=";//Primary fallback

in AM.js (Google Chart API tex is mostly mimetex syntax)

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hi

Could you guide me some point to how to remove missing plugin check?

Mimetex issue is solve by changing it to Mathtex + TexLive 2009.

Another issue appear only in IE, when I try to edit a topic that include math symbol the following javascript error occur:
Line: 5031
Char: 12
Error: Unexpected call to method or property access
Code: 0
URL: http://myserver/moodle/mod/forum/post.php?edit=1

Thanks for your help

In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

Gosh... too many files doing different things...

Check first folder http://korpelainen.net/js

If I remember it correct files AM1.js and AS1.js are doing the same thing as original AM.js with some cleaned code and browser detection - no mathplayer check and no adobe svg player check - so try to use these 2 files instead of one file AM.js.

Check also the default renderers from the beginning of these scripts (AM1.js is set to use google chart api tex although the version AMgoogle.js has some modifications for that.)

I might have changed a little also some file from plugins folders... I should check those files myself

Read also this:

http://moodle.org/mod/forum/discuss.php?d=132202#p578501

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hi
I download AM1.js and AS1.js from http://korpelainen.net/js
And replace my AM.js and ASCIIsvgPI.js.

1. Still appear Missing Plugin in firefox.

2. Still get javascript error Object doesn't support this property or method in IE at
var node = document.createElementNS("http://www.w3.org/1998/Math/MathML",t);

Javascript error occur in both IE 6 and 7.

Any help?
In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -
The problem is that AM.js is used in a couple of places - in theme (meta.php) and in a couple of plugins defined in init code of timnymce (editor1t.php in folder theme/math)

Preview plugin (editor_plugin.js) and asciimath/asciimaths/latexmaths/draglatex etc may all use the old script AM.js when you edit the code in editor with tinymce.

I will try to check all files and plugins during the weekend for different latex renderers.

That error means just that IE can't handle MathML node - but it can be fixed (I already did it in google implementation on my local PC but as I said before I need to find the time to upgrade those files of mathplugins.zip and my demo site...
In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

The quick fix might be to rename your current AM.js to something else and rename file http://korpelainen.net/js/AM3u.js to AM.js.

I am using the same file with different renderers in my mediawiki examples from

 http://korpelainen.net/plugindemo/lib/editor/common/AM3u.js

You can download and modify them as much as you like.

I will send a new package to my demo site when I have checked all my current files and plugins (may take some days or a week)

Original script was trying to use MathPlayer to render MathML but the result was worse (quality) than with good image fallback that can be rendered with latex distributions like TexLive and MathTex and therefore I removed all mathplayer code and non-supported adobe svgviewer code from the latest scripts. Then I made 5 new plugins etc but they are on different sites and I need to collect all code to one place - to my plugin demo site.

The other big change recently was the possible use of Google Chart API (mimetex based) tex as a free renderer for any sites that can't use internal latex but can use Google Chart API and it took my attention for some months (among other interesting things in moodle and elsewhere)... see http://moodle.org/mod/forum/discuss.php?d=133132 for details

And then we started with JSXGraphs and GeoNeXT

http://moodle.org/mod/forum/discuss.php?d=135727

http://moodle.org/mod/forum/discuss.php?d=136075

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

I think this downloading and renaming of http://korpelainen.net/plugindemo/lib/editor/common/AM3u.js

to AM.js should work - just tested on local PC and it did not throw any errors in any mode of IE8 (Quirks-IE7-IE8)

The other part of checking is to rewrite some tags in plugins, init code and combine those settings etc to mathplugins.zip package during the next week.

You should not actually need ASCIIsvgPI.js at all - it is doing the same job as AS1.js or AM.js for asciisvg but I will check also where it was used - maybe it was in plugin...

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hi I solved plugin missing issue according to http://www.carto.net/svg/samples/serverside_svg_php.shtml by editing /etc/mime.types file and restart httpd on my webserver.

I download http://korpelainen.net/js/AM3u.js and replace existing AM.js.
But javascript error still occur in IE when editing.

When I try http://korpelainen.net/plugindemo in my IE by login with test account, I can't even see tinymced editor. Just see plain text editor without toolbar.
May be I'm looking at the wrong place.
http://korpelainen.net/plugindemo/course/modedit.php?update=11&return=1

But when I try your demo site in firefox, I can see toolbar.
Thanks
In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

Note - that plugindemo site is using the old AM.js script and it does not work correct if you have MathPlayer or SVGViewer installed (as odd as it may sound...)

I have not yet upgraded the files there.

Did you refresh your browsers - old files can be in cache on your test site for some time...

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
I think my javascript error is occur because document.createElementNS is not support in IE. It is inlcuded in AM.js.

function createMmlNode(t,frag)
{
var node = document.createElementNS("http://www.w3.org/1998/Math/MathML",t);
if (frag)
node.appendChild(frag);
return node;
}
In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

var isIE = document.createElementNS==null;

was used in the original (Peter's and David's) script to test is browser is IE or not and IE can't use any mathML - it does not support natively mathML

My current scripts (note again - they are not on my non-upgraded plugindemo site) are using

var isIE = !(navigator.oscpu && document.getElementsByClassName);

because Firefox (3) is the only modern browser that can handle MathML relatively well without any extra plugins.

In addition to Firefox also latest Opera, Safari and Chrome can use SVG - the only "modern" browser that does not support SVG is IE although SVG has been a web standard for 8 years - and because majority of people are still using IE we are forced to use image fallbacks. And the main reason for my tests with JSXGraphs is that they are using SVG & VML , both vector graphics and don't need any saving of files to servers - just code - and that way we could solve that painfull image fallback issue with IE.

Just to be sure that the problem is not in your browser (some plugin etc) can you visit http://korpelainen.net/gmoodle and test the editor (tinymce) using google chart api plugin with test course and there test forum (you can only reply to existing posts or add new discussions there with username test and password test) ?

I will upgrade my plugins and files on plugindemo site as soon as possible (during next weekend) but can't do it today (yet)

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hi

I added http://korpelainen.net to Trust site in my IE security option.
Now, I can see toolbar in IE for both
http://korpelainen.net/plugindemo and
http://korpelainen.net/gmoodle in my IE.

When I try http://korpelainen.net/plugindemo and add some math symbol in editor.
The detail steps are:
1. I click Insert Asciimath toolbar icon
2. Select alpha beta and click Insert to Editor
3. It appear `alpha beta` in editor as text, not changing to symbol
4. When I click this text, red box appear around text
5. When I lost focus, javascript error occurs as follow

Line:5033
Char:12
Error: Unexpected call to method or property access.
Code: 0
URL: http://korpelainen.net/plugindem/course/modedit.php?update=3&return=0

But when I try http://korpelainen.net/gmoodle, it is working well.
Should I change to use gmoodle ?

Thanks
In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

When I have upgraded the plugindemo site and mathtex code it will work just as well as the gmoodle demo site code...

The plugindemo site was full of experimental features 6 months ago - and a lot of bugs - but we wanted to test things with Marc Grober and a public demo site was the only way to get some feedback from other users.

This Xmas time is just full of other things that must be done in time - but plugindemo site and mathplugins package *will be fully upgraded* ... if I am lucky (and not too busy) next weekend, otherwise before the end of year anyway.

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hello

Thank a lots for you help.
I'm looking forward your update.

By the way, I enter LaTex expression \Large f(x)=\int_{-\infty}^x e^{-t^2}dt in asciimath.
And I note that "\Large" is not recognize.
I tested it on my local site and also at http://korpelainen.net/plugindemo.
Both have same issue.
But when I test on http://korpelainen.net/gmoodle, it is shown correctly.

I got this LaTex expression from http://www.forkosh.com/mathtex.html Query Box. At there it is shown correctly.
How can I fix demo site to accept such expression?










In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

LatexMathML is using only some selected tags of Latex and parsing them to mathML for Firefox - they are defined in input-output variables LMsymbols & AMsymbols for AsciimathML

Text size is problematic because different distributions of latex may have some (limited) special ways to change font sizes and MathML is using another way (font size itself).

I made some experimental tests with implementing font sizes (like I added color support to google chart api based script) but it is not so easy to use as one might think because fontsizes in notations like $$ x^{^{y^z}} $$ change and all font sizes are relative to default font size.

If you use pure Latex with images or double @:s in AM vs GeM...GeM in the latest scripts to force also Firefox to use Latex fallback you can use the same syntax as your latex renderer can use - or change density (or dpi) in mathtex like this:

http://korpelainen.net/cgi-bin/mathtex.cgi?\density{500}%20f%28x%29=\int\limits_{-\infty}^x%20e^{-t^2}dt gives

http://korpelainen.net/cgi-bin/mathtex.cgi?\density{500}%20f%28x%29=\int\limits_{-\infty}^x%20e^{-t^2}dt

In AMgoogle script I have limited the fontsize to prevent "too large" images but the whole implementation of this feature needs futher testing.

Cmoodle is using mimetex type syntax with Google Chart API tex and plugin demo site is using MathTex with Tex Live 2007 so syntax is simply different - Mimetex has some custom tags and mathtex with all the packages of TexLive has a huge number more symbols to use...

In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

Zaw - I made the first step of upgrading and it would be nice if you could test if you still see some errors messages or SVG viewer/MathPlayer requirements (with IE) on my plugindemo site.

Opera had some problems with ASCIIandgraphformatting(st) and I had to turn setting avoidinnerHTML to true which means that amath...endamath is not currently enabled.

I will try to create the mathplugins package and upgrade the old plugins to use jQuery like Googletex plugin during the next few days but if I am too busy before Christmas the package will be ready and downloadable with current files before Christmas and I can add some other files later.

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

You can select theme Math to use latest TinyMCE and from settings of Administration > Modules > Filters > Math
the renderer scripts and plugins for TinyMCE even if the experimental filter itself can be disabled.

Please remember that these are still very experimental TEST plugins and not ment to be used on production sites - yet. wink

Attachment settings.gif
In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hi

Great!
I tested http://korpelainen.net/plugindemo/ with my IE, all things are working well without any javascript error.
Please inform me when you finish create final update mathplugins package.

Currently, I don't see Administration > Modules > Filters > Math.
Do you mean it will appear only with your latest update?

Thanks

In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

In plugindemo site "teacher Test Test" has very limited capability to change anything - if you download/test the current package and click Notifications (first link in administration menu) or go to your http://yourtestsite/admin/index.php moodle will install filter settings and you can then change settings.

Most likely people will need only 1-3 math plugins but this package has several test versions + I have not added for example those JSXGraph and GeoNext plugis / applets and one idea that might work well with JSXGraphs could be to modify book module to use maths - a Math Book module...

I will send you more info when "step 2" is ready.

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Do you mean I need to download and test the current package in my local moodle site?
Which files do I need to download ?

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by zaw mn -
Hi Mauno

I would like to know is there any tool to draw shape (like microsoft word Insert Shape) e.g. Rectangle, Triangle, Brace.

Thanks
In reply to zaw mn

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

Draw shapes where? Online, offline, in editor,...

If you mean flow charts you could use some flow chart software or PowerPoint or Word offline and select/copy/paste to image editor or save directly/upload diagrams to moodle.

If you need interactive flow charts online you might try different javascripts, java applets etc or vector graphics. But no such easy, cross-browser compatible tools are directly available in moodle itself - Painweb and other online drawing tools might be closest. See for example http://moodle.org/mod/forum/discuss.php?d=128880 

You can do some things even with pure css - for example boxes around spans - or latex... Hopefully we will have more such easy-to-use tools in the future versions of moodle...

In reply to zaw mn

Re: Super equation editor (SEE) development

by zaw mn -
I found the source of issue at AM.js.

function createMmlNode(t,frag) {
if (isIE)
var node = document.createElement("m:"+t);
else
var node = document.createElementNS("http://www.w3.org/1998/Math/MathML",t);
if (frag) node.appendChild(frag);
return node;
}

IE raise error when appendChild if createElement function of node with colon.
I also test with a small javascript script as follows

<script language="JavaScript">
var objt = document.createTextNode("Hello");
var node = document.createElement("m:M");
node.appendChild(objt);
alert(node);
</script>
If colon includes between m and M, IE raise error.
What's wrong with me?

In reply to Marc Grober

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

Marc,

I might be able to do some update to tabs (at least all the basic symbols and most common examples) before next Wednesday but it is also possible that you won't see my comments before 16th of June - I'll be travelling first through Finland a couple of days and then in England a couple of weeks.

Regards,

Mauno

In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by Marc Grober -
LOL-time to put it down and focus on the big trip. Frankly I'd like to see comments from David (as well as SA and Paul et al) and the sky won't fall if you set it aside until July. In the meantime I will see if we might get a dragmath update to address error logs.

Have you spoken with matthieu about any of the recent dev at all?
In reply to Marc Grober

Re: Super equation editor (SEE) development

by Mauno Korpelainen -
No I haven't but Dragmath of moodle 2 (dev) is in folder lib/dragmath - I suppose Petr (skodak) has done the latest upgrading to version 0.7.7
In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by Marc Grober -
I thought that per the tracker items dragmath and asciimath were going to be in /lib/editor/common? I need to go back and review what's what, but as far as I know, HEAD does not include 0.7.7.1 (the rebuilt version which includes the implied multiplication fix that I have provided per the moodle docs)-I don't have access and no one has spoken to me about it all
In reply to Marc Grober

Re: Super equation editor (SEE) development

by Marc Grober -
Mauno,

I knew there was something I didn't see in your Moodle 2 plugin; the graphing calculator app. Didn't we have something like fooplot or gcalc included in the earliest version. I think it important that we make a tool like that available on one of the tabs.

I think it was either based on the asciisvg graphing calculator that David created or the one walter zorn offered.....
In reply to Marc Grober

Re: Super equation editor (SEE) development

by Mauno Korpelainen -
Sure,

I just upgraded David's Asciisvg plugin to moodle 2 version and it works just like in moodle 1.9.

I haven't found yet a good way to render mathJax in actual tinymce content area - one workaround that does work is to use for example iframe tags with external page that renders mathjax inside editor content area and it could be used even with filter without loading the actual javascripts to pages of moodle at all (document inside iframe loads javascripts) but it makes things slower again and editor does not know the height and width of notations in external document so you need to give width and height for each "iframe notation" which is not good... fallback images do work as well but then people need some other renderer in addition to Mathjax anyway... or then we can simply use visible mathjax maths in plugins, pure notations in editor content area and mathjax rendered again on pages.

The most remarkable change in coming files will be user preferences. I have been using lots of my time in testing different theme settings (also with IE6 which is the real pain) because most moodle sites do have customized themes and adding different yui things separately to each custom theme is not reasonable so I created a theme called "stylist" that is very easy to customize (you can change most settings of theme from theme administration), is optimized for most common screen resolutions (graphs should not be wider than 600px) and has different user preferences built in. Users can now toggle editor type from a dropdown list like preset styles or languages and I will add some more user preferences like font family selector during the coming days and send you some more email... wink




Attachment graphs.jpg
In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by Marc Grober -
Maybe thing to do is post issue to mathjax forum. Davide has lots in the fire w mathjax that may not be apparent. I think key to editing math is dragmath as no one wants to edit mathml and you are otherwise using constructor like dragmath or editing text expression.

Truth is that if Davide had an input jax for maxima that would solve the dragmath re-edit issue as moodle math could then becwritten in maxima, lol. But I will ask alex about dragmath status especially as simon was to be working on editability for STACK
In reply to Marc Grober

Re: Super equation editor (SEE) development

by Colin Fraser -
Picture of Documentation writers Picture of Testers
This look all terribly exciting guys!!!!

But... the inevitable bu-u-u-t

Where can I go and learn about how to use this stuff?

How can I make a chart like that?

I am a middle school level maths teacher... and do not aspire to anything higher. So how can I not only learn how to do this, but create a set of lessons where I can get my students to do this kind of thing as well?

Increasingly the emphasis is going to be on not only learning, but demonstrating learning in ways other than the traditional test and quiz and so on. So I suspect I am going to need to be able to generate an environment where kids can write their own equations. I would prefer it a tool in moodle but realistically, that is not going to happen in the short term, nor any time in the near future, so if I can get them writing it in TextPad and showing it in a browser... WOW!!

What a powerful learning tool that is going to be...

In reply to Colin Fraser

Re: Super equation editor (SEE) development

by Mauno Korpelainen -
This moodle 2.0 AsciiSVG plugin is now stable and safe enough for public testing, it can be translated, it is cross browser compatible and can be used either with plain asciisvg script or full asciimathml script that has also asciimathml included. It requires that javascript is enabled like all plugins of editor and when you have dynamic graphs on pages all browsers show them - those that support svg use svg and IE is using php GD library for fallback image graphs that are saved to the same folder as images saved by tex filter.

I will send my test package link directly here on sunday so that you can test those other features as well - and - that but - remember that those other plugins are not yet stable but they are usable anyway.

In the coming weeks I will make some changes to those files and upgrade the changes to the package link (on my test site) and when everything looks stable enough I am going to add links to modules and plugins database to moodle.org

In reply to Colin Fraser

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

Colin & Marc,

package http://korpelainen.net/moodle_A.zip has other current "extra files" included except MathJax 1.0.1a that you may already have in folder lib or you can download it from http://sourceforge.net/projects/mathjax/files/ (without MathJax the package is 20,4 Mb)
Package http://korpelainen.net/moodle_B.zip has all current "extra files" including MathJax 1.0.1a (37,0 Mb)
Both of these packages can be unzipped directly over your current test moodle because they don't overwrite any files of core moodle 2.0 - in zip file root directory is "moodle".
Package http://korpelainen.net/m20t.zip has inside folder "m20t" full moodle 2.0 Preview 4+ (Build: 20100911) and those previous files - you can as well download and unzip all of those files and use this folder as a test moodle (the whole package 63,2 Mb). I have an online test version in http://korpelainen.net/m20t but it is not open for public testing - before all the plugins, new user preferences of themes etc are fully tested.

When you have unzipped/installed any of these packages you should do 2 things - go to administration menu and select theme called "stylist" from  Site administration > Appearance > Themes > Theme selector and enable jsxgraph filter from Site administration > Plugins > Filters > Manage filters if you want to use jsxgraphs with plugin. Once you have selected stylist theme you should have a dropdown menu for selecting editor and logo for your user preferences, style "red" does not use any html background image, any other of styles (green, blue and orange) is selecting a custom background image as well. From theme settings you can change some properties of theme and like usually - many things like font selection are not yet fully implemented but will be there in the coming weeks.

"Tinymath" is tinymce together with math plugins, "tinymce" normal core tinymce and 3rd option "No editor" disables editor from the same drop down menu (no need to visit user profile)

I used green background color on purpose so that you can note some things while testing different math plugins - all those default colors can be changed and I will use a limited amount of preset styles + one custom style from administration menu in the future files. IE6 compatibility should be ready within 2 weeks as well - and *everything* in these files can be improved, they are still far from perfect wink

(... and I almost lost one day of work when cache of moodle 2 caused some unexpected problems with theme css last night... surprise )

Oh - one more thing - I have set requirement to login before people can see asciisvg fallback graphs or fallback images that use tex filter with texviewer script so that those two files can't be used as public external viewers... unless if you want to use them that way (scripts can be changed). So no graphs and maths to front page for now...

In reply to Colin Fraser

Re: Super equation editor (SEE) development

by Mauno Korpelainen -
I believe it can happen in a short term ( relative to our life time... big grin )

As an example of typical usability issues (why I have that green background?) check what happens if theme is using dark backgrounds... Mimetex is grispy and even if it supports a couple of colors default color is black so on black background you will see some white points here and there. If tex filter (or here tex viewer script that uses files of tex filter if executable scripts are executable - tex filter does not need to be enabled) is using png images black images vanish on black background but are relatively good looking on most backgrounds. Mathjax is using font color so if we are using white text on black background we see white maths...

The drawback here is that I have not found any way to render actual mathjax on editor content area so we see mathjax/latex syntax with tokens on editor content area even if it is rendered ok in plugin (iframe) and on pages of moodle with javascript that must be initialized on the same page where mathjax is used. Another thing is that default mathjax is a little small so you need to raise font size or change scripts to get similar font size as other script give.

Buttons in toolbar from left to right: Mathjax plugin (can be used to add normal latex 1,2,5), Mimetex plugin (4), Google chart api tex plugin(3), JSXGraph plugin and AsciiSVG plugin. Dragmath plugin is not visible here because tex filter is not enabled and I suppose there will be a couple of other plugins in the future. By the way - it is possible to modify mathjax plugin to output also unicode characters in tabs... and use unicode characters inside mathjax notations...
Attachment plugins.jpg
In reply to Marc Grober

Re: Super equation editor (SEE) development

by Mauno Korpelainen -
Marc,

I try to remember that dragmath button in the coming files - it is easy to keep it in editor toolbar in lib/editor/tinymath/lib.php but since the core editor has this tex filter based setting I always forget to change it in the optional init code... blush
In reply to Mauno Korpelainen

Re: Super equation editor (SEE) development

by Colin Fraser -
Picture of Documentation writers Picture of Testers
Thanks Mauno, I have downloaded the m20t file and got it up and running in about three or four minutes. No problems and no dramas, it all went nicely except for one thing.

On the server/php checks it went looking for this intl thing and the checks said, "nope, you don't got it". So I went and looked for this intl thing in a PHP site and found it immediately. I then downloaded the zip, unzipped it and lo and behold - it was for Windows... maybe. I can't be sure.. but it did have a couple iof files witht he extn of .h and .c so I am guessing it is an uncompiled C++ file and I have to make it into a *.dll then add the appropriate line to the php.ini file. There is no instructions, well none that I can find, but I have not looked terribly hard. I do not have a C compiler any more and I am pretty sure that "make" is just not going to work in the Windows environment. (I am pretty sure I did not make a mess of the download but what this says about the intellectual arrogance of some parts of the OS community is appalling btw, but let's not go there..)

Perhaps this is something that may need to be looked at at some stage, but it did not look very clever to me.

And the dragmath editor works really well.. so does this mean I have to wean myself off MimeTeX big grin



In reply to Colin Fraser

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

This php intl-thing is some new feature in moodle 2 that may be used for UCA-conformant collation and date/time/number/currency formatting in some scripts. Maybe it is there for php 5.3 ?

I have made some changes to my test files (mainly for themes but also one big webkit bux fix in asciisvg plugin and some minor things to mathjax plugin, it had sitmo fallback as last option if tex filter executables did not work but in the latest files you are already able to select final image fallback address from editor settings) and I could upgrade those packages again on next Sunday. You can upgrade files then by overwriting old files with new ones and cleaning theme cache from theme selector.

One interesting test was to add a separate popup window for user preferences and if javascript is enabled this panel can be very exciting - we can allow users have many customized settings for their own learning environment - and the original idea that I had a couple of years ago about different kids learning environment with customized plugins is now really possible to create and control. This current theme system is a little slow in theme designer mode but the flexibility rocks!

I will try to fill some of those empty tabs of plugins during the next 2-3 days and collect the files for the second package on Sunday.

Attachment popup.jpg
In reply to Colin Fraser

Re: Super equation editor (SEE) development

by Mauno Korpelainen -

Second round upgraded... and the same packages downloadable http://korpelainen.net/moodle_A.zip (without MathJax and moodle), http://korpelainen.net/moodle_B.zip (with mathJax but without moodle) and http://korpelainen.net/m20t.zip (all my files + MathJax + moodle version 2.0 Preview 4+ (Build: 20100919) )

Like before you can unzip the files over existing ones, no core files get overwritten.

I added some content to tabs of Mathjax plugin and these tabs are editable from Site administration > Plugins > Text editors > tinymath HTML editor so now you can add any custom equations or symbols to 9 of 11 existing tabs - tab 2 is reserved to Dragmath and tab 1 is info tab. There is only one problem if you upgrade - tab 1 was there already in previous package so it already has some content but you can change your info tab content to anything you like from site administration menu.

Default format of Insert button can be problematic too - by default it adds image tags that use executable binaries of tex filter if they are executable and paths in tex filter configuration are correct - otherwise images should use given image fallback address (can be changed from administration menu). On the other hand if tex filter tags are selected, tex filter should be functional. And if Notations are selected people need to manually add tokens (in my configuration @i.s or @d:s )

This should be made easier - for example with a new editor setting that can be used to select tokens and these MathJax could be used everywhere (in scripts and plugins)

Anyway - new files coming again after a week (next Sunday) - hopefully with finished themes (changing logos changes now some basic styles but most of planned features of coming moodle 2 themes are not yet implemented...) - and some new code for plugins...

Upgrade

Example 1

Example 2

In reply to Colin Fraser

Re: Super equation editor (SEE) development

by Mauno Korpelainen -
Colin,

I was testing today the same files with the latest CVS moodle 2.0 and noticed that something is not working as it should - javascripts for user preference window did not read variables like they should...either caused by some recent change in cvs or some recent change in my files... surprise

So - if the latest files do not change user preferences it's not your fault... I will check the reason and if necessary upgrade the files as soon as possible.

EDIT: Sorted, I was just trying to use cvs moodle without MathJax files and layout files had script tags for mathJax that had variables for user preferences inside. Now when MathJax did not exist those variables for user preferences were not read either... blush

In reply to Marc Grober

Re: Super equation editor (SEE) development

by Mauno Korpelainen -
In fact I managed to "improve" that plugin by David a little and it is now using tex filter pix.php to render also asciisvg graph fallback images to moodledata subfolder filter/tex which has two benefits - it's safer and now fallback images are cached by tex filter files. When you create plugin images with GD for the first time it takes a second or two but once they are ready in cache moodle just reads the images (for IE). Firefox renders normal SVG images like before and once we have IE9 we will need fallback images only for legacy browsers IE6-8.

I am busy now with other things two days (daily job...) but I will send you the new upgraded files on Sunday (our time)