Saturday, July 24, 2010

Technical Details

Here are some of the basic issues I encountered with implementing math tools in a Wiki.

First, both of the tools discussed here require files to be loaded (once) onto the Wiki server. In Wikispaces, this seems to be most easily accomplished by going to the Manage Wiki page (available through the nav-bar on the left of the screen) and going to Files. That lists the files that various users have stored for the Wiki (like images and so forth), and lets you upload individual files from your computer.

As far as I can tell, if you need to reference the file or its location, then mywikiname.wikispaces.com/file/view/foo.bar works as a directory/url. And you do need to use this for both of these tools.

AsciiMathML:

The main thing here is that each individual page in the Wiki has to load the javascript that creates the MathML, and should do it before the actual equations kick in. There's still a detail I need to work out here about making this happen automatically when a student creates a new page. There seem to be some options for setting the style/format of the Wiki that will let me do this. The worst case scenario would be that every time a page is created, students need to embed a little widget at the top of the page that loads the script. This would be the sort of thing that kids would forget to do, or put in incorrectly, and I'd constantly have to check any new pages and fix this if needed. For Demo purposes, I just put in a widget right at the top and it seems to work fine.

For the widget, you can basically copy the code from the AsciiMathML page, but be sure to put the directory path to the actual Wiki copy (see above).

The actual Ascii to MathML conversion works, but is more finicky than I would like. There seems to be a decision between using auto-math recognition mode or a more formal grammar. The auto-math lets the kids type things in more or less the way the might in their calculator, and is the one I lean toward. That "more or less" is the trick -- its a little bit finicky, and will take some real getting used to. It looks to me like I'm going to need to provide a page of examples and tips if I'm going to use it, and even then I suspect there are going to be a lot of kids who don't really get the hang of it. Kids who are good at using it should probably be commissioned to debug equations on the fly.

Anyway, the implementation isn't too bad here. The real problem is display issues with MathML, which only seems to work well in Firefox and Opera, and not at all in Safari.

Java Sketchpad

You start by creating a sketch in GSP. Include whatever labels and so on you want, and resize your window to whatever size you actually want the thing to be as an applet. Once you get the sketch and layout the way you want it, do Save As and save it as a java sketchpad document. Note that there are some features of GSP that are not implemented in JSP, and the Sketchpad folks provide a page that lists those features and suggests some work-arounds.

When you "Save As" a Java Sketch from GSP, what you create is an HTML file with an embedded java applet. Getting it into your Wiki requires a couple of things. First of all, you need to upload the .jar file jsp5.jar into the Wiki. You only need to do it once. Next, you need to open up the HTML file that GSP created in a tab in your browser and open up its source code (under Firefox, that's View - Page Source or Ctrl-U). Now, the stuff that begins with < applet > and ends with < /applet > is the part you want. Create an HTML widget in your Wiki and paste this in.

There are at least a couple of things you need to edit in this code, unfortunately. The most important is where it says < codebase="." > you need to change it to < codebase="./file/view" > . This tells the applet where the .jar file is, and it won't load without it. The other thing you need to change is the "align = center". Apparently the actual alignment is called "middle" not "center", and even though browsers will interpret it correctly as is, the Wiki won't let you save malformed HTML. You should probably either change it to "align = middle" or "align = none".

No comments:

Post a Comment