The DCS grading programs — the "grades" program

What is it?

"Grades" is a spreadsheet-style tool for editing grades files and doing some simple operations on them. Its essential purpose — its reason for being — is that you need to be able to type students' marks without counting tabs and lining up columns in your head. All the other operations — calculating marks, making printable files, submitting grades — can be done with the command-line programs. However, for convenience and to allow you to work within a possibly prettier environment, grades has accreted a bunch of command-line operations, so you can do a good many things without using the command line.

First, its name. Grades is started with a command-line program, either "grade" or "grades". I think it should be "grades", because like Word it just sits there rather than doing something, so it should be a noun. The command-line programs are verbs — commands. But if you're not as pedantic as I am, you can call it either grade or grades; both are provided in the standard set of command-line programs. They're the same.

The command "grade" (or "grades") accepts a list of file names as arguments and starts grades with those files already open. Possibly, however, you will prefer to start grades with no open files and explicitly open the files you want to work on from the File menu. There's less typing that way, and you may even be able to start grades by double-clicking the jar file, if your system is set up right. Welcome to the 1980s!

Besides entering marks, grades will help you select, sort, print, check and calculate students' grades. We hope you will feel like using it.

"Why does it do that?" (or, why doesn't it?)

You don't want to read this section the first time around. It's here to invite comments from users who have used grades enough to become annoyed, and to pre-empt some comments by explaining a few oddities in the user interface.

The grades GUI is based on Java's Swing classes, especially including JTable, a spreadsheet-like class. As far as possible it sticks to the defaults, in particular steering clear of platform-dependent settings. The goal is to reduce the burden of maintenance, especially when Oracle changes Java. The periodic Java updates do tend to improve the behaviour of Swing classes, but it can be hard for someone not a regular Java programmer to keep up. Consequently, we are not trying to compete with all the nice touches offered by an application such as Excel.

And one other point: the priority is the safety and correctness of your marks, not beauty or efficiency.

All the same, ugly inefficiency affects your ability to produce correct grades, so your comments on things you dislike are welcome, even if you don't always get an instant response. To get you going, here are some things that I also don't like.

Can you tell I'm a Mac user? If you're on a different system and have found other annoyances, please point them out.

But now, back to the introductory explanation …

Understanding how it works

Grades presents grades files as a spreadsheet wannabe. You can type mark values in cells, and change student numbers and names, more or less as if you were working with Excel. The user experience isn't as pretty, but it does work. And when you type a new value in a cell, the change is recorded in the data structure representing the grades file in memory. (There is no auto-save feature, however, so you'd better save the file periodically so as not to lose the contents of that data structure.)

The header

Unlike Excel, the cells in the grades display do not contain formulas. Those are in the grades-file header, which you can edit in a text area in the top part of the window.

Most of the time, you will not want to change the header. To gain a little more window space, you can hide it, using the controls in the window borders. (Those controls may be quite small, so look carefully.) Alternatively, if you happen to be doing extensive editing on a long header, you can use the controls to hide the body — the student section at the bottom.

Editing the header can be more complicated than changing an Excel formula for a single cell, because it affects the entire "spreadsheet". Very often, when you change the header, it becomes illegal until you make more changes, or else the mark values become illegal. For example, if you change a mark name, any formulas involving that mark still contain the old name. Similarly, if you add a new numeric mark where an existing column of data contains letter grades, all the old values are suddenly meaningless. The "Append mark column" and related commands in the Edit menu make the process somewhat simpler, but you still need to think carefully.

To avoid a blizzard of error messages, the displayed header is not the same as the one stored in the data structure representing the grades file. When you think you are finished fixing the header, and would like actually to use it with your grades, you must "install" it in the data structure. There is a button for doing that in the space between the header and the table of data cells.

"Installing" the header does not save the file. That's a separate step, and there's a button for that beside the install-header button. (There are also a couple of other ways to save the file. They all do the same thing.)

When you do install a new header, or append or remove a mark column (implicitly installing the revised header), grades panics about the carefully-formatting display of marks. It doesn't lose data, but it does forget how to display booleans, which widths to use with which columns, and other prettifying rules. You should be able to live with that, because you don't often change the header, but it does mean that you will want to save the file when you can, and reopen it with all the loveliness restored.

What you see is what you chose

One of the annoyances of working with the command-line programs is that you have to remember to specify which students your actions should affect. For example, if you're calculating final marks, much of the time you don't want to do it for students who have dropped your course. It's easy to forget the -d option, and then you have to go through and get rid of those unwanted marks. (After a couple of tries, you should think about a shell script, but still….)

Grade tries to help out here. It has a "Select" command that controls which students are displayed, and as far as possible all commands affect only the displayed students.

That's only true while the file is open in grades, of course, and there are some exceptions to the rule, but the hope is that for many situations this will make your life easier.

