Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

UBC-DSCI/autotest

Repository files navigation

NbGrader extension for automatically generating test code.

Note: This code has been merged upstream into NbGrader itself. See jupyter/nbgrader#1817 .

autotest_demo

Demo

To run the demo, make sure Docker is installed on your machine, and run the following in the root folder of the repository:

docker-compose up

This will build a docker image, bind mount the demo/source and demo/release folders, and start a Jupyter notebook server. Open your browser and navigate to localhost:8888; this should open the Jupyter notebook interface.

You will likely need to give read/write permissions to the demo/source and demo/release folders (so that the jupyter user inside the docker container can read/write to them). Again in the root folder of the repository, run:

chmod a+rwx demo/source
chmod a+rwx demo/release

We have included a few example autograded notebooks in this demo container. For example, you can use Autotest to process the ps3 assignment. In the Jupyter notebook interface in your browser, open a terminal (New -> Terminal) and type:

nbgrader generate_assignment --force ps3

To see how Autotest processes your questions, you can instead run with debug flags:

nbgrader generate_assignment --force --debug ps3

The release version of the assignment will appear with generated test code in the release/ folder.

See the source/ folder for other demo assignments. You can also add your own in the demo/source/ folder of this repository. Make sure to give a+rwx permissions to each assignment you add to the folder, as otherwise the jupyter user won't be able to read/write to them.

How It Works

You can watch a brief explainer video here. More technical details will be added here in the README soon.

Installation

  1. Create a python virtual environment:
  1. Activate this virtual environment
  2. Clone this repository to local
  3. Install the requirements:
pip install -r requirements.txt 
  1. Execute ./install_autotest.sh under the root of this repository, it will automatically install autotest generation module over the nbgrader package
  2. Install extensions
  jupyter nbextension install --sys-prefix --py nbgrader --overwrite
  jupyter nbextension enable --sys-prefix --py nbgrader
  jupyter serverextension enable --sys-prefix --py nbgrader

Repository Status

Autotest currently supports NbGrader version 0.6.2. An updated version of Autotest for the newest version of NbGrader is under development.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •