The 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.

The selection criteria are expressed through command-line options. As you read about them here, bear in mind that inclusion options override omission options. To have an omission option that cannot be overridden, you can filter your grades file through gselect first; this outputs a copy of the file that completely omits any records that were not selected.

And now, the options:

-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. Does not set the -O option automatically.
-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 '~':
  • includemark=value: the value of includemark must match value exactly.
  • includemark~value: the value of includemark must include value as a substring.

The -v option sets the -O option automatically, so that only matching students are included, unless the -I option is explicitly set.

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

For some practical examples of using selection options, see "Submitting your final grades". Here, we offer examples showing the syntax and effects of some selections.

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

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

1234567890    Alice	10	10 L	10	10
1234567891 d  Brian	5	5	5	10
1234567892  x Carla	0	10	0	10

As the base command — before the selection options — we'll use "gpr -H -T -M", which prints the student records, without header, statistics or mark names.

Command: gpr -H -T -M selectexample
Output — all the students, because no selection options were specified:

1234567890    Alice                10   10 L 10   10   
1234567891 d  Brian                5    5    5    10   
1234567892  x Carla                0    10   0    10   

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

1234567890    Alice                10   10 L 10   10   
1234567892  x Carla                0    10   0    10   

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

1234567890    Alice                10   10 L 10   10   
1234567891 d  Brian                5    5    5    10   

Command: gpr -H -T -M -O selectexample
Output — nobody!



        

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

1234567892  x Carla                0    10   0    10   

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

1234567891 d  Brian                5    5    5    10   
1234567892  x Carla                0    10   0    10   

Command: gpr -H -T -M -# 0 selectexample
Output — only Alice, because her student number contains '0':

1234567890    Alice                10   10 L 10   10   

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

1234567892  x Carla                0    10   0    10   

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

1234567890    Alice                10   10 L 10   10   
1234567892  x Carla                0    10   0    10   

Command: gpr -H -T -M -v "a2=10 L" selectexample
(Note the use of quotation marks in the command to allow the -v option's argument to contain a blank.)
Output — only Alice, whose mark exactly matches "10 L":

1234567890    Alice                10   10 L 10   10