Fall '97 Exercises
These exercises extend or modify the Mite authoring system being developed in class this quarter.
The base code is in mite.lisp. Examples of Mite defintions for the Sickle Cell Counsellor goal-based scenario are in scc.objects and scc.rules.
When authors are debugging a set of rules, they usually have a script of student actions to run.
Define (run-script actions) to take a list of actions. It should intialize the scenario and execute the actions in the script.
Define (pprint-object object) to take an object form, e.g., (object test-tube (capacity 6) (contents blood)), in some readable way, e.g.,
test-tube -- an object capacity = 6 contents = blood
Note that pprint-object does not take an object name, though if you want to handle that, you can.
Relevant readings: Graham, Chapter 7 and the glossary, pages 379-384.
Right now, authors have to write calls to add-rule and add-object to define their scenarios, as in scc.lisp. This is tedious and unnecessary.
Define (load-objects filename) and (load-rules filename) to load, respectively, a file of objects, such as scc.objects, and a file of rules, such as scc.rules.
To do this, first define (map-file function filename). It should repeated call read to get forms from the file and pass those forms to function. load-objects and load-rules become trivial when this is defined.
map-file needs to handle end of file in a general way and not assume, for example, that only lists or non-NIL atoms will be read.
Relevant readings: Graham, Chapter 7
A "scenario" in goal-based scenarios means a situation. Each scenario is a different situation for the student to deal with. A scenario is usually defined by some set of objects and their initial properties. We will assume for now that the rules are constant across scenarios.
Right now, authors have to use different files to define different scenarios. Unfortunately if scenarios share a lot of objects, then the information about those objects will have to be copied from file to file. That's both tedious and hard to maintain.
For example, all Sickle Cell Counsellor scenarios will have patients, test tubes, syringes, eyedroppers, microscopes, and so on. The only difference between scenarios in SCC is how many sickle cell genes the husband and wife have.
What we need is to extend the Mite authoring language to include:
(scenario scenario-name object-form1 object-form2 ...)
(scenario john-mary (husband john (num-scc-genes 2)) (wife mary (num-scc-genes 0)) )
In an objects file, such as scc.objects, we'll call objects nested in scenario forms scenario objects, and objects not nested global objects.
Change start-lab -- and whatever else needs changing -- so that (start-lab scenario-name) loads all the global objects and any objects defined for scenario-name, but not any objects defined for other scenarios. scenario-name should be optional. If no scenario name is given, no scenario objects should be loaded.