OnlineTester: An Arcane Adventure. Part 1: The Environment
See definition of arcane, if you're curious...
The prototype is done and appreciated, now it's time for blogging about it.The application is intended to be used (next week :-) for administering a test (online, who'd've guessed) to students of a nearby high-school.
The main use cases for the application are:
- As a teacher I want to develop a test with a set of yes/no/don't know answers, which my pupils can work on at their PCs in the computer lab. Each correct answer is worth an adjustable amount of points, a wrong answer is worth zero points. The total scores shall be presented in a compact list for further use. The individual answers shall be stored on disk in an accessible format.
- As a student I want to view each exercise on a dedicated page and select my choice by clicking on it.
I'm not done with all of this yet, but the (for me) hardest parts are finished, which coincidentally are probably the ones that are of most public interest in this forum here. The rest is "just some arithmetic and filing".
A partial screenshot of the demo system:

Toolset
- GNU Smalltalk (git HEAD)
- Iliad (svn trunk)
- jQuery (current stable)
- gvim (current stable)
Many thanks to Paolo Bonzini, Nicolas Petton and Joachim Jäckel for smart answers to stupid questions, often even before I asked them.
Directory layout
Developing a Smalltalk application with code stored in files: "How quaint" (Kent Beck, IIRC). Files live in directories and here is what I came up with this time. Note that this is practically all of the files (excluding the contents of the jQuery smoothness UI theme, which I did not touch in any way).
Distribution package
The folder "dist" contains symbolic links to the components of the app. It's sole purpose is to "define" the contents of a zip file that can be built (make dist) and sent to the client.
d dist/ l doc -> ../doc l Iliad-Core.star -> ~/.st/Iliad-Core.star l Iliad-More-Examples.star -> ~/.st/Iliad-More-Examples.star l Iliad-More-Magritte.star -> ~/.st/Iliad-More-Magritte.star l Iliad-More.star -> ~/.st/Iliad-More.star l Iliad-More-Widgets.star -> ~/.st/Iliad-More-Widgets.star l Iliad.star -> ~/.st/Iliad.star l Iliad-Swazoo.star -> ~/.st/Iliad-Swazoo.star l OnlineTester.star -> ../OnlineTester.star l public -> ../public - 356 start_app
The only "real" file in dist is a small shell script for starting the application with a minimum amount of configurability on the deployment site.
#!/bin/sh
SERVERPORT=12345
gst-load -ivI ot.im OnlineTester
gst-remote --port=${SERVERPORT} --daemon -I ot.im
sleep 2
gst-remote --port=${SERVERPORT} --eval="Iliad.FileHandler filePath: 'public'"
gst-remote --port=${SERVERPORT} --eval="OnlineTester.OTTest fileIn: 'doc/einTest.st'"
gst-remote --port=${SERVERPORT} --eval="Iliad.SwazooIliad startOn: 4080"Prepare a preloaded image, use "public" instead of "Public" as public folder, file in a test definition for demonstration purposes, start the web application on port 4080.
Static resources
What's in the public folder? The usual: CSS stylesheets, image files, javascript files.
d public/ d css/ - 596 ot.css d smoothness/ d img/ - 3951 ajax_loader.gif - 429 bild1.png d js/ - 3179 iliad.js - 57254 jquery-1.3.2.min.js - 192628 jquery-ui-1.7.2.custom.min.js
I admit to hacking iliad.js to use my short folder names.
Other infrastructure
The remaining "boring" files are
- 722 Makefile - 1603 package.st - 2073 package.xml - 120036 OnlineTester.star - 6169528 ot.im
I won't show the Makefile, it's just a hack for killing, rebuilding and restarting the server. The .star and .im files are what you'd expect them to be, shown only to give an indication of the file sizes. That leaves us the package files. I blogged about my quest for DRY package descriptions already, so I'll just show you the contents of package.st, from which package.xml is generated. I'm skipping over the list of smoothness files again.
PackageBuilder new name: 'OnlineTester'; namespace: 'OnlineTester'; prereq: 'Iliad'; filein: 'models/OTFrage.st'; filein: 'models/OTInfo.st'; filein: 'models/OTAufgabe.st'; filein: 'models/OTTest.st'; filein: 'widgets/OTFrageWidget.st'; filein: 'widgets/OTAufgabeWidget.st'; filein: 'widgets/OTTestWidget.st'; filein: 'widgets/OTRegisterWidget.st'; filein: 'application.st'; file: 'doc/einTest.st'; file: 'public/img/bild1.png'; file: 'public/js/jquery-1.3.2.min.js'; file: 'public/js/jquery-ui-1.7.2.custom.min.js'; file: 'public/js/iliad.js'; file: 'public/css/ot.css'; file: 'public/css/smoothness/... ... buildXml
Note to self: If you're cutting stuff out for the sake of brevity, the description needs to be refined.
I'll talk about the really interesting part in the next posting, which I have yet to write.
