Skip to main content

Automatically assign programming homework to students on GitLab

Project description

Assigner automatically creates a number of repositories within a GitLab group (or user). The repositories represent homework assignments being assigned to a list of students.

The repositories are created as private with the instructor (the one running Assigner) as owner and each student as a Developer. By doing this, students do not need group permission (which would allow them to see other students’ repos), but instead are given individual permissions on their repositories within the group.

The student repositories that are created receive some initial content from some base repo, a link to which must be provided to Assigner as an argument.

The list of students is retrieved from either a default YAML file or a specified one. See _config.example.yml for an example YAML configuration file.

Installation

Assigner can be installed with pip: pip install assigner.

(You may need to run pip3 install assigner if your operating system uses python 2 as the default python.)

Commands

Check out the tutorial for a walkthrough of how to use Assigner’s features!

  • init Creates a new configuration file, interactively prompting for required values.

  • help What it says on the tin.

  • new <assignment> Creates a new base repository for an assignment so that you can add the instructions, sample code, etc.

  • assign <assignment> Creates homework repositories for an assignment for each student in the roster.

  • open <assignment> Adds each student in the roster to their respective homework repositories as Developers so they can pull/commit/push their work.

  • get <assignment> [<path>] Creates a folder for the assignment in the CWD (or <path>, if specified) and clones each students’ repository into subfolders or fetches their changes if their repository is already cloned.

  • commit <assignment> <message> [<path>] Commits changes to files in student repositories located in the CWD or <path>.

  • push <assignment> [<path>] Pushes new commits to student repositories to GitLab.

  • score Score student assignments and push grades to Canvas.

  • lock <assignment> Sets each student to Reporter status on their homework repository so they cannot push changes, etc.

  • unlock <assignment> Sets each student to Developer status on their homework repository.

  • archive <assignment> Archives student repositories, disallowing pushes and hiding the repository from the project listing on GitLab.

  • unarchive <assignment> Restores archived student repositories to their previous state.

  • protect <branch> Protect a repo branch (prevent force pushes).

  • unprotect <branch> Unprotect a repo branch.

  • status <assignment> Shows the status of student homework repositories, as well as the last commit author and timestamp for each repository.

  • roster Manages the course roster.

  • canvas Lists Canvas courses or imports students from a Canvas course to the roster.

  • import <file> <section> Imports students from a CSV file to the roster.

  • set <key> <value> Sets <key> to <value> in the config.

SSH

Your GitLab account must have an SSH key set up in order to push the assignment to the students’ repos.

Configuration File

Assigner will create a _config.yml file in the current directory that will persist your GitLab private token and other settings. You can use a different config file by specifying the --config option.

Assigner needs you to set a few config keys before it will work. The easiest way to do this is by running assigner init and entering the information it prompts you for. Alternatively, you can create yor own, following the template in _config.example.yml.

You can change configuration settings by either manually editing the config or through using the set subcommand.

Importing from Canvas via the Canvas API

The Canvas API can be used to retrieve the list of students for each course section. You can use the canvas list command to list your course sections, and make note of the ID of the course you would like to import students from. Then you can use the canvas import command with the appropriate course ID to import the students from the course section into your configuration file.

Importing from Joe’SS via CSV file

Joe’SS offers a button to download a table of all the students in a section. For whatever reason, the developers at Oracle decided that this button should give you an HTML table in a file named pg.xls (or something like that). You can download this file, open in LibreOffice (or some other piece of software that tramples your freedom), and save as a .csv file. The import command can read the resulting .csv and import your students’ data for you.

Extra Help

If you are particularly baffled, you can pass the -h or --help flag to any Assigner command for more details on what it offers. For example, get --help will get you help with get.

Generating Access Tokens

GitLab Token

To generate an access token for GitLab, log onto the GitLab website (e.g. https://git-classes.mst.edu/), and go to your Profile Settings. Go to the Access Token tab, then add a personal access token using the form on the page. Leave the expiry date empty to create a token that never expires, and select the api checkbox to allow API access using your token. Make sure you copy the generated token, since you won’t be able to retrieve it afterwards.

Canvas Token

To generate an API token for Canvas, log onto your Canvas account (e.g. https://canvas.mst.edu/), and click on Account at the top left corner of the page, then go to Settings. From there scroll down to Approved Integrations and click the New Access Token button, then use the form to create a new API token. Make sure you copy the generated token, since you won’t be able to retrieve it afterwards.

Reporting Bugs

Assigner tries to be as user-friendly and bug-free as possible. If you encounter behavior that is confusing, seems wrong, or used to work but doesn’t anymore, please file a bug report. Please check CONTRIBUTING.md to see what info we’d like to see in bug reports and advice on contributing patches if you want to fix or improve things yourself.

Credits

  • Ty Morrow

  • Mike Wisely

  • Natasha Jarus

  • Islam Elnabarawy

  • Billy Rhoades

  • Josh Essman

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

assigner-3.1.2.tar.gz (56.6 kB view details)

Uploaded Source

Built Distribution

assigner-3.1.2-py3-none-any.whl (72.8 kB view details)

Uploaded Python 3

File details

Details for the file assigner-3.1.2.tar.gz.

File metadata

  • Download URL: assigner-3.1.2.tar.gz
  • Upload date:
  • Size: 56.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.7

File hashes

Hashes for assigner-3.1.2.tar.gz
Algorithm Hash digest
SHA256 8673b4bd802d480843ad733a65ebb72240bd6e28e30b448a4ad9250fb77ecb3a
MD5 11a79b7282dacd6f02d90b10bc9c0091
BLAKE2b-256 012869f701ca9450796dabcc08e65dc43cdc52b39f6d23eb76a5c9e453ea6c8a

See more details on using hashes here.

File details

Details for the file assigner-3.1.2-py3-none-any.whl.

File metadata

  • Download URL: assigner-3.1.2-py3-none-any.whl
  • Upload date:
  • Size: 72.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.7

File hashes

Hashes for assigner-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9ca3bed6706638694b144d5e06a7cc96c7c71add1d0dd624e80d6ee49e2ad71
MD5 8376608cb207aa72f512429e1fd0789f
BLAKE2b-256 3793d2ccf07036e588733c990e254882cb460eb8d17d12a6f00db35b90a41449

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page