Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Lucidchart
pageCount1
autoUpdatefalse
pageId94307018
alignleft
typerich
autoSize1
macroId9c0d7562-54e2-4e75-b524-d996b2491908
pages
instanceIdConfluence:1710260420
width700
documentId39ce9072-bafd-4697-8612-2631ee401453
documentToken39ce9072-bafd-4697-8612-2631ee401453|38005|94307018|uquPjtKUHMi/GT7CB2QvuqXKkCKrDKVZGQ4MBkHBnpw=
consumerKeyConfluence:1710260420
height500

...

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

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