Back

gradebookadd

This is a command line program that is executed by running gradebookadd with some subset of specified options and corresponding values.

The set of allowed options is {-N, -K, -AA, -DA, -AS, -DS, -AG, -AN, -FN, -LN, -P, -W, -G}. Different sets of options and corresponding values may or may not be valid. If a set of options/values is invalid, gradebookadd should print "invalid," and exit with error code 255. Otherwise it will add the data to the gradebook.

We next explain the various options and their purpose:

Command line arguments must appear in the following order: (1) A gradebook name must be specified first with -N (2) A key must be specified second with -K (3) An action must be specified third with exactly one of {-AA, -DA, -AS, -DS, -AG} (4) After the action option, other arguments from the set {-AN, -FN, -LN, -P, -W, -G} may be specified in any order and if the same argument is provided multiple times, the last value is accepted.

An incorrect order of arguments results in an error.

Empty gradebook names, assignment names, first names, lastnames are always invalid.

After gradebookadd exits, the gradebook specified by the -N argument should be updated. The added information should be accessible to the gradebookdisplay tool when the key provided to both programs is the same, and not available (e.g., by inspecting the file directly) otherwise.

Return values and error conditions

If gradebookadd must exit due to an error condition, or if the argument combination is incomplete or contradictory, the program should print "invalid" to stdout and exit, returning a 255.

If the gradebook to be appended already exists, and the supplied key does not match the expected key, "invalid" should be printed to stdout and 255 returned. (When a gradebook file is first created, the generated key becomes the valid key for all future accesses to that gradebook.)

Some examples of potentially valid orderings and combinations of command-line options:

Some examples of conditions that would result in printing "invalid" and doing nothing to the gradebook: