COS 333 Assignment 5: The unRegistrar

Due midnight, Friday, March 26. Note that this is after spring break. There are concurrent project obligations, however, so use the time wisely. No extensions on this deadline.

Tue Mar 2 08:44:13 EST 2010

The Registrar's web site leaves something to be desired when all you want is a quick look at a few courses. Fortunately, much registrar data is freely available, so it's possible to make a private version that might be more satisfactory at least along this dimension. This assignment is a somewhat open-ended exercise in using Ajax technology to make a highly responsive alternative.

My own quick and dirty version is the unRegistrar, which you can use as a starting point. It includes minimal Ajax functionality as described in class, and simple tooltip code adapted from lixlpixel.org. You will soon see that although it is responsive and easy to use, it's also dumb and the code is sleazy. Your task is to make it somewhat smarter and add some new features while preserving its speed, simplicity and convenience for ad hoc queries like "what QR classes start at 1:30 on Monday and Wednesday?" (The version on my web page does a bit more than the code provided; you can replicate features of my web-page version if they appeal.)

1. Something Old

Your version must include any three of these features, presented in any way you like:

  1. It should enable searching for the standard 3-letter department codes for departments and programs, but only in context; that is, "cos" if clearly by itself should yield CS courses, but not items whose descriptions merely include strings like "cost" and "Costa Rica". There are some 3-letter codes like "art" and "his" that are also 3-letter words; it would be nice if you could do something sensible with them.
  2. It should enable easy and unambiguous searches for the distribution codes like QR and HA. Identifying "qr" is easy, since it appears nowhere in English text, but many of the other codes are parts of English text. This is a variant of the problem in the previous paragraph. Neither feature has to work perfectly but they should mostly get things right.
  3. Add something easy to use and not too space intensive that easily converts cryptic department and program codes like "QCB" into official names like "Program in Quantitative and Computational Biology".
  4. Add something similar for distribution codes, to map for example "EM" to "Ethical Thought and Moral Values".
  5. Add something that will convert the cryptic 5-letter building codes into the full building name.

2. Something New

You must add two new features of your own. If nothing new comes to mind, consider some of these:

The primary goal is functionality, with esthetics a secondary but still relevant consideration. Provide three of the numbered features above and two additional features of your own, for a total of five. More is ok if you're on a roll.

The directory a5data includes the raw materials that you need to get started. My unRegistrar code includes several ugly Awk scripts that convert the registrar's information into nicer form, the CGI script reg.cgi that searches it, and the HTML file reg.html that includes the basic tooltip and Ajax code. The files foo_* contain processed data from the Registrar's web site for Spring 2010. The script get_all.awk explains briefly what each one contains. These are all in a tar file a5data.tar that you can download.

3. Advice

To get started,

You're welcome to ignore my code entirely, and you can use any tools and languages that get the job done. The assignment is meant to give you some hands-on experience with Ajax and Javascript, but not to take a huge amount of time, so don't kill yourself.

Your code must work with Firefox. Safari would be nice but not if it takes extra work. I have been unable to make my code work properly with Internet Explorer (mostly because of CRLF issues), and I see no reason why you should waste your time on IE either. Here are some other hints:

4. Submission

You must use the names reg.html, reg.cgi, and get_all for the web page, the cgi script and the code that creates your data file(s). Your get_all must create the output file(s) that reg.cgi will read, as mine does, so we can experiment with it if we want to. [There need not be a reg.cgi if you don't use one.]

Create a README file with one paragraph for each feature that you added so we can see what you had in mind. A few sentences each should be enough, so it probably won't be over a page long. For example, it might say

Feature 3: Displays expanded form "Computer Science" when the mouse
passes over 'COS' in the one-line display, and similarly for other
departments.
We will run your code on whatever server you have it running on. The first paragraph of the README must clearly state the full URL for accessing your system, wherever that is; for example, mine is
  http://www.cs.princeton.edu/~bwk/a5/reg.html
which is the CS cgi server. If you want us to use your own or some other machine, make sure it works and stays up for the duration of grading.

Collect all your files (but not the registrar data) into a single tar file:

	tar cf a5.tar reg.html reg.cgi get_all README other_files...
and submit a5.tar using this Dropbox link. This will ask you to upload the README file separately, but include it in the tar file as well.

We will assess your submission primarily on whether it correctly implements the features requested and the new features you added, how well it handles interesting queries, and how easy and natural it seems; esthetics are a secondary concern but not irrelevant.

Please follow the rules on what to submit. It's a big help if your submission arrives in the right form, and your programs do exactly what is asked for.

Acknowledgement

Many thanks to Eirik Bakke '08, who provided the initial scripts to extract raw information from the Registrar's database, and helped me to make sense of the data.