1 Some of the classes I TA use [Maple][]. (Caveat: I prefer [[Python]],
2 as a more general language. Use [[SymPy]] or [Sage][] if you need
3 symbolic processing.) Anyhow, I get Maple worksheets to grade.
4 [[SSH]]ing into the department computer lab to fire up `xmaple` is a
5 pain, so I wrote [[mw2txt.py]] to extract the Maple commands from the
6 worksheet. It benefits from the fact that worksheets are fairly clean
7 XML. Graphs and equations are more difficult, since they have
8 complicated layout and are stored as encoded blobs. Other than that,
9 things work pretty well. Here's the output from my [[example.mw]]
10 example worksheet, picking out the math-mode sections (in red) and
11 unprocessed blocks (in yellow) from the comments (uncolored).
13 <pre><code>$ mw2txt.py --color example.mw
15 <span style="color: red">> restart;
16 > interface(prettyprint=0):
17 > 1;#</span> one <span style="color: red">+</span> plus <span style="color: red">2</span> two <span style="color: red">;</span>
19 <span style="color: red">> 3 + 4;</span> bold
21 <span style="color: yellow">Equation</span>
24 [Maple]: http://www.maplesoft.com/products/maple/
25 [Sage]: http://www.sagemath.org/