Homework 5
This assignment will involve creating a larger CGI application in Perl.
Create a basic course scheduler CGI application. When first loaded up, your application should display a grid going from Monday to Friday, 8am-9pm, delimited into hour-long blocks. Your application must have the following abilities:
- Register for Class
- Drop Class
- Change Course Info
- Assignment Reminder
- Display Grid
Register for Class
When the user selects this option, you should present a form in which the user can choose the name of the class, which day(s) the class meets, at what time the class begins, in what room the class meets, and the length of the class.
Drop Class
You must create the ability for a student to drop any course for which he/she is already registered.
Change Course Info
When the user selects this option, present him/her with all of the info for the course (name, day(s), time, length, room), and allow any or all of this information to be altered.
Assignment Reminder
Allow the user to add an assignment (name, description, and due date) to any course. Also allow the user to delete any previously created assignment.
Display Grid
This option takes the user back to the main screen of the application - the course schedule. The grid should show all registered courses at their appointed days and times. It should be obvious from looking at the grid where the student will be at any given time at any given day. Each course's cells on the grid should show the course name and the room location.
Below the grid, show a list of all assignments on the user's Assignment Reminder. The list must show each assignment's name, description, due date, and for which course it was assigned. It must be ordered by duedate, earliest to latest.
Application Structure
This assignment is intentionally very free-form. As long as your application has all of the required abilities listed above, I don't so much care how those features are implemented. For example, you can have a button that takes the user to a separate form to create a new class, or you can put the form on the same page as the grid. You can have them click a button on the grid to drop a course or add an assignment, or you could have links or buttons that take them to separate forms to execute these tasks.
Programmatically, the assignment is also very free form. You may have your
Perl code generate all the HTML for you, or you may choose to use one or
more HTML::Template objects (coming in 4/16's lecture). You may
write one or more modules, or you may put all Perl code into a single .cgi script.
The only two requirements I am going to make are: (1) You may not have more than
one .cgi script. You can have as many additional modules as you want, but all the
"executable" code must be in one single .cgi script; (2) If you choose
to create any modules, you must use the h2xs procedures you used for
Homework 4 to create, install, and distribute them. That is, you should not submit
any bare .pm files - you should submit tarballs for modules only.
When creating forms, please use the default method attribute, so that
your program attempts to contact whatever the current program is. Do not hardcode
either your script's name nor location at any point.
Assumptions
You may make the following assumptions when coding this assignment:
- A class meets at the same time every day that it meets
- A class's length is a multiple of whole hours
- The user will not attempt to schedule overlapping classes
Grading Criteria
| Register Course | 20 |
|---|---|
| Drop Course | 10 |
| Change Course Info | 10 |
| View Grid | 15 |
| Create Assignments | 10 |
| Drop Assignments | 5 |
| View Assignments | 5 |
| Application Navigation | 5 |
| Code Style | 5 |
| Output Style | 5 |
| Clean Compilation | 5 |
| Error Checking | 5 |
Code Style
Your code should be easily read by a human being. Most important are: consistent indentation,
explanatory comments, and meaningful variable names. For a full list to well-styled Perl
code, please see perldoc perlstyle.
Output Style
For the purposes of this assignment, "output" refers to the appearance of your web application itself - not the HTML code that produces it. I'm not going to be doing "View Source" on your script. Your HTML need not be human-readable. Your application, however, should be easily usable by a human being with basic web knowledge. Buttons and inputs should be labeled, instructions on what to do when should be given, the grid should make it obvious what courses are meeting when, etc.
Clean Compilation
Your code should produce no warnings. Your code should also of course, produce no errors. Warnings lose "Clean Compilation" points. Compilation Errors result in a 50% penalty.
Error Checking
No user - whether malicious or just ignorant - should be able to crash your program or cause unexpected consequences. You should check all incoming parameters to make sure they're valid, you should check to see that all fields that need to be filled in are filled in, etc. Any time the user does something wrong, you should display an appropriate error message.
Application Navigation
The user should never have to push the browser's "Back" button. He/She should be able to get from any part of your application to any other part of your application, by following the links and buttons you provide. This is also true for error conditions. If the user does something wrong, display an error message either along with a link/button to get back to a main page, or at the top of a main page itself.
Submission Instructions
Your program must be functional on http://cgi2.cs.rpi.edu. You are free to develop
whereever you wish, but make sure your program works on the CSDept's CGI machine. When you're ready
to submit, log on to solaris.remote.cs.rpi.edu and run the program
~lallip/public/submit.pl and follow the prompts. Remember to submit all of your
files with each submission. Remember to submit your .cgi script, any HTML::Template files, and any
.tar.gz files for modules.
Your program is due at 11:59:59pm EDT, Tuesday, April 22, 2008. You may submit infinite times, only the last submission will be graded. You may submit up until 3:59:59pm Wednesday April 23 at a reduction of 20 points.
