...
Lucidchart | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
There are three groups of HTTP web APIs exposed by XQueue, all of which communicate using JSON.
Authentication
XQueue has a separate user model that has no connection to edx-platform users. Service accounts must be created directly with XQueue, and clients must use basic (session) auth to communicate.
API Endpoints
There are three groups of HTTP web APIs exposed by XQueue, all of which communicate using JSON.
LMS-facing
/xqueue/submit
Receive a new task
Allowed methods: POST
Format: must have three keys defined in a JSON object in the POST body.
lms_callback_url: the exact location where XQueue should POST the final result of a task
lms_key: an opaque identifier that the caller wants returned in the final callback
queue_name
Any files included in the POST will be dumped into XQueue's configured file storage system.
...
Also called "passive," these graders exposed a web interface that XQueue calls called when a new submission is was available for processing. XServer was a push-grader implementation. We moved away from the use of push graders in favor of more general-purpose XBlock integrations (e.g. an LTI consumer).
...
Consider modifying XQWatcher to have a "slow" poll when the queue is empty, and a "fast" poll when it the queue is probably not empty (as in, if the last poll was successful).
XQWatcher is more of an instance of a code grader than a code grader framework. A framework/client library may speed adoption of external graders.
Resources
...
Source code
XQueue: https://github.com/edx/xqueue
Contains the Python code for the Django-based IDA.
Pull grader client: https://github.com/edx/xqueue-watcher
Contains the base Python code for Flask-based XQueue watchers.
The actual graders used on edx.org are maintained by the course authors in separate Github repos.
One example of a (private) Github repo where MIT graders are kept for one course: https://github.com/mitodl/graders-mit-600x
Push grader client: https://github.com/edx/xserver
This repo is now archived and is read-only. Push graders are now deprecated and removed.
Related documentation
...
Code Block |
---|
title Pull Flow participant LMS participant XQueue participant XQWatcher XQWatcher-->XQueue: Poll for submissions note left of LMS: Initiate a request\n(asynchronously) LMS->XQueue: Submit request to queue XQWatcher-->XQueue: Poll for submissions XQWatcher<->XQueue: Get next submission note right of XQWatcher: Do some work\n(e.g. grade code) XQWatcher->XQueue: Push result back XQueue->LMS: Send result via callback note left of LMS: Display result XQWatcher-->XQueue: Poll for submissions |
Push Flow
Code Block |
---|
title Push Flow participant LMS participant XQueue participant XServer note left of LMS: Initiate a request\n(asynchronously) LMS->XQueue: Submit request to queue XQueue->XServer: Submit to grader\n(blocking) note right of XServer: Do some work\n(e.g. grade code) XServer->XQueue: Respond with result XQueue->LMS: Send result via callback note left of LMS: Display result |