Hello mana,

Here is the setup I use both on my local test install (Moodle 2.5 dev branch) and on my production server (Moodle 2.4.1).

I know I should not run formulas on my production server, but:

- I like living dangerously
- I am prepared to deal with problems when they appear
- My students help me to find the bugs
- It was interesting to build new formulas questions about probability (this is the subject of my courses this semester)

For all TeX and Asciimathml stuff I use MathJax. I find mimetex awfull;

But as I also want to use ASCIIsvg, and mathjax is currently not processing it, I can't get rid of the asciimath script.

I also use jsxgraph

So here si what is in my head additionnal HTML:

<script type="text/javascript" src="http://mywebsite/lib/asciimath/AM.js"></script>

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

<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jsxgraph/0.94/jsxgraphcore.js"></script>

<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jsxgraph/0.94/GeonextReader.min.js"></script>

<link rel="stylesheet" type="text/css" href="http://mywebsite/lib/jsxgraph/distrib/jsxgraph.css" media="screen" />

<script type="text/javascript">

var AScgiloc = "http://mywebsite/lib/asciimath/php/svgimg.php";

var ASdloc ="http://mywebsite/lib/asciimath/d.svg";

var dsvglocation = "http://mywebsite/lib/asciimath/";

</script>

With this setup to make asciisvg create a drawing, I insert for instance:

<embed type="image/svg+xml" src="http://mywebsite/lib/asciimath/d.svg" script="

initPicture(-6,6,-6,6);

a = [-1,0];

b = [-3,0.5];

c = [3,0.5];

d = [2,-5];

text(a,"{tc}",belowright);

text(b,"{t}",above);

text(c,"x",above);

text(d,"{u}",above);

stroke = "red" ;

circle([-2,0],3.5);

stroke = "blue" ;

rect([-5.8,-5],[5.8,5],null,.5,1);

stroke = "purple" ;

circle([2,0],3.5);

" class="ASCIIsvg" height="200" width="200" />

And when {tc}, {c} and {u} have values randomized by formulas I get a little diagram like: