Mar 19, 2007

Converting test questions with HTML symbols into Moodle

My latest "little" project (Thanks Todd Thibault & David Barbour) has been an effort to convert existing SkillsUSA tests into Moodle categories. It turns out NC SkillsUSA is interested in using online testing in their upcoming state competition so, David asked Todd & I to create a Moodle Server.

Next thing I know, we grabbed a couple of old servers from my friends at QTL and spent a few days getting Fedora & Moodle to install on these old Dell PowerEdge servers. Not a small feat, mind you, but doable. (In retrospect I probably should have just installed CentOS to avoid some of the installation problems, but, you live and learn.)

Anyway, it's time now to start entering in the questions. Now, I've done thousands of questions and put them all into Moodle using GIFT format. It's not all that difficult, you simply write the question, put an open bracket, then list the answer choices using ~ for incorrect answers and = for the correct answer. I've even embedded HTML in my GIFT questions so that I can insert images using the <blockquote> tag.

So, I'm thinking "this should not be a problem for me", and then I open the first test I need to convert and I see a question like the following (the answers have been hidden to protect the innocent):
Well now, there is something I hadn't seen... I had never come across the need to embed special symbols like (µ) into a question before. So, a little Googling brought me to the HTML Symbol Chart. It turns out that µ = &181; I had no idea that special symbols could be put into plain old HTML code. I guess you do learn something new every day. :-)

Oh, and for those interested... the question above was converted to GIFT format as:
What is the voltage across the resistor in the circuit? <blockquote><img style="border: 0px solid;" title="pic" src="pic.png"></blockquote>{
~ ** &\#181;V
~ *** &\#181;V
~ * mV
~ ** V}
Note that the image (pic.png) is put into a <blockquote> to allow it to stand out from the question slightly. Also notice that the HTML symbol is encoded as µ but has to be put into GIFT as &\#181; since # is a GIFT control character for feedback.

No comments: