Computer Files


[graph_grades output]

I wrote this Perl script as an example for Ben Davis, using the GD.pm interface to the GD Graphics Library. The goal is to create graphs that answer, roughly, “how well must I do on the remaining tests to pass this class, to get an A, etc?”

The input is a text file with three or more lines of data, delimited by white space. The first field of each line is a text tag, the remainder are numbers. The values in the first line are the maximum possible scores on a series of tests. The values in the second line are the relative weights of each test. Each remaining line contains an individual students scores.

The output is a collection of PNG files graphing each student’s cumulative grades in black, extended by projections in blue if all future scores are 100%, 90%, 80%, 70%, or 0% (in red).