DCS grading programs

Selection options

Many of the grading programs allow you to apply their actions to just a subset of the student records in a grades file. This can be done by specifying either a subset to be included, or a subset to be omitted (or "excluded"), or both.

You state your selection criteria by means of command-line options, and this page describes the options that are available.

General form

Here are the available command-line options. As you read about them, bear in mind that inclusion options override omission options. To have an omission option that cannot be overridden, you will need to filter your grades file through gselect first; this makes a copy of your file that simply does not contain any records that were not selected.

-d
Omit students marked as having dropped the course.

-o omitchars
Omit students whose flag character is one of the characters in the string omitchars.

-O
Omit all students. Obviously, this is unlikely to be useful except in combination with an inclusion option.

-I
Override the -O option, which may have been set automatically by other options. Although the letter 'I' was chosen for this option because "Include" is a kind of opposite to "Omit", nevertheless this is not strictly an "inclusion" option, because it does not override any omission option except -O.

-i includechars
Include students whose flag character is one of the characters in the string includechars.

-n includename
Include students whose name includes the substring includename. Sets the -O option automatically, so that only matching students are included, unless the -I option is explicitly set.

-# includenumber
Include students whose student number includes the substring includenumber. Sets the -O option automatically, so that only matching students are included, unless the -I option is explicitly set.

-v includemarkXvalue
Include students for whom the mark named includemark has a value related to value in way determinded by the operator X, which may be either '=' or '~': Here, the "value" of a mark is the entire string representing the mark in the grades file, including any trailing comments. There must not be any spaces before or after the '=' or '~' operator.

Examples

Suppose we're working with a grades file called "example" containing these mark definitions and student records:

a1 / 10
a2 / 10
a3 / 10
a4 / 10

123456789    Alice	10	10 L	10	10
123456790 d  Brian	5	5	5	5
123456791  x Carla	0	10	0	10
We'll use the command "gpr -H -T -M", which prints the student records, without header, statistics or mark names.

Command: gpr -H -T -M example
Output -- all the students:

123456789    Alice                10   10 L 10   10   
123456790 d  Brian                5    5    5    5    
123456791  x Carla                0    10   0    10   

Command: gpr -H -T -M -d example
Output -- all but Brian, who seems to have dropped the course:

123456789    Alice                10   10 L 10   10   
123456791  x Carla                0    10   0    10   

Command: gpr -H -T -M -ox example
Output -- all but Carla, who is flagged 'x':

123456789    Alice                10   10 L 10   10   
123456790 d  Brian                5    5    5    5    

Command: gpr -H -T -M -O example
Output -- nobody!

Command: gpr -H -T -M -O -ix example
Output -- only Carla, who is marked 'x', and not the others, because we used a -O option:

123456791  x Carla                0    10   0    10   

Command: gpr -H -T -M -n a example
Output -- only Brian and Carla, because "Alice" doesn't contain 'a':

123456790 d  Brian                5    5    5    5    
123456791  x Carla                0    10   0    10   

Command: gpr -H -T -M -# 8 example
Output -- only Alice, because her student number contains '8':

123456789    Alice                10   10 L 10   10   

Command: gpr -H -T -M -v a2=10 example
Output -- only Carla, whose mark for a2 is exactly "10":

123456791  x Carla                0    10   0    10   

Command: gpr -H -T -M -v a2~10 example
Output -- Alice and Carla, both of whom have marks for a2 that contain "10":

123456789    Alice                10   10 L 10   10   
123456791  x Carla                0    10   0    10   

Command: gpr -H -T -M -v "a2=10 L" example
Note the use of quotation marks in the command line to have the argument string contain a blank.
Output -- only Alice, whose mark exactly matches "10 L":

123456789    Alice                10   10 L 10   10   

Another example

For a further example -- less complicated, but more practical in the sense that you will certainly encounter it at the end of your course -- see the page for gen.

Changes since the previous version

The old version of the grading programs did not provide selection options.