This is an implementation of a polling XQueue client and grader.
python -m xqueue_watcher -d [path to settings directory]
{
"test-123": {
"SERVER": "http://127.0.0.1:18040",
"CONNECTIONS": 1,
"AUTH": ["lms", "lms"],
"HANDLERS": [
{
"HANDLER": "xqueue_watcher.grader.Grader",
"KWARGS": {
"grader_root": "/path/to/course/graders/",
}
}
]
}
}
test-123
: the name of the queueSERVER
: XQueue server addressAUTH
: list of username, passwordCONNECTIONS
: how many threads to spawn to watch the queueHANDLERS
: list of callables that will be called for each queue submissionHANDLER
: callable nameKWARGS
: optional keyword arguments to apply during instantiation
To implement a pull grader:
Subclass xqueue_watcher.grader.Grader and override the grade
method. Then add your grader to the config like "handler": "my_module.MyGrader"
. The arguments for the grade
method are:
* grader_path
: absolute path to the grader defined for the current problem
* grader_config
: other configuration particular to the problem
* student_response
: student-supplied code
To sandbox python, use CodeJail. In your handler configuration, add:
"CODEJAIL": {
"name": "python",
"python_bin": "/path/to/sandbox/python",
"user": "sandbox_username"
}
Then, codejail_python
will automatically be added to the kwargs for your handler. You can then import codejail.jail_code and run jail_code("python", code...)
. You can define multiple sandboxes and use them as in jail_code("special-python", ...)
We are using guesslang to detect language of code submitted by learner. It runs as a system module and should be intalled on machine using pip3.
- Make sure python3 is installed
- Do a
sudo apt-get update
- Install pip for python3
sudo apt-get install python3-pip
- Install guesslang
pip3 install guesslang
We will need javac to compile java code submitted by learners.
- apt-get install default-jdk