Skip to content
albert12132 edited this page Jan 27, 2015 · 1 revision

Getting started

To use OK, make sure you have the following in your current directory:

  • A published copy of OK. This file is actually a ZIP archive, but make sure not to unzip it.
  • A configuration file called config.json. Make sure you've downloaded the correct config.json for your assignment.
  • Any other files necessary for your assignment.

All of these files should be provided to you by your instructor.

Using OK

Basic Usage

The easiest way to use OK is with the following command:

python3 ok

This will run all the tests specified in config.json. At the end, OK will ask you to authenticate -- this is to allow OK to backup your files to the OK website. You will only need to authenticate once per assignment.

Specifying questions

If you want to test a particular question, you can use the -q option:

python3 ok -q name_of_test

Unlocking questions

If your instructor has activated the Unlocking feature, you can enter an unlocking session with the -u option:

python3 ok -q name_of_test -u

Using interactive mode

If you want a way to interact with an unsuccessful test, you can use the -i option:

python3 ok -q name_of_test -i

After the test's error is printed, an interactive session is opened.

Using verbose mode

By default, tests that pass are omitted from the output. This is to avoid clutter and make it easier to spot tests that fail. If you want to see output for all tests, including successful ones, use the -v option:

python3 ok -v

Submitting assignments

To submit your assignment, use the --submit option:

python3 ok --submit

Preventing backups

By default, OK will attempt to send a backup of your files and a record of your test progress to a server. If you wish to prevent any data from being sent, use the --local option:

python3 ok --local