Skip to main content

Xqueue external grading system plugin for Tutor

This is a plugin for Tutor that provides the Xqueue external grading system for Open edX platforms. If you don’t know what it is, you probably don’t need it.

Installation

The plugin is currently bundled with the binary releases of Tutor. If you have installed Tutor from source, you will have to install this plugin from source, too:

tutor plugins install xqueue

Then, to enable this plugin, run:

tutor plugins enable xqueue

You should then run the initialisation scripts. The easiest way to do this is to run tutor local launch.

Usage

In the Open edX studio, edit a course and add a new “Advanced blank problem” (“Problem” → “Advanced problem types” → “Blank problem”). Then, copy-paste the following in the Blank problem editor:

<problem>
  <coderesponse queuename="openedx">
    <label>Write a program that prints "hello world".</label>
    <textbox rows="10" cols="80" mode="python" tabsize="4"/>
    <codeparam>
      <initial_display>
        # students write your program here
        print("")
      </initial_display>
      <answer_display>
        print("hello world")
      </answer_display>
      <grader_payload>
        {"name": "hello world"}
      </grader_payload>
    </codeparam>
  </coderesponse>
</problem>

For a problem that includes a file submission, write instead:

<problem>
  <coderesponse queuename="openedx">
    <filesubmission/>
    <codeparam>
      <grader_payload>
        {"name": "file submission"}
      </grader_payload>
    </codeparam>
  </coderesponse>
</problem>

Note that in all cases, the queue name must be “openedx”.

Save and publish the created unit. Then, access the unit from the LMS and attempt to answer the problem. The answer is sent to the Xqueue service. If you know how to use the Xqueue API, you can access it at http(s)://xqueue.LMS_HOST (in production) or http://xqueue.www.myopenedx.com (in development). However, the Xqueue API is a bit awkward to use. Tutor provides a simple command-line interface to interact with the Xqueue service.

Count the number of submissions that need to be graded:

$ tutor xqueue submissions count
{
  "content": 0,
  "return_code": 0
}

Show the first submission that should be graded:

$ tutor xqueue submissions show
{
  "id": 1,
  "key": "692c2896cdfc8bdc2d073bc3b3daf928",
  "body": {
    "student_info": "{\"random_seed\": 1, \"anonymous_student_id\": \"af46c9d6c05627aee45257d155ec0b79\", \"submission_time\": \"20200504101653\"}",
    "grader_payload": "\n        {\"output\": \"hello world\", \"max_length\": 2}\n      ",
    "student_response": "        # students write your program here\r\n        print \"42\"\r\n      "
  },
  "files": {},
  "return_code": 0
}

Grade the submission (in this case, mark it as being correct):

$ tutor xqueue submissions grade 1 692c2896cdfc8bdc2d073bc3b3daf928 0.9 true "Good job!"
{
  "content": "",
  "return_code": 0
}

The submission should then appear as correct with the message that you provided on the command line:

Correct answer

Configuration

  • XQUEUE_AUTH_PASSWORD (default: "{{ 8|random_string }}")

  • XQUEUE_AUTH_USERNAME (default: "lms")

  • XQUEUE_DOCKER_IMAGE (default: "{{ DOCKER_REGISTRY }}overhangio/openedx-xqueue:{{ TUTOR_VERSION }}")

  • XQUEUE_HOST (default: "xqueue.{{ LMS_HOST }}")

  • XQUEUE_MYSQL_PASSWORD (default: "{{ 8|random_string }}")

  • XQUEUE_MYSQL_DATABASE (default: "xqueue")

  • XQUEUE_MYSQL_USERNAME (default: "xqueue")

  • XQUEUE_SECRET_KEY (default: "{{ 24|random_string }}")

  • XQUEUE_REPOSITORY (default: "https://github.com/openedx/xqueue")

  • XQUEUE_REPOSITORY_VERSION (default: "{{ OPENEDX_COMMON_VERSION }}")

These values can be modified with tutor config save --set PARAM_NAME=VALUE commands.

Debugging

To debug the xqueue service, you are encouraged to mount the xqueue repo from the host in the development container:

tutor dev start –mount /path/to/xqueue

Feel free to add breakpoints (breakpoint()) anywhere in your source code to debug your application.

License

This work is licensed under the terms of the GNU Affero General Public License (AGPL).

Troubleshooting

This Tutor plugin is maintained by Jhony Avella from eduNEXT. Community support is available from the official Open edX forum. Do you need help with this plugin? See the troubleshooting section from the Tutor documentation.

Metadata

Release files for tutor-xqueue 22.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tutor-xqueue 22.0.1
File Size Uploaded Provenance Actions
tutor_xqueue-22.0.1.tar.gz 21.5 kB Without provenance Details for tutor_xqueue-22.0.1.tar.gz

Release files / tutor_xqueue-22.0.1.tar.gz

Download URL tutor_xqueue-22.0.1.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
69fc34440a91a95663f1659d76add544302deea1ff32c7a552c10592fb94bb61
BLAKE2b-256 checksum
How to use checksums
9af17df5113b4dd3033ca0c2dea62b21049babd7b970b1d7cd773696d7385d5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for tutor-xqueue 22.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

22.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page