The exceptions to the "only displayed students" rule include sorting (you'd probably want the whole file sorted, and anyway sortedness of a grades file is a somewhat evanescent property), and changes such as insertion and deletion of mark columns that don't make sense for just a part of the file.

Doodads

Here are some features that aren't essential but that you might find helpful.

Cell colouring

Grades colours the background of cells pink if (1) the mark is a calculated mark and (2) it's wrong. "Wrong" means that if you calculated the marks for this grades file, the displayed string would be different; thus "12.0" is different from "12.00", and at least one of them would be wrong.

("Pink" is also wrong. It's Java's Color.PINK, so who am I to argue? — but it looks more salmony than pink, on at least a couple of systems.)

Dragging columns

The table of cell values is a Java JTable, and JTables let you drag columns around without actually changing the stored table structure. This means that if you like you can drag the column of marks that you're now entering to a position right next to the student names, or even between the student numbers and names, so that you don't have to look all across the screen to be sure you have the right mark for the right person.

On the down side, for some reason the cell colouring becomes very upset when you drag columns around. Also, any changes to the header should be made with the data columns displayed in the right order.

Cut, copy and paste

The keyboard equivalents for these operations are, as usual, c-X, c-C and c-V, where c is your platform's modifier key: control on Linux and Windows, command on Mac OS X. However, they are not displayed in the menu, and they don't work in the context of the cells in the table of the student data.

That is, they work within a cell, but you can't use them to copy (etc.) entire cells or ranges of cells. That's because pressing a key, such as c-X, starts the cell editor, so you're immediately working with the contents of the cell, not the entire cell itself.

Instead, use the mouse to select the menu commands.

In the header, or when you're working inside a table cell, you can use the keyboard equivalents, even though they don't show up in the Edit menu.

Undo and redo

You can use undo and redo (c-Z and shift-c-Z) in both the header and the student table. However, the header and the table maintain separate undo-redo lists. Which one is active depends on which part of the window you are working on. To undo in the header, for example, click in the header before executing the Undo command.

Certain actions empty the undo list for the student table. These actions include changing the selection of students displayed, sorting the students, and adding and removing students or mark columns; all of these may change the indices of data cells, which the undo list depends on. Consequently, you cannot "back up" over those actions, and the undo list begins to be rebuilt with whatever editing you do after such an action.

Search

Grades has a "Find" command (in the Edit menu) that lets you search the header and table cells for occurrences of a regular expression.

There are two limitations. First, the regular expression is case-insensitive. This is partly because of the way names are standardized — discussed next — and partly because insensitivity seems unlikely to cause many problems and likely sometimes to be a noticeable help.

The second limitation is that the search does not consider cells that do not have a string representation. In practice, this eliminates only the "has dropped" cells.

The "Select" command lets you select by mark value, but it does it in the same way as the command-line programs, requiring an exact match to either all or part of a mark value, rather than accepting regular expressions.

Name normalization

People enter names, including their own, in all kinds of strange ways. To make it easier to read grades-file printouts, the grading programs like to "normalize" names. They capitalize the parts of the name, decide which part or parts are the family name, and separate the family name from the given names with a pair of blanks. They get it wrong sometimes — my favourite example is ffoulkes — but mostly the normalization is either helpful or unimportant. You may never have noticed it, because when you use the command-line programs it only affects formatted printout with gpr and its derivatives.

It used to be that with grades, you might very well notice this normalization, because whatever you typed for a student's name was normalized as soon as you pressed the return key. However, as of April 2013, that no longer happens: the name is not normalized before storing in the grades file. (The displayed version is, as before, the version actually stored in the grades file.) If you find yourself unhappy with the change, please express your opinion; a return to the earlier dictatorial normalization is always possible.

The case insensitivity of the Find command is partly intended to avoid trouble with capitalization. You do have to get the spacing right between parts of a name when searching, however.

"Printed" output

Some of the commands in the Tools menu produce text output. This output goes into a new window that you can save into an actual file if you like. When you close the window for a grades file, the associated output windows are also closed, without asking you whether you would like to have them saved.

Editing student comments

You can add or edit the long-form comments on a student. (Those are the ones on separate lines in the grades file.) One column of the display contains buttons that you can click. The buttons are labelled with '!' if the student has a comment, and are blank otherwise.

If you have a great many comments to edit, as you might near the end of the course when you're adjusting marks for student illnesses, you might find the keyboard shortcut (c-E) more helpful than the buttons.

A point to bear in mind is that the table of student data does not contain the student comments. Instead, it contains buttons that give you access to the comments. This means that you can't copy one student's comment to another student except by starting to edit the first student's comment, copying the contents, switching to the other student's comment, and pasting the copied content there. That does add extra work, but on the other hand you don't have to copy the student number, as you would if you were editing the grades file directly. The net change seems to be a reduction in the work required.

Undo and redo are not defined within student comments.