ASCIIMath editing in quizzes?

ASCIIMath editing in quizzes?

by John Conta -
Number of replies: 10
Hi all,

I installed the ASCII Math editor because I'm using a third-party host, and they won't allow the arbitrary shell_exec() commands to be run on their server required by TEX. At first, I got this working wonderfully with the DragMath editor. I entered the question. Once back to the quiz editing page, I hit the preview icon, and all was well. Unfortunately, when I switched my role to student and took a sample quiz, I was looking at the original, unrendered code.

Can anybody help me out with this? I searched the forums and coun't seemn to find any answers about this.

Thanks in advance,

SJ
Average of ratings: -
In reply to John Conta

Re: ASCIIMath editing in quizzes?

by Marc Grober -
Well, there is a good deal of discussion about this, but I don;t blame you for not being able to find it, and you should be able to find the answer in the docs, as opposed to the forums, for which I take responsibility as I have been putting this off as solutions are at present "fluid" ;=}

Best practice at this time is to invoke asciimathml via meta.php
http://moodle.org/mod/forum/discuss.php?d=103898&parent=458735

Additionally, remember thaty dragmath will produce a number of different types of text expressions. If you are using asciimathml make sure to set this as your export format.

Mauno is having a field day playing with "nextgen" versions and I think you will be very impressed with what he is doing with tinyMCE ......
In reply to Marc Grober

Re: ASCIIMath editing in quizzes?

by John Conta -
Ah, still no go. I'm using the standard theme, updated all variables to include the meta files, and (still) can see the rendered code when I preview the quiz question seperately in the editing window...but not when I take the quiz as a student.

It's also worth mentioning, even though I've installed dragmath, I don't use it. This is just for any expression, like `3` or the like.
In reply to John Conta

Re: ASCIIMath editing in quizzes?

by Mauno Korpelainen -

Hi John,

when you said "I installed the ASCII Math editor" which version is it? HTMLArea, Xinha or TinyMCE? From some site of Peter Jipsen & David Lippman, some one of my test editors or ... and what version of moodle do you have?

I tested quiz with a couple of my test versions and they rendered asciimath ok but one possible reason could be that your editor integration has separate init code for students and teachers - if it is TinyMCE...

After all it is asciimathml.js that makes the translation if it is loaded through theme or filter. If students are using custom themes standard theme meta tags are not always rendered. It might be also possible that something is breaking the source code in student view and firefox or opera (or IE8) error console could give some info about possible cause of failure.

Or Tim might have recently added some new code to quizzes that could filter tags...

I hope I find enough time to finish those Math (asciimath/latexmath/latex/graph/svg/unicode) plugins both for htmlarea (moodle < 2.0) and tinymce (moodle 2.0+) before Christmas. We have already managed to get them working in all modern browsers including successful IE image fallback also without math player or svg viewer and the rest of the job is just testing, creating the language files and modifying the usability of plugins...smile

In reply to Mauno Korpelainen

Re: ASCIIMath editing in quizzes?

by John Conta -
I used whatever version was downloaded on this site. Perhaps it is out of date? Either way, I would really appreciate a link to the working version you mentioned.

Thanks.
In reply to John Conta

Re: ASCIIMath editing in quizzes?

by Marc Grober -
You can test out the attached file (you will need to edit the locations for mimetex etc for the fallback)

But before you replace it check out your current asciimathml.js file and let me know what it says at the top as far as version.

Also, this may have a fallback location for mathtex and you need to change the location to your own

However, I am very puzzled in that while I know the asciimath script has conflicts with quiz.js, I have been able to avoid those by
a) turning off asciimathml as a filter and
b) invoking through the meta.php

Are you sure you turned it off as a filter?

If so, the next step I can recommend is to move the asciimath files to another location so that your moodle won't source it as a filter (Mauno discovered that Moodle will continue to invoke asciimath even when it is turned off as a filter) ...

So, create a lib/editor/common directory and move the asciimath folder into it.... now re-edit the meta.php to point to the new location


In reply to Marc Grober

Re: ASCIIMath editing in quizzes?

by John Conta -
Thar's the trick! Thanks you so much, it's tested and working, in the quiz window.

Now if I can only figure out how to make that square root symbol not bork.
In reply to John Conta

Re: ASCIIMath editing in quizzes?

by Greg Johnson -
By "not bork" do you mean "stretch to properly enclose tall items" as in `sqrt((a/b))?` If you are using Firefox 3, download and install the latest recommended Mozilla MathML fonts, the Stix fonts.
In reply to Greg Johnson

Re: ASCIIMath editing in quizzes?

by Marc Grober -
There are a number of issues we have seen with some characters when it comes to FF 3 and fonts usage. As Greg suggests, MOzilla now recommends installing the STIX fonts. I have both the beta STIX and the previously recommended fonts and problems are rare..... the radical issue usually disappears with the install of the initially recommended fonts, after reboot. Adding the STIX fonts or using just the STIX should resolve most issues for you

But the real issue here of course is display for your students, and there is a continuing debate in mozilla land as to whether things like the STIX fonts should be incorporated in the browser package. I recommend to students that they use FF and do install the STUIX fonts, though unlike the prior fonts, there is no msi for windows users and they have to install the old fashioned windows way from Start->Control Panel->Fonts

As far as the prior issue, though, which step resolved the problem, or to put it another way, did you actually have to move the folder to get asciimath to quit conflicting with with quiz.js? I want to get as much confirmation as I can before including this as a step in the install.

Also, the version I provided should do fallback if you set it up for a mimetex server (if you want to e-mail me I will provide a URL) as well as work with Chrome..... Let me know what other issues you see....
In reply to Marc Grober

Re: ASCIIMath editing in quizzes?

by Chick Beckley -
Marc & Mauno,

I want to acknowledge your efforts and thank you for the great work, development, postings and documentation you provide regarding math tools for Moodle. I've learned a great deal about the topic from your discussions and solved several issues which in turn benefit students directly.

This thread in particular was extremely helpful.

Again, thank you for the great information and discussions you both provide.

- Chick Beckley
In reply to Chick Beckley

Re: ASCIIMath editing in quizzes?

by Marc Grober -
You are most welcome, Chick! Credit for coding all goes to Mauno the Dynamo (who has been working with Peter and David's code to make things moodlishishish.)

BTW, please remember that your common directory (ASD's for example) is open. Technically this means that anyone can use your implementation of the scripts. As with the case with java sketchpad (which I have often installed outside Moodle, but could be installed in /lib/editor/common/jsp, though as was argued some time ago such libraries might have beeter been placed in /lib/common as they are not limited in scope to editors), which is most easily referenced from outside moodledata, this issue should at some point be expressly addressed

Also, no matter what happens with the themes structure, the wrk around using meta.hph can usually be implemented in whatever theme you chose to use. There are a number of themes based options that Mauno has shared over the past 6 months, and as long as asciimathjs is the last js parsed I have seen no issues......

Frankly, I thought it intriguing that staff at ASD hired to implement their Moodle who are located just a few hundred yards from me never contacted me about dragmath, asciimathml or wwmqt themselves...... I guess that just demonstrates that the shortest path between two points never has been a straight line........... In any event I will be sure to let folks know that asciimathml is up as of today.