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:
fileBinary filepandas_dataframePandas DataFrame objectsklearn_modelSKLearn 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/contentThis 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.shThen 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:jsonorhtml(defaults to JSON)
Requirements:
- Python 3.6+.
Setup your Virtual Environment:
make venvTo run unit tests:
make testmake package.build
make package.release