pip install wqet-grader
Simple grading:
import wqet_grader
submission = "My Answer"
wqet_grader.grade('Sample Assessment', 'Question 1', submission)
Object grading:
import wqet_grader
arg1 = 3.14
arg2 = "something else"
wqet_grader.grade_object('Sample Assessment', 'Question 1', arg1=arg1, arg2=arg2)
Supported objects:
file
Binary filematplotlib_axis
Matplotlib Axispandas_dataframe
Pandas DataFrame objectsklearn_model
SKLearn pipeline/modelfloat
,int
,string
,dict
,list
- Primative types
You can load a directory of grading algorithm modules, by running the following command:
./scripts/load_and_run fixtures/content
This will automatically restart the server when any changes to the Grading API code or content is detected. Reporting to the WQET platform is disabled and additional debug logging is enabled on the console.
The sample notebook of this content can be run as follows:
cd fixtures/notebooks
./run.sh
Then open: http://127.0.0.1:8888/lab/tree/sample-questions.ipynb?token=test
You can spin up a grading server for a directory of content, using the following code:
from wqet_grader.utils import set_grading_content_path
set_grading_content_path("my-curriculum-folder")
from wqet_grader.server import app
app.run(host="localhost", port=2400, debug=True, threaded=False)
Through environment variables:
GRADING_API_URL
- URL of grading APIVM_TOKEN
- Temporary token for user authenticationSCORE_OUTPUT_FORMAT
- Format of score output in notebook:json
orhtml
(defaults to JSON)
Requirements:
- Python 3.6+.
Setup your Virtual Environment:
make venv
To run unit tests:
make test
make package.build
make package.release