.\" %sccs.include.proprietary.roff%
.\" @(#)p5 6.2 (Berkeley) %G%
program itself merely interprets scripts. It provides
facilities for the script writer to capture student
responses and their effects, and simplifies the job
of passing control to and recovering control from the student.
This section describes the operation and
usage of the driver program,
required to produce a new script.
Readers only interested in
the existing scripts may skip this section.
The file structure used by
There is one parent directory (named \f2lib\f1\^) containing the script data.
Within this directory are subdirectories, one for each
subject in which a course is available,
and one in which user sub-directories
The subject directory contains master copies of all lessons,
plus any supporting material for that subject.
each lesson is a single text file.
Lessons are usually named systematically;
the file that contains lesson
Figure 2: Directory structure for \fIlearn\fR
L0.1a lessons for files course
is executed, it makes a private directory
portion of the file system.
A fresh copy of all the files used in each lesson
(mostly data for the student to operate upon) is made each
time a student starts a lesson,
so the script writer may assume that everything
is reinitialized each time a lesson is entered.
The student directory is deleted after each session; any permanent records
The script writer must provide certain basic items
the set-up commands to be executed before the user gets control;
the data, if any, which the user is supposed to edit, transform, or otherwise
the evaluating commands to be executed after the user
has finished the lesson, to decide whether the answer is right;
a list of possible successor lessons.
tries to minimize the work
of bookkeeping and installation, so
that most of the effort involved in
script production is in planning lessons,
writing tutorial paragraphs,
and coding tests of student performance.
The basic sequence of events is
creates the working directory.
reads the script for the lesson and processes
The lines in the script are:
(1) commands to the script interpreter
to print something, to create a files,
(2) text to be printed or put in a file;
(3) other lines, which are sent to
the shell to be executed.
One line in each lesson turns control over
The user mode terminates when the user
At this point, the user's work is tested;
a new lesson is selected, and if not
Let us illustrate this with the script
for the second lesson of Figure 1;
this is shown in Figure 3.
Of course, you can print any file with "cat".
In particular, it is common to first use
"ls" to find the name of a file and then "cat"
to print it. Note the difference between
"ls", which tells you the name of the files,
and "cat", which tells you the contents.
One file in the current directory is named for
a President. Print the file, then type "ready".
this file is named roosevelt
and contains three lines of
causes printing of any text that follows,
up to the next line that begins with a sharp.
have the added property that if a lesson is failed,
will not be executed the second time through;
this avoids annoying the student by repeating the preamble
creates a file of the specified name,
and copies any subsequent text up to a
This is used for creating and initializing working files
and reference data for the lessons.
gives control to the student;
each line he or she types is passed to the shell
is terminated when the student types one of
resumes interpretation of the script.
Anything the student types between these
commands is copied onto a file
This lets the script writer interrogate the student's
responses upon regaining control.
Between these commands, any material typed at the student
This lets the script writer interrogate the
effect of what the student typed,
which true believers in the performance theory of learning
prefer to the student's actual input.
Normally the student input and the script commands
command interpreter (the ``shell'') one line at a time. This won't do
if, for example, a sequence of editor commands
since the input to the editor must be handed to the editor,
Accordingly, the material between
continuously through a pipe so that such sequences
There are several commands for setting status
after the student has attempted the lesson.
is an in-line implementation of
which compares two files for identity.
The last line of the student's input
and the success or fail status is set
Extraneous things like the word
are stripped before the comparison is made.
this provides a convenient mechanism for handling multiple
# on subsequent lines after a successful
this is illustrated in Figure 4, another sample lesson.
Figure 4: Another Sample Lesson
What command will move the current line
to the end of the file? Type
"answer COMMAND", where COMMAND is the command.
except that it corresponds to specific failure answers;
this can be used to produce hints for particular wrong answers
that have been anticipated by the script writer.
(as determined by some previous mechanism).
the driver terminates the
and evaluation of the student's work can begin.
This can be done either by
the built-in commands above, such as
or by status returned by normal
should return status true
(0) if the task was done successfully and
false (non-zero) otherwise;
this status return tells the driver
whether or not the student
has successfully passed the lesson.
Performance can be logged:
writes the date, lesson, user name and speed rating, and
a success/failure indication on
by itself writes the logging information
is followed by a few lines, each with a successor
lesson name and an optional speed rating on it.
indicating that unit 25.1a is a suitable follow-on lesson
a speed rating of 10 units,
25.2a for student with speed near 5,
and 25.3a for speed near 2.
Speed ratings are maintained for
each session with a student; the
rating is increased by one each time
the student gets a lesson right and decreased
time the student gets a lesson wrong.
Thus the driver tries to maintain a level such
that the users get 80% right answers.
The maximum rating is limited to 10 and the minimum to 0.
The initial rating is zero unless the student
specifies a different rating when starting
If the student passes a lesson,
a new lesson is selected and the process repeats.
If the student fails, a false status is returned
reverts to the previous lesson and tries
If it can not find another alternative, it skips forward
which causes a graceful exit
system. Hanging up is the usual novice's way out.
The lessons may form an arbitrary directed graph,
although the present program imposes a limitation on cycles in that
it will not present a lesson twice in the
If the student is unable to answer one of the exercises
correctly, the driver searches for a previous lesson
with a set of alternatives as successors
From the previous lesson with alternatives one route was taken
earlier; the program simply tries a different one.
to write sophisticated scripts that evaluate
the student's speed of response, or try to estimate the
elegance of the answer, or provide detailed
analysis of wrong answers.
Lesson writing is so tedious already, however, that most
of these abilities are likely to go unused.
The driver program depends heavily on features
that are not available on many other operating systems.
the ease of manipulating files and directories,
the ability to use the command interpreter
as just another program (even in a pipeline),
command status testing and branching,
the ability to catch signals like interrupts,
the pipeline mechanism itself.
might be transferable to other systems,
some generality will probably be lost.
file comparison was done by creating a
rather than comparing the two files within
Lessons were not stored as text files,
There was no concept of the in-line document;
had to be followed by a file name.
Thus the initialization for each lesson
was to extract the archive into the working directory
The combination of such things made
The new version is about 4 or 5 times faster.
Furthermore, it appears even faster to the user
because in a typical lesson,
the printing of the message comes first,
can be overlapped with the printng,
it is really ready for the user
It is also a great advantage to the script maintainer
that lessons are now just ordinary text files.
They can be edited without any difficulty,
text manipulation tools can be applied
there is much less resistance
to going in and fixing substandard lessons.