This is the web version of courseInfo, which allows students to access their grades in the Computer Science courses at York. Students who do not have accounts on Ariel, such as those in 15XX courses, cannot run courseInfo and thus would be prime candidates for this program. (The real reason I wrote this program was because I wanted to learn about HTML forms, CGI scripts and Perl :-)

For authentication courseInfo relies on the student logging into Ariel. We cannot do this for webCourseInfo because the target students don't have accounts on Ariel. Also, we cannot rely on Glade to do our authentication. Consequently, authentication is much less sophisticated, relying only on the Maya/Glade username (yuXXXXXX) and the student number, which is supposed to be private. (You might argue that this authentication is lousy; you're right but VES isn't much better. Anyway, I'm looking at better methods.)

I'll be adding better authentication (username, ariel password) soon. Then our own students can use it as well.

How it Works

Our Web server allows for the execution of local programs when a remote user accesses the appropriate URL. When the user fills out a form on the Web these programs are transparently passed arguments, do their computing, and return the results as HTML commands. The results are interpreted by the remote user's client program as a new Web page.

To implement webCourseInfo I first created a web page with the appropriate HTML form tags that can collect the required information. Here are 2 examples of HTML forms that call webCourseInfo. (For more information about HTML forms check out this reference.)

Next, I created a Perl script, webCourseInfo.cgi, that reads the HTML form data, massages it and calls the program webCourseInfo (which does all the real work). The Perl script also outputs the correct HTML tags before and after it calls webCourseInfo so that the returned data becomes a legal HTML page.

Finally, I wrote the C program webCourseInfo, which is almost identical to courseInfo. It does that actual job of reading the course grades file and returning the appropriate data. Actually, it doesn't know that it's dealing with the Web; it just reads from standard input and writes to stadard output. The first thing it does is read from standard input the student's username and private passphrase (for now their student number). (Why from standard input? Because you don't want these to be command line arguments; they could potentially be visible to others on the local system this way.) It then reads the course info file and prints every line that begings with a '+' (for common information) or begins with the student's username and private passphrase (for the student's information).

What You Need to Do

First, you need to create the info file that contains the student grades that you are sharing with students. The layout of the data in this file is similar to that required by courseInfo: the program prints all lines in a file which start with a '+' or start with the student's student number. The '+' allows for common information to be printed, such as class averages. An example file in this format can be found in below:

    +Glade   Number    Name             A1     A2
    yu123456 202123458 Bunny, Bugs      37     89
    yu234567 202123456 Duck, Donald     42     36
    yu345678 202123457 Mouse, Michael   65     88
    +                         Average:  48     71

To get data in this format I import the appropriate course distribution file from /cs/dept/dist/ into a spreadsheet program (I use sc). (Note: the '+' gets turned info a space when printed by the student; it looks neater this way.) When Donald uses webCourseInfo and supplies their Maya/Glade username and student number, he gets:

     Glade   Number    Name             A1     A2
    yu234567 202123456 Duck, Donald     42     36
                              Average:  48     71

Next, the info file must be placed in the appropriate web course directory. For example, next term's 1030 course info files must be placed in /cs/dept/www/course_archive/1999-00/W/1030. The name of the file must be infoFile? where ? is the section (eg: infoFileM).

Next, you must set the permissions of these files so that only other faculty members can read them. (How? chmod 640 infoFileM.) Otherwise, everyone on the web could read the file, which would be a VERY BAD thing. (Since webCourseInfo is a setgroupid program owned by faculty it will have no problem reading the file.)

Finally, you must create a web page that has the appropriate HTML Form tags. Look at this page for a couple of examples.

Revised Nov. 30, 1999