Grader
The C++ Grader Library
#include "Grader.h"

Grader Philosophy

The grader helps you intelligently grade complex problems. In real life, teachers use branching logic to grade student work because even the simplest questions reflect a complex tree of dependent concepts.

When a teacher examines student work, she starts by grading the highest level aspects of a student's work and then works down to the details. If a student fails to understand a high level concept then there's usually little to gain by traversing down the tree to grade details based upon the higher level concept.

Teachers also make decisions while they grade. Based on the student's choices, they may want to examine different aspects of their work. For more complex questions, teachers may also grade against multiple questions simultaneously and compare multiple lines of evidence to determine student understanding.

Most importantly, great teachers provide as much feedback as possible. Teachers congratulate students on their successes and point them in the right direction when their understanding strays.

The grader exists to provide easy branching, checkpoint and feedback logic so you can easily grade student work the same way that classroom teachers grade.

See the tips and tricks section for grading strategies.

API

Come back later

Output

{
"num_created": 0,
"num_run": 0,
"num_passed": 0,
"num_failed": 0,
"num_optional": 0,
"elapsed_time": 0, // time to execute all tests in ms
"student_feedback": "aggregated useful feedback from all tests to show students",
"passed": [ {"tests"} ],
"failed": [ {"tests"} ],
"optional": [ {"tests"} ]
}

where each test in "passed" and "failed" is:

{
"name": "an optional name",
"message": "a helpful message for students that was generated by the test's pass/fail state",
"tag": "aTagDescribingTheFeedback",
"elapsed_time": 0, // time to execute in ms
"checkpoint": true,
"optional": false
}

Development Flow

Dependency

JSON (included in lib/)

Making Changes

  1. Checkout a new branch.
  2. chmod a+x remake.sh
  3. Make changes.
  4. ./remake.sh to compile tests (you can just run make after the first time you run ./remake.sh).
  5. ./grader_tests to run tests.
  6. Repeat steps 3-5 as necessary.
  7. Update API in README.
  8. Submit pull request!