Using the pickup script with your course

The pickup script is a companion to the submit script.1)

Pickup allows you to place files for pickup in your course directories such that those files cannot be read by your students until they run this script. At that time an entry is logged showing the date, time, user and directory that was picked up. If your students attempt to kill the script (say, after it copies the files and before it logs that it has) that attempt will also be logged.

The course in question must have a course account with dropboxes set up for each student as specified at working_with_dropboxes

The SysAdmin will need to create a link for your course to @@/usr/local/bin/pickup@@ the same as the way submit works. So, for cs123, a link to pickup of @@/usr/local/bin/pickup123@@ will be created. Send the SysAdmin a note with your course number saying that you would like to use the pickup script for it.

The following two steps need to be done once for each course first that you want to use @@pickup@@ with.

1 Create a pickup directory

As the course account user, create a directory called @@pickup@@ with permissions of 700

mkdir -m 700 ~/pickup

2 Add a line to ~/.supertab

As the course account user add the following line to the course account's @@~/.supertab@@ file, if the account does not already have a @@.supertab@@ file, create one. (Replace 123 with your course number.)

pickup-copy "/usr/local/sbin/pickup-copy cs123 pickup " :asprey2

Please note that there is a colon “:” at the beginning of the word asprey2. The colon informs super that this is a group name not a user name.

Once you have this line in your @@.supertab@@ anyone in the default student group @@asprey2@@ can run this script as the course account. The script itself checks against the names in the course dropbox before it takes any action. This saves you from having to list all your students in @@~/.supertab@@.

When you want to use ``pickup`` to distribute files:

- Create the Directory to pickup

create a directory under @@~/pickup@@ WITHOUT ANY SPACES IN ITS NAME

- Populate the directory

Put all the files you want to distribute in the newly created directory.

- Tell your students what to do

Once the files are in place, tell your students the name of the directory to pickup with the pickup script. They will then enter the command @@pickupCOURSE_NUMBER DIRECTORY@@.

For example, if your course is CS123 and you want to distribute a midterm, then as the cs123 user create the directory ~/pickup/midterm and put the files is it. Then tell your students to execute the command:

pickup123 midterm

When they run it it will create in their home directory cs123/midterm and put your files in there. It will also log in ~cs123/pickup-log/ the time, user and name of directory copied.

The script logs activity in a directory it creates. To eliminate any problems of simultaneous invocations of the script, each log entry is its own file in the log directory. To “view the log” simple request a listing of the log directory. To view logs for a particular lab or test, just restrict your listing to that lab or test.

The name of the log directory is @@pickup-logs@@. It is put at the top level of the course home directory and has permissions set to 700. Log entries are zero length files with names that indicate the date, day and time, the user name, the action and the directory name. For example, if user grhopper picks up the midterm directory on Thursday, March 10, 2011 at 11:23:06 am, a file will be created with the name @@2011-03-10_Thu_11:23:06_am-grhopper-pickup-midterm@@.

You can use @@ls@@ to select all entries for @@midterm@@ with

ls ~/pickup-logs/*midterm

or all entries for @@grhopper@@ with

ls ~/pickup-logs/*-grhopper-*

Permissions

The script attempts to “Do the right thing”. It will always ensure the files and directories it distributes can be read by the user running the script so you don't have to be concerned with the permissions of the files or directories you create under the pickup directory.

Your students will be able to modify their copies of files they get with this script.

Safety

Students must have a dropbox for the course or the script will not work for them.

The students cannot look in the course pickup directory itself or see the files in there even if they know the file names. They can only use this script to make a copy of those files.

Attempts to send the script a signal (for example, in order to copy the files but kill the script before it writes the log) are themselves logged.

All that being said, once they have a copy, there is nothing in this script that puts any restrictions on what they do with it. Just as once you hand out a take home exam, nothing in the paper exam stops them from copying it.

Greg Priest-Dorman 2011/05/03 13:08