Table of Contents

Project Preliminaries

Purpose and Scope of the Project

This project involves the design and implementation of a simple, computerized Student Scheduling Assistant to aid undergraduate students in selecting their courses.

Business Context

An undergraduate student at the University of Toronto has to solve a difficult constraint and scheduling problem every time she or he registers for courses. Constraints arise from the prerequisites that exist for some courses (e.g. a student must take CSC340H before they can take CSC408H). Scheduling difficulties arise because the lecture/tutorial times for two courses may overlap, making it impossible (we assume) to legally take both courses.

Definitions and Terms

Course Key The course key is an identifier for a course. The 9-character course key has the form DDDNNNLCW where

The course key is the unique identifier for all courses in the course data base; course keys are never recycled. A course is either not given or is given exactly once in any par ticular session or year, this guarantees that there are no duplicate course keys in the course data base.

Prerequisite Key A prerequisite course key is a 7-character prefix of a course key. It has the form DDDNNNL (as defined above). This indicates that the session and campus where the student takes the course are irrelevant to determining whether the prerequisite has been satisfied.

Course Data Base The course data base contains the describes all of the courses that are available for a student to enroll in. The course data base describes the courses for some period of time. (typically the Fall and Winter sessions).

Course Description A description of a course in the course data base includes (at least): a) a 9-character course key. (e.g. CSC408H1F ) b) the official name for the course (e.g. "Software Engineering") c) a list of the days and times for lectures in the course (e.g. Monday 11-12, Wednesday 11-12). There may be several lectures a week for a given course. d) a list of the days and times for the tutorials in the course (e.g. Friday 11-12). There may be more than one tutorial a week for a given course (e.g for a foreign language course). e) a list of Prerequisites for the course. Prerequisites are described as a list of prerequisite course keys. A student must have taken ALL of the prerequisites BEFORE they can legally take this course. The representation of the Course Data Base is a matter of design to be determined by each implementation.

Student's Data Base A student data bases is an individual student's record of the courses he or she has taken (the Taken List) and the courses that she or he wishes to take (the Want List).

Taken List A list of course keys for the courses that the student has taken.

Want List A list of course keys for the courses that the student wants to take in the next academic year. The representation of a students personal data base is a matter of design to be determined by each implementation.

System Services

How the System is Used

The actors involved in the system are as followed: As the student enters the Want List, the Scheduling Assistant verifies that each course entered does not have a scheduling conflict with courses already in the Want List and that all prerequisites have been satisfied by courses listed in the Taken and Want Lists.

Functional Requirements

User Class: User

The commands described in this section are available in admin and student modes. In Admin Mode the data base is the course data base, in student mode the data base is the student's personal data base.
SAVE
Save the current state of the data base on disk. It should be possible for the user to specify an alternative disk file, but the current database is not changed!
LOAD
Load a data base from a disk file. It should be possible for the user to specify an alternative disk file. This is initiated after each program start. If changes have been made since the last SAVE operation, the user should be queried if the current contents should be saved before loading an other file.
COURSE
List a course. The user supplies a course key. The course description for that course from the Course Data Base is displayed on standard output in some concise format.
LIST
List the Course Data Base. A list of the courses in the course data base is displayed on standard output in some concise format.
QUIT
Exit the program. If changes have been made since the last SAVE operation, the user should be queried if the current contents should be saved before exiting.

User Class: Admin

The system provides the following facilities for manipulating the Course Data Base.
ADD
Add a Course to the Course Data Base. The user supplies the Course Description as defined above. This course is added to the Course data Base.
DELETE
Delete a course from the Course Data Base. The user supplies a course key. That course is removed from the course data base.

User Class: Student

The system provides the following facilities for an individual student to manipulate their personal student data base.
SHOW
Display the student's taken and want lists. A list of the contents of the student's Taken List and Want List is displayed on standard output.
WANT
Add course to Want List The user supplies a course key. That course is added to the student's want list. The system checks that the prerequisites for the course being added have been satisfied and that the schedule for the courses does not conflict with other courses on the Want List. Prerequisites may be satisfied by courses on the Taken list or by courses previously entered in the Want List.
If the check fails, then the command should be a no-op, i.e. nothing gets added.
UNWANT
Remove course from Want List The user supplies a course key. That course is removed from the student's want list. The system should check that removal of this course does not invalidate the prerequisites of any course on the Want list.
TAKEN
Add course to Taken List. The user supplies a course key. That course is added to the student's list of courses that have been taken.
UNTAKEN
Remove course from the Taken List The user supplies a course key. That course is removed from the student's Taken List.

Defaults and Errors

The Student Scheduling Assistant software should implement reasonable default actions in order to provide a convenient and simple interface to its users. For example, automatic creation of a data base if one does not exist when the program is invoked. Default names for data base files if none are provided by the user. The software should check for illogical and ill-defined actions and emit warning and error messages as appropriate. For example, adding something that already exists or removing something that isn't there.

System Constraints

Interface Requirements

The internal representation of the Course Data Base and the Student Data Base (taken and want lists) is to be determined by each implementation. Each of these data bases should be able to be specified as a name within the Unix file system name space. The interpretation of this name (i.e. as a directory or a file) is par t of the design of each implementation.
The default name for the Course Data Base is CoursesDB. The default name for the Student Data Base is MyCoursesDB.
The default location for these data bases is the directory in which the program is executed.

The executable program for the Student Scheduling Assistant will be named ssa. The program will be invoked as

ssa [ options ]

Where the options are optional flags that modify the behavior of the program. All implementations should support the options listed below. Other options (i.e. non-standard options) may be provided by an implementation.

-A
Operate in admin mode for updating the course database. Unless this option is specified, the program operates in student mode.
-B dbname
Specify an alternative name/location for the Course Data Base.
-F dbname
Specify an alternative name/location for the student's personal data base.
-D integer
Activate extra debugging activity/output. The integer is an optional parameter and may be omitted. The interpretation of this option is implementation dependent.
-V
Be more verbose and detailed in the error messages and instructions presented to the user.
The interpretation of this option is implementation dependent.

The program will (unless redirected) take its input from Unix standard input and produce its output on Unix standard output. Error messages for users should appear on standard output. Error messages indicating internal or operational problems should appear on Unix standard error.

Data Formats

Case Insensitivity

In general the text material that appears as input to the software is case insensitive, i.e. it may be entered in upper case or lower case or any combination of upper and lower case. This applies for example to days, commands, courseKeys, prerequisite keys. Case insensitivity does not apply to text in situations where case is significant for external reasons (e.g. dbnames). White space consists of one or more space or tab characters. Optional white space consists of zero or more space or tab characters. In general lists consist of items separated by commas. Optional white space may occur before and/or after each comma.

Day and Time

Time is represented using a 24-hour clock. The values for times run from 00:00 to 23:59. The minutes part and the preceeding colon can be omitted (.e.g. 15 means 15:00). The time for a lecture or tutorial is given as a time range consisting of a star t time optional white space, a hyphen, optional white space and an end time.
Examples: 11 - 12 11:00 -12:00

Days are represented be their ordinary English names (e.g. Monday, Tuesday, Wednesday ) or by any unique prefix of these names (e.g. Monday could be Mon or Mo or M). We resolve the ambiguity that this convention introduces by defining T as the name for Tuesday and allowing R as a 1-character name for Thursday. Saturday and Sunday (which occur rarely) do not have single character names. Days and times in a list of lecture or tutorial times are represented as dayname whitespace time range.
Examples Mon 11-12 R 10 -10:30

A lectureList or tutorialList consists of a comma separated list of lecture or tutorial times.
For example M 11-12,W 11-12 Mon 11 - 12 , Wed 11:00-12:00

Course and Prerequisite Keys

The format for the 9-character course key ( DDDNNNLCW ) and the 7-character prerequisite key ( DDDNNNL ) have been defined in the original software handout. The prerequisite list used in the ADDPRE command (see below) is a list of prerequisite keys separated by commas.
For example csc340h , csc378h

Command Format and Arguments

In this section we specify the exact form of the arguments to the various commands. The dbname is an optional argument. If it is omitted, the current course or student data base is used other wise dbname becomes the new current data base. The ADD command is described in the following section.

Command Argument Command Argument Command Argument
COURSE coursekey QUIT UNTAKEN coursekey
DELETE coursekey SAVE dbname UNWANT coursekey
LIST SHOW WANT coursekey
LOAD dbname TAKEN coursekey

ADD Command

The ADD command is a special complicated case since it has to provide all of the information required to completely specify a course description.
To simplify the preparation of input for the program and to allow easier testing of the program, the ADD command is hereby split into four independent sub-commands

Comannd Arguments
ADD coursekey courseName
ADDLECT coursekey lectureList
ADDTUT coursekey tutorialList
ADDPRE coursekey prereqList

Where

The two arguments to these commands are separated by whitespace. The plain ADD command should come first in the programs input. This command creates and initializes a course data base entry for the course specified by the courseKey. The commands ADDLECT, ADDTUT and ADDPRE cause various information to be inser ted into the data base entry for the specified course (which must already exist in the data base). These commands replace any existing information.

QUIT Command

QUIT should implement a simple query to stdout. Something like:

Save Changes?

It can be assumed that the response will be

Y or N for yes or no.

If the response is neither of these, N is assumed and quit.
Do NOT repeat the Query.

This query should only happen if there are changes that have not been saved. i.e the sequence

SAVE
QUIT

Should not get a Query.

Sequrity Requirements

There is no need for any special password/permission mechanism to allow a person to function in admin mode. The only requirement is that they have write access to the course data base.

The Student's Database has also no protection. Different stundents are using different student databases.

Operational Requirements

SSA should work on the Linux workstations presently installed at CDF. There is no requirement to suppor t any other kind of use.

It is assumed that at any point in time at most one administrator is ever trying to modify the course data base and that while the course data base is being modified, no student will try to use it. it is also assumed that each student data base is modified only by the individual student who owns it.

SSA should follow the standard Unix conventions for input and output. Input comes from standard input (stdin), output is directed to standard output (stdout), error messages may be directed to standard output or standard error (stderr) depending on the nature of the message. The intent of this convention is to make it convenient to use the program interactively or with input from a file for testing.

Appendix