Systems Status

Announce RSS Feed RSS

Blog RSS Feed RSS

Help Topics

Deschutes Facilities

Campus Facilities

User Account Info

Roundcube Mail

Contact Systems

ipv6 ready

Introduction

We've created an application that allows students to turn in assignments via the web. Here are some setup instructions for faculty members intrested in using the turnin application.

The basic idea is that the turnin CGI script runs as a user that is allowed to write to some directory that will be used to store turned in assignments. We use the user webuser, which is only used for secured systems web scripts. To make it easier for students to turn in several assignments we store their authentication information in an encrypted cookie in their browser.

Repository

So, you start off by creating a repository for the uploaded assignments. This would generally be something like /cs/groupprojects/cis{whatever}/homework (this directory cannot be in the /cs/classes/www hierarchy.) Inside the repository will generally be a directory for each project (you could store all of the uploads in a single directory, but it would be messy when it came time to grade the last one.)

When the repository is created, you need to make sure that each directory is writable by webuser. The most convienent way to do this would be to add webuser to your class staff unix group, and make the directory group writable. You can add webuser to your class staff group using groupctl (groupctl set groupname uocsmember+webuser). The directory should be set, via chgrp and chmod to be owned by your staff group, and have permissions of 2770.

Configuration File

After the repository is created, you need to create a configuration file for the turnin script. This is a file named turnin.cfg in /cs/classes/www/{term}/cis{whatever}, and has the following structure.

    {control directive} = 1

    [projects]
    {project name} = {repository}

    {project name} = {repository}

    ...

Control Directives

There are several control directives available. These determine what files are allowed to be uploaded, and how the files are stored. The default configuration is to store each uploaded file as {username}-{date}.{extension}. This keeps each uploaded version as a separate file, and is suitable for uploaded archives. In the default configuration, each student must have a CS account, and that is used for authentication.

overwrite
The overwrite directive stores uploaded files as {username}.{extension}.
directory
Instead of storing a single file per student, each student gets a directory {username}, and each file they upload is stored with their given file name. If a new file with the same name is given, the old file is overwritten.
filetypes
This restricts the filetypes that the user is allowed to upload. It can be used if you only want to accept homework using a specific archive format.
htpasswd
If your students don't have CS department accounts, you can create your own htpasswd to contain usernames and passwords so that they can still upload homework.
projects
The project name is listed by the turnin script to allow the student to select where to upload the assignment. The repository is the full path of the directory in which to store the uploaded assignments.

Any line beginning with // is considered a comment and ignored.

Linking

After the repository and configuration files are setup, you need only tell your students about the script. The link:

    <a href='https://systems.cs.uoregon.edu/apps/turnin.php'>Turnin assignments</a>

will get to a page that asks the student which course and project to upload for. If you want, you can add course and optionally project information to the URL to shortcut those pages. To add the course, add "?course=cis{whatever}", and to add a specific project add "&project={whatever}" to the turnin URL.

Examples

The basic setup for each of the examples is the same. The course number is cis001, it's home directory is /cs/classes/www/06S/cis1, and the unix group for the class staff (instructor and gtfs) is cis1st. We'll store the homework in /cs/groupprojects/cis1. The class webpage could have any of the following links to the turnin application.

    <a href="https://systems.cs.uoregon.edu/apps/turnin.php">
        turn in any homework</a>
    <a href="https://systems.cs.uoregon.edu/apps/turnin.php?course=cis1">
        homework for this class</a>
    <a href="https://systems.cs.uoregon.edu/apps/turnin.php?course=cis1&project=loops">
        homework for loops assignment</a>

If you wish, you can use the following code to setup a submit button for the loops homework for the cis1 class.

    <form action="https://systems.cs.uoregon.edu/apps/turnin.php" method="get">
    <input type="hidden" name="course" value="cis1">
    <input type="hidden" name="project" value="loops">
    <input type="submit" name="submit" value="Submit the Loops Project">
    </form>

The main configuration requirement for the Turnin application is to setup the turnin.cfg file. The following several examples should give you an idea of the results from setting each option.

The first configuration example uses the default options in the configuration file. This is the configuration you would use if students were required to create and upload archives (or some other single file assignment.) It keeps each file that is uploaded, so you can check for changes.

    // default configuration for loops and selection projects
    [projects]
    loops = /cs/groupprojects/cis1/project1
    selection = /cs/groupprojects/cis1/project2

When user bob uploads the file stuff.tgz on 11:20:00 on Jan 1 2002, for the loops project it will be stored in the /cs/groupprojects/cis1/project1 directory as bob-20020101-112000.tgz. The file he uploads ten minutes later would be bob-20020101-113000.tgz.

The second example adds the filetypes option to the configuration file. This option restricts the types of files uploaded (it trusts the student to be correct about the filetype.) You could use it if you only wanted to accept image files.

    // apparently, students will be turning in pictures of loops
    filetypes  = ".jpg .gif"
    [projects]
    loops = /cs/groupprojects/cis1/project1
    selection = /cs/groupprojects/cis1/project2

Uploaded files are stored as above. The only restriction is on the display options in the upload page.

The third example uses the overwrite option to the configuration file. This is used to keep only the latest uploaded version of a file.

    // we only want to keep the file turned in last 
    overwrite = 1
    [projects]
    loops = /cs/groupprojects/cis1/project1
    selection = /cs/groupprojects/cis1/project2

When user john uploads the file stuff.tgz on 17:20:00 on Jan 4 2002, for the selection project it will be stored in the /cs/groupprojects/cis1/project2 directory as john.tgz. The file he uploads ten minutes later would just overwrite john.tgz.

The fourth example uses the directory options in the configuration file. This is configuration lets the students upload several files, avoiding the work of creating archives. Any new file upload overwrites previous ones of the same name.

    // each student turns in several files w/o using archives
    directory = 1

    [projects]
    loops = /cs/groupprojects/cis1/project1
    selection = /cs/groupprojects/cis1/project2

Here, mary would use the turnin script several times, once each to upload loops.c, loops.txt, and loops.h. The files would be located in /cs/groupprojects/cis/project1/mary, and they would be called loops.c, loops.txt, and loops.h. Any later uploads by mary would overwrite any file with the same name.

For the impatient

    * add webuser to your staff group
    * create directories to receive the homework
          o generally in /cs/groupprojects/cis{whatever}
          o one per project
          o owned by the class staff group
          o permissions at least 2770
    * create /cs/classes/www/{term}/cis{whatever}/turnin.cfg with the following fields:
          o [projects] entry to start projects descriptions
          o for each project: {project name} = {repository directory}
          o optional: directory to store the data in {username}/file format
          o optional: overwrite to store the data in {username}.{extension} format
          o optional: filetypes {extensions} to limit the available file types
    * put a link from your webpage to:
          o https://systems.cs.uoregon.edu/apps/turnin.php?course=cis{whatever}&project={whatever}
Edited: November 05, 2013, at 04:25 PM
Copyright © 2017, University of Oregon, All rights reserved
Privacy Policy