Grader 1.0 (May 2003)
by Carl Mummert, mummert at math.psu.edu
Copyright 2003 under GPL
2.0
I have written a suite of perl scripts to assist with recording and analyzing grades for the courses I teach. My motivation for this is the difficulty I have had using a spreadsheet to compute grades. You might like to use this suite as well; use it at your own risk.
This system has the following features that are not present in a spreadsheet. (Note: when I say the system does something "automatically" I mean "without any manual labor required" -- I don't mean that it does them without being asked to do them.)
The system assumes that you have a directory dedicated to the grades for your class. All operations take place in the current directory, so you must cd there before you begin. Certain files must be present for the system to work; the system can generate most of these files automatically given the proper raw input data. The files are:
The following commands are available. They are listed roughly in the order they are needed during the semester.
If every assignment had the same weight, then dropping the lowest grades would be easy (actually, even this task is difficult to achieve in some spreadsheets, when dropping more than one grade). More care is needed when different assignment have different point values. First, the grades that represent the lowest percent of available points are the ones that must be dropped. Second, since assignments with different point values may be dropped, it isn't possible to predict before computing a student's grade the number of available points for this student in the end; this number will vary depending on which assignments are dropped. The final grade calculation must take into account the number of points possible with the given assignments dropped. I have written gcompute to do this correctly.
gmkhtml requires a file gmkhtml.in in order to run. The first line of this file must be an absolute filename, into which the output is to be placed. The second line tells the desired permission on the output file (e.g. 0644). The rest of the file is an HTML file with two special escapes. These form of each escape is an HTML comment with no whitespace. The escapes are are:
See below for an example of this file
There are three main options to gcompute, at least one of which must be given:
gcompute will generate all the output requested, then stop. Ordinarily, the output is formated for on-screen viewing, with '---' as the page separator. Adding the '-v' option will format the output for printing, with page feeds and a cover page. The '-p' option is equivalent to '-vrls'.
Specifying the '-e' option limits the results (including computed statistics) to include only those students who appear on the class roster. Without this option, a student who has a grade on any assignment will be included in the statistics for that assignment, and a grade report will be displayed for each student who has received any grades in the course.
The '-n PATTERN' option will limit the output of grade reports to those students whose surname matches PATTERN.
The '-o' option will add to the output a table of letter grade assignments suitable for public display.
In addition to the assignment files, gcompute requires that you create (by hand) two files in the current directory: formula and cutoffs. These files are described below.
The 'cutoffs' file contains one line for each letter grade to be assigned. Here, a 'letter grade' is any sequence of non-tab characters - so 'A+', 'A', '3.33', and 'fred' could all be "letter grades". Each line of the file contains three fields delimited by tabs (with no spaces):
letter-grade [TAB] lower_cutoff [TAB] upper_cutoff Example: A [TAB] 90 [TAB] 200 B [TAB] 80 [TAB] 90 C [TAB] 70 [TAB] 80Each letter grade corresponds to all numeric grades in the half-open interval
The 'formula' file is parsed, line by line, once per student. The lines are executed in order.
In the end, you need to tell gcompute how to compute the final grade, but you can compute many intermediate numbers. The final grade must be stored into the variable &GRADE.
While parsing the formula file, gcompute has access to all the grades the student has received. These are accessed using the name of the assignment. Each has two pieces of information: the score the student received, and the maximum possible score.
Each line of the formula file tells gcompute how to compute some new variable. These new variables are differentiated from the assignment values because the new ones must have an ampersand '&' as their first character, while assignment names must not begin with an ampersand. Each of these new variables stores two values: the score that the student earned and the maximum possible score.
Any line containing only whitespace or starting with '#' is ignored.
Each line is a sequence of 'words' separated by whitespace. The words fall into three classes: '&-variables', assignment names, and commands.
The form of any valid line is
< &-variable > < command > < arguments >
Each line tells gcompute how to compute a certain &-variable. The first word on the line must be the name of the &-variable into which the current line's value will be stored.
The second word must be 'sum','avg', 'curve' or 'scale'. Several arguments to this command word will then follow on the same line. The arguments vary depending on the command:
&DESTINATION scale [var] [num] Example: &FINAL scale &RAW_FINAL 100 Example: &TEST2 scale test2 50The result of this is that the variable &DEST contains the value of [var] scaled to a maximum of [num].
&DEST sum [var1] [var2] [var3] ... or &DEST sum [var1] [var2] [var3] ... % [num] Example: &QUIZ sum quiz1 quiz2 quiz3 quiz4 quiz5 % 1The number of variables to be summed is not limited but all the variables must be on the same line. Each variable can be an assignment name or an &-variable. The value associated with the sum is the sum of the values of the terms. The maximum value associated with the sum is the sum of the max values of the terms added. If the '% num' is present, the lowest 'num' values are dropped (left out of the sum). See the section "Dropping Grades" for an explanation of how this is done.
&DEST avg [var1] [var2] [var3] ... or &DEST avg [var1] [var2] [var3] ... % [num] Example: &HOMEWORK avg hw1 hw3 hw3 hw4 hw5 hw6 hw7 %2The number of variables to be averaged is not limited but all the variables must be on the same line. Each variable must be an assignment name or an &-variable. In the first form, with no '%', the average is computed using all the variables shown. With the '% num' present, the lowest [num] scores are dropped before averaging; see the section "Dropping Grades" for an explanation of how this is done. The average is scaled to have maximum value 100.
&DEST curve [var] [num] &DEST curve [var] [num]% &DEST curve [var] [num] clip &DEST curve [var] [num]% clip Examples: &FINAL curve final 15 clip &HOMEWORK-CURVED curve &HOMEWORK 10%If the argument [num] ends with a percent sign (no space), then the corresponding percentage of the available points for [var] is added to the points earned for [var], and this is stored as &DEST. If no percent sign is there, the earned points of var are increased by the value [num]. The maximum points available for &DEST is the same as for [var]. If the option 'clip' is present, then the points earned will not be greater than the points available (so they are 'clipped off' at 100%). If no 'clip' is present, the earned points may be higher than the points available.
#add up homework scores, dropping the lowest score &HW sum hw1 hw2 hw3 hw4 hw5 hw6 hw7 hw8 hw9 hw10 % 1 #scale homework to 100 points &HW scale &HW 100 #add up exam scores. Since exam1c is the conflict for exam1, #I drop one grade from the sum. The dropped grade will always #be a zero since nobody takes both exam1 and exam1c &EXAM sum exam1 exam1c exam2 final % 1 #final grade is a weighted average of exams and homework &GRADE avg &EXAM &HW
/home/fourier3/mummert/public_html/230s03/grades.html
0644
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Carl Mummert</title>
<link type="text/css" rel="stylesheet"
href="http://www.math.psu.edu/~mummert/mummert.css">
<body>
<h1>Math 230.05</h1>
<h2>Carl Mummert</h2>
<h2>Spring 2003</h2>
<hr>
<h2>Recorded grades</h2>
<h3><!--Date--></h3>
<p>For a list of the homework assignments, click
<a href="assignments.html">here</a></p>
<!--Report-->
<hr>
<p>
<p>
<a href="http://validator.w3.org/check/referer"><img border="0"
src="http://www.w3.org/Icons/valid-html40"
alt="Valid HTML 4.0!" height="31" width="88"></a>
</p>
</html>