Skip to main content

A set of utilities to expedite submission of jupyter notebooks to Gradescope

Project description

gsExport is a utility designed to help educators simplify and streamline the process of grading student notebooks. Designed to alleviate the struggles realized in UC Berkeley’s Data 8, the system allows students to easily export Jupyter notebooks as PDFs which are segmented to allow for easy grading through the Gradescope interface.

Features

The system is easy to use, once installed on the client computer.

In order to generate the PDF file for a notebook, students simply run the following commands

import gsExport
gsExport.generateSubmission("hw01a.ipynb")

The exporting tool does the following:

  • We diff the student’s notebook with the default “beginning” notebook, to see what regions students actually contributed to. By doing so, we eliminate a lot of the text/in-place code which doesn’t need to be graded

  • Using a custom LaTex template, we export to PDF (with pagebreaks as necessary)

Structure Requirements

How to work with gsExport

In your notebook, add the following

  • add the text #newpage in the Markdown cells before which you’d like to pagebreak (for example, the beginning of a question)

  • add ‘#student’ on all cells in which you expect the student to write information

To generate the new notebook, run the following commands in the shell

jupyter nbconvert hw01a.ipynb --NotebookExporter.preprocessors="['gsExport.gsExportPreprocessor']" --to notebook

which will generate a notebook with all the appropriate structure in hw01a.nbconvert.ipynb. The following structure inside the IPython notebook is added

  • The number of ‘#newpages’ in nb[‘metadata’][‘number_of_pages’]

  • All cells with ‘#student’ set cell[‘metadata’][‘#student’] = True, and the line with ‘#student’ is removed

  • We save a list of MD5 checksums of each cell in the notebook metadata: nb[‘metadata][‘checksums’]

Installation

pip install gsExport
pip install git+git://github.com/dibyaghosh/gsExport # alternatively

Development

  • exporter.py - contains the main logic for the exporter

  • utils.py - contains utilities for importing and exporting notebooks

  • ok_grading.py - contains the OK autograder and export logic

For those interested in bundling files

See setup.py for the commands required to install bundled files See utils.py for the commands required to fetch the bundled files (this is actually quite jank right now, because of a weird bug with Jupyter nbConvert )

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

gsExport-0.19.1.1.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file gsExport-0.19.1.1.tar.gz.

File metadata

  • Download URL: gsExport-0.19.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.14.2 setuptools/29.0.1.post20161207 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.4

File hashes

Hashes for gsExport-0.19.1.1.tar.gz
Algorithm Hash digest
SHA256 65037137ab331e88b14c4e5129583d3bd223b7bc536d1e66a105177bce2b7371
MD5 2944f632b8da4041d701aea43249a4ff
BLAKE2b-256 17294ffc5a7de2ae4a9c0f78527281fcc94f6a63f8218df31797d204eb7ff71e

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