A web-based system for creating, distributing and grading homework assignments.
Bryan Wright, UVA Physics Department

In the fall of 1998, Professor Lou Bloomfield asked me if I could come up with a web-based way of managing his large How Things Work class. This is a very popular class taught in the Physics Department, with a typical enrollment of 400 or so students. Lou particularly wanted to get away from handling paper. With a large number of students, printed homework and term papers could easily be lost, and students with missing assignments could argue that their work was turned in, but lost by the instructor or a grader. Lou envisioned a system that would accept the work electronically, then mail back a digitally signed certificate to the student. Students would be told to contact the instructor immediately if they did not receive a certificate. If the instructor later believed that the assignment hadn't been submitted, it would be up to the student to submit the certificate for verification.

Over the following Christmas break, I cobbled together the first version of the system, written as Perl cgi scripts. Authentication was done through an Apache .htaccess file and data was stored in flat text files. Session state information was stored in cookies in the student's browser. The homework certificates were generated by pgp. The system ran on a scrounged 120 MHz pentium running Linux. The course ran successfully with this version of E-Class during the Spring semester of 1999.

From the beginning, E-Class has been a victim of "creeping featurism". New features are constantly requested, and the original version, hastily put together in time for the coming semester, soon proved too difficult to modify. Because of this, I re-wrote the system during the summer of 1999. The new (and current) version of E-Class is still based on Perl, but this time in the context of Apache::ASP. Instead of flat text files, data is now stored in a MySQL database. The site now runs through a secure web server, constructed using mod_ssl. I've also managed to scrounge a better computer, a 300 MHz machine.

Although I've tried to avoid painting myself into corners, the system as it stands only addresses the needs of the "How Things Work" class. For example, it supports the submission of short-answer homework and term papers, but it currently has no support for multiple-choice or numerical answers, although it would be relatively easy to add these formats. We haven't had the resources to make E-Class a full-fledged software development project. The system has evolved to meet the needs of a single class by adding features and fixing bugs on a just-in-time (or maybe a leeeetle late) basis. While doing this, though, we've made a concerted effort, where time allowed, to make the system as flexible as possible. Still, if I were updating the system for general distribution, I'd probably take the current version as a working example, then rewrite the system from scratch.

Some of my design goals when writing E-Class were to ensure that:

What Does E-Class Look Like?
Below are links to a few screenshots of the E-Class system. E-Class users are divided into four privilege groups: Manager, Instructor, Grader and Student, listed in order of increasingly restricted access. Managers have access to the entire E-Class system, and can create new classes. They can perform any function available to the other three groups. Instructors have complete access to a particlar class. They can add students to the roll, create assignments, change passwords, and so forth. Graders can view students' work, assign grades and add comments. Students can submit work and view their own grades.

Managers and instructors can add students one-at-a-time, through a web form, or in bulk, by reading in a text file downloaded from ISIS. If students are added in bulk, their initial password is just their social security number. At present, the students are not allowed to change their own passwords.

The figure below shows part of the "work flow" that goes on among users of the E-Class server, tracing the creation and completion of an assignment.

E-Class Work Flow:

EClass Workflow

Underlying Software
The following are some of the packages on which E-Class is based:

E-Class consists of a single asp script, which calls on many function libraries and include files. The script performs either of two different tasks, "command" or "display", depending on whether it's called with a "?CMD=" query string appended to the URL. In "display" mode, the script generates html appropriate to the program's current state. This state consists of a specific EClassState session variable, and may also include other information from other session variables (e.g., identifying the current class or user). When given a "command" the script performs some action invisibly, which may include a change of state. In principle, one command may invoke the script and ask it to do another command. Errors are signaled to the user by changing to an "Error" state, and setting variables (which will be used in the "Error" display) to indicate the nature of the error.

Access to the script's functions is restricted by testing the current user's privilege level before invoking a command. Commands are arranged in four groups: those available to everyone; those available only to graders, instructors and managers; those available only to instructors and managers; those available only to managers. The user's privilege level is set when he/she authenticates at the beginning of the session.

E-Class actually uses several separate databases. First, there is an 'eclass' database, which contains meta-information about the classes on the server. The table below shows the layout of the "class" table in this eclass database. Several fields may need explanation. "Solver" is used to designate a user whose answers will be posted as problem solutions. In some cases it may be the instructor, in other cases a designated grader may perform this function. Note that the "Instructor" field in this table specifies the "primary" instructor. Classes may also have "secondary" instructors, who share the same privileges as the primary instructor. In the case of Lou Bloomfield's class, he shares responsibilities with such a secondary instructor, and it's this instructor who is listed as the "solver".

The "Version" field is used to specify the version of the E-Class software that this class was created under. In the future, large changes may require that we use this flag to properly handle data from older classes.

The "Gradesonly" flag is new for this semester, and is intended for classes that want to use E-Class as a web-based gradebook, but don't want any of the other functions.

Class table:
classid int(10) unsigned
name varchar(16)
session enum('Fall','Spring','Summer')
year year(4)
instructor varchar(16)
solver varchar(16)
title varchar(128)
url varchar(128)
greeting text
version varchar(10)
disabled tinyint(4)
gradesonly tinyint(4)

Each time a new class is created, a separate database is created to hold its data. The class databases are numbered sequentially, in order of creation, with names like 'class1', 'class2', etc.. The class databases contain the bulk of the class information. The tables in each class database are:

I won't describe each table, but here's the layout of two of the less obscure ones:
User table:
userid varchar(16)
name varchar(32)
ssn varchar(9)
password varchar(32)
privlevel enum('student','grader','instructor')
disabled tinyint(4)
Assignment table:
assignmentid int(10) unsigned
type enum('homework','paper',...)
assigned datetime
due datetime
maxoverdue int(10) unsigned
title varchar(128)
posted tinyint(4)
graded tinyint(4)
solved tinyint(4)
allowgroup tinyint(4)
groupsize int(10) unsigned

As I mentioned above, we're currently adding the ability to use E-Class as a web-based gradebook, without its other functions. I'd also like to add support for more question types, in addition to the short answer and uploaded paper types available now. The addition of multiple-choice and numerical questions would also allow for the possibility of automated grading. In this case, question parameters could also be generated randomly for each student, giving him or her an assignment different from those assigned to classmates. This is currently being done by NC State's "Webassign" program.

What E-Class needs more than anything else is man-hours. The current system was developed in spurts, during Christmas and slower parts of the Summer, with a total of about 250-300 hours of work over a 1.5 year period. Through accretions added each semester, the system has now reached a level of complexity that makes it difficult to understand, and could use a simplifying rewrite from the ground up.

To see some of our specific plans for improving E-Class during the coming year, see: