Add Code Requests for Single Component Courses

This tool can distrinbute add codes for courses that have only a single component (i.e. lecture or lab, but not both).

Installing and Configuring

To set it up on a new machine, make sure it is running the Apache web server with CGI enabled.

Setting it up before the semester

To configure the tool you will need terminal access to the web-server, and should wait until advanced registration has ended. For the Fall this is typically around August 15th, for the spring January 15th is typical. See the Registration Calendar for exact dates. If all of this has worked no further configuration should be necessary.

What to do during the semester

No maintenance should be required during the semster, although it is a good idea to periodically check that you are able to get an add code if you request it, and that student information is getting recorded in the addcodes.txt file in the data folder.

How it works

This outline describes the steps taken by the cgi executable when called on to give an add code. Basically it checks the enrollment of the course form the last update published on the web, adds to that the number of add codes it has given out since it was published (including a 60 minute grace period for codes given out just before the last update was published). If the user hasn't requested an add code in the last 10 minutes, and if the section has availability it will give an add code to the user and record the user information in the file addcodes.txt int he Data folder.

The steps executed by the cgi executable are as follows:

  1. Define file locations:
  2. Check the course and section being requested, if the ID of the user is '0' regenerate the enrollment file addcodes-enrollment.txt in the data folder
  3. Read enrollment file addcodes-enrollment.txt in the data folder use enrollment file to get parameters of the class being requested, using the URL of the web page with enrollment data stored in the enrollment file.
  4. Regenerate the enrollment file if necessary using links on "http://info.sjsu.edu/web-dbgen/soc-spring-courses/all-departments.html" or "http://info.sjsu.edu/web-dbgen/soc-fall-courses/all-departments.html" depending on the semester
  5. Check if space is available in desired section by reading the enrollment file addcodes-enrollment.txt in the data folder
  6. Use enrollment file to get parameters of the class being requested, using the URL of the web page with enrollment data stored in the enrollment file.
  7. Check that the name and ID of the user were submitted
  8. Check that the requesting computer has not been used to get an add code in the last 10 minutes unless the requesting user is an "administrator"
  9. Write the changes in the file addcodes.txt in the data folder
  10. Print out results to the user
  11. Update the initialization file used to create the web page, determining if pace is available based on the number of add codes that have been given since 1 hour BEFORE the last update of the web page listing the enrollment values. If space isn't availbale in a section the link for that section will not be clickable.