Skip to main content

A Tutor plugin for Xqueue (external grading system)

Project description

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:

pip install tutor-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 quickstart.

Usage

In the Open edX studio, edit a course and add a new “Advanced blank problem” (“Problem” 🠆 “Advanced” 🠆 “Blank Advanced Problem”). Then, click “Edit” and copy-paste the following in the 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.local.overhang.io (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 }}")

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

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tutor-xqueue-13.0.0.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file tutor-xqueue-13.0.0.tar.gz.

File metadata

  • Download URL: tutor-xqueue-13.0.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for tutor-xqueue-13.0.0.tar.gz
Algorithm Hash digest
SHA256 8db4edee00de3e27609afed7b56b7b83b62f0e0d8ac8812db53a6d3b48db3c33
MD5 86062fcdfadbc798353cabf7f0de1815
BLAKE2b-256 60341bda41d7c5da8e9831da1d39056041bfd642e031ebbb1f1c2b5d2ded3f12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page