Skip to main content

edX course unit tester

Project description


edxcut = edX Course Unit Tests

This is an open source package for performing unit tests of answer box
grading correctness, for a live running open edX course instance.

edxcut accepts a course unit test specification file (in YAML format),
and interacts with the edX course instance, mimicing a live learner,
via direct calls to the edX xblock APIs for problem checking and the
instructor dashboard, for resetting problem attempts. Test cases
specify inputs, and whether the expected graded return should be
correct or incorrect, for each case.

The course unit tests file can be produced manually, or by digesting
the course XML, or automatically, during compilation using
[latex2edx]( When using
latex2edx, you can specify multiple test cases within the `\edXabox`
macro, including both expected correct and incorrect cases.

Example tests file

Below is an [example tests YAML file](
which can be run to test some problems in the demo course provided with the [edX fullstack]( (dogwood release) virtualbox VM:

course_id: course-v1:edX+DemoX+Demo_Course
password: edx

- url_name: 75f9562c77bc4858b61f907bb810d974
responses: [ 43.141, 4500, 5 ]
expected: [incorrect, correct, correct]
- url_name: 75f9562c77bc4858b61f907bb810d974
responses: [ 43.141, 4500, 9 ]
expected: [incorrect, correct, incorrect]
- url_name: 75f9562c77bc4858b61f907bb810d974
responses: [ 43.141, 4500, 9 ]
expected: incorrect
- url_name: Sample_Algebraic_Problem
responses: [A*x^2 + sqrt(y)]
expected: correct
- url_name: Sample_ChemFormula_Problem
responses: [H2SO4 -> H^+ + 2 HSO4^-]
expected: incorrect
- url_name: Sample_ChemFormula_Problem
responses: [H2SO4 -> H^+ + HSO4^-]
expected: correct

using this command line:

edxcut test test_data/test_demo_course.yaml

Note that you may need to change the `url_name` for the first three
cases, which have a edx-studio-specific hexstring, if using a different VM

Unit tests

This package includes unit tests for build testing.

Project details

Download files

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

Files for edxcut, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size edxcut-0.1.tar.gz (10.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page