check50

check50 is a tool for checking student code. As a student you can use check50 to check your CS50 problem sets or any other Problem sets for which check50 checks exist. check50 allows teachers to automatically grade code on correctness and to provide automatic feedback while students are coding.

Installation

First make sure you have Python 3.6 or higher installed. You can download Python here.

check50 has a dependency on git, please make sure to install git if git is not already installed.

To install check50 under Linux / OS X:

pip install check50

Under Windows, please install the Linux subsystem. Then install check50 within the subsystem.

Usage

To use check50 to check a problem, execute check50 like so:

check50 <owner>/<repo>/<branch>/<check>

For instance, if you want to check CS50's Caesar problem from edX 2018 you call:

check50 cs50/problems/2018/x/caesar

You can choose to run checks locally by passing the --local flag like so:

check50 --local <owner>/<repo>/<branch>/<check>

For an overview of all flags run:

check50 --help

Design

  • Write checks for code in code check50 uses pure Python for checks and exposes a small Python api for common functionality.
  • Extensibility in checks Anyone can add checks to check50 without asking for permission. In fact, here is a tutorial to get you started: Writing check50 checks
  • Extensibility in the tool itself We cannot predict everything you need, nor can we cater for every use-case out of the box. This is why check50 provides you with a mechanism for adding your own code to the tool, once more without asking for permission. This lets you support different programming languages and add new functionality. Jump to Writing check50 extensions to learn more.
  • PaaS check50 can run online. This guarantees a consistent environment and lets you check code for correctness without introducing your own hardware.

Checks

In check50 the checks are decoupled from the tool. You can find CS50’s set of checks for CS50 problem sets at /cs50/problems. If you would like to develop your own set of checks such that you can use check50 in your own course jump to Writing check50 checks.

Under the hood, checks are naked Python functions decorated with the @check50.check decorator. check50 exposes several functions, see API docs, that allow you to easily write checks for input/output testing. check50 comes with three builtin extensions: c, py and flask. These extensions add extra functionality for C, Python and Python’s Flask framework to check50’s core.

By design check50 is extensible. If you want to add support for other programming languages / frameworks and you are comfortable with Python please check out Writing check50 extensions.