View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Another Group: Milestone 7

The goal was to add 5 new, complex tasks to our Guide, account for idiosyncratic users, and add free-form text searching of topics. For the complete specs, see Fall 2003 M7: Expand your Guide's functionality.

Our Approach:
We divided the demonstration scripts for the 5 new tasks among all 3 of us. For the demonstration checks, we added a new post-condition Squeak block of code to each step in a task. The block returned true if the step was completed, based on the current state of the Morphic environment. Each step in a topic also kept a list of its dependencies on previous steps. When we demonstrated a step, we first iterated through the dependencies, chaining if necessary, and used the post-condition checks to verify that each dependent step had been executed. We solved the parallel Scheduler animation problem by having the DemonstrationEngine methods wait until an animation was complete before returning; see the code snippet below.

Design Notes:
Again, we added a few methods to the Avatar, TopicStep, Guide, and DemonstrationEngine, but no major changes. We also removed methods that weren't being used. Our design turned out to be flexible enough to handle the changes necessary for the dependencies, without a major overhaul.

Despite our planning, this milestone required an all-nighter, mostly in an attempt to fix all the little bugs and make some minor improvements here and there. The key to solving the dependencies between steps came from a previous group's case page, which provided us with the code snippet below. Another problem that showed up was getting a Workspace to execute the correct line of code; the problem here turned out to be with Squeak itself. Looking back, we underestimated the work that needed to be done for this milestone and having Thanksgiving Break in the middle certainly didn't help; if you'd prefer avoiding an all-nighter (who would ever want to avoid that!), start early on the last milestone.

Code Snippets:
We had three major problems for this milestone. The first was getting a method to not return until all animations were done. We found this snippet of code from a previous case page that did just that, without stalling Squeak:

[(((wonderland) getScheduler) getAnimations) isEmpty not] whileTrue:
    [(Delay forMilliseconds: 10) wait.
    Processor yield.
    World doOneCycle].

The next one was getting a PluggableTextMorph to execute the right line in a Workspace with multiple lines of code. The key here was making the selection in the PluggableTextMorph, not the ParagraphEditor (where pTextMorph is a PluggableTextMorph):

tMorph _ (((pTextMorph submorphs select: [:morph | morph class = TransformMorph]) at: 1)
    submorphs select: [:morph | morph class = TextMorphForEditView]) at: 1.
pTextMorph setSelection: (start to: tMorph editor text size).
pTextMorph doIt.

Finally, one of the tasks was to show the use of "halt". The problem we had was that executing "halt" in a Workspace caused our scripts to halt. The solution was to call our demo script in a separate process:

process _ [self debuggerDemo] newProcess.
process resume.

Bunny showing the first step of a topic.

Uploaded Image: m7-image1.gif

Downloads: code, MDLs, documentation, and XML tasks

Links to this Page