Skip to content

Doubtfire API

API: units - Task Definitions

units : Operations about Units This markdown document provides detailed documentation for the “Task definition” API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl.

This “units” API has the following operations.

  • DELETE: /api/units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments/{id}
  • PUT: /api/units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments/{id}
  • GET: /api/units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments
  • DELETE: /api/units/{unit_id}/task_definitions/{task_def_id}/task_resources
  • GET: /api/units/{unit_id}/task_definitions/{task_def_id}/task_resources
  • POST: /api/units/{unit_id}/task_definitions/{task_def_id}/task_resources
  • POST: /api/units/{unit_id}/task_definitions/{task_def_id}/task_sheet
  • POST: /api/units/{unit_id}/task_definitions/{task_def_id}/test_overseer_assessment
  • DELETE: /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources
  • GET: /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources
  • POST: /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources
  • GET /api/units/{unit_id}/task_definitions/{task_def_id}/task_pdf
  • GET /api/units/{unit_id}/task_definitions/{task_def_id}/tasks
  • POST /api/units/{unit_id}/task_definitions/task_pdfs
  • DELETE /api/units/{unit_id}/task_definitions/{task_def_id}/task_sheet
  • DELETE /api/units/{unit_id}/task_definitions/{id}
  • PUT /api/units/{unit_id}/task_definitions/{id}
  • POST /api/units/{unit_id}/task_definitions

GET: Get the group attachments for a given task definition.

GET /units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments

  • URL: /units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/units/1/task_definitions/1/tii_group_attachments'
  • Response body:

    [
    {
    "id": 1,
    "name": "Attachment 1",
    "status": "uploaded"
    },
    {
    "id": 2,
    "name": "Attachment 2",
    "status": "pending"
    }
    ]

PUT: Trigger an action on the given group attachment.

PUT /units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments/{id}

  • URL: /units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments/{id}

  • Method: PUT

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    idGroup Attachment IDpathintegerYes
    actionThe action to perform (e.g., upload)querystringYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X PUT --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' -d 'action=upload' 'http://localhost:3000/units/1/task_definitions/1/tii_group_attachments/1'
  • Response body:

    {
    "id": 1,
    "name": "Attachment 1",
    "status": "has_id"
    }

DELETE: Delete a group attachment.

DELETE /units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments/{id}

  • URL: /units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments/{id}

  • Method: DELETE

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    idGroup Attachment IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 204

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/units/1/task_definitions/1/tii_group_attachments/1'
  • Response body:

    true

DELETE: Remove the task resources for a given task

DELETE /units/{unit_id}/task_definitions/{task_def_id}/task_resources

  • URL: /units/{unit_id}/task_definitions/{task_def_id}/task_resources

  • Method: DELETE

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 204

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/units/1/task_definitions/1/task_resources'
  • Response body:

    true

GET: Download the task resources

GET /units/{unit_id}/task_definitions/{task_def_id}/task_resources

  • URL: /units/{unit_id}/task_definitions/{task_def_id}/task_resources

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/units/1/task_definitions/1/task_resources'
  • Response body:

    <binary data of the zip file>

POST: Upload the task resources for a given task

POST /units/{unit_id}/task_definitions/{task_def_id}/task_resources

  • URL: /units/{unit_id}/task_definitions/{task_def_id}/task_resources

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    fileTask resources zipform-datafileYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X POST --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' -F "file=@/path/to/resources.zip" 'http://localhost:3000/units/1/task_definitions/1/task_resources'
  • Response body:

    true

POST: Upload the task sheet for a given task

POST /units/{unit_id}/task_definitions/{task_def_id}/task_sheet

  • URL: /units/{unit_id}/task_definitions/{task_def_id}/task_sheet

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    fileTask resources zipform-datafileYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X POST --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' -F "file=@/path/to/task_sheet.pdf" 'http://localhost:3000/units/1/task_definitions/1/task_sheet'
  • Response body:

    true

POST: Test overseer assessment for a given task

POST /units/{unit_id}/task_definitions/{task_def_id}/test_overseer_assessment

  • URL: /units/{unit_id}/task_definitions/{task_def_id}/test_overseer_assessment

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    file 0File 0 (optional)form-datafileNo
    file 1File 1 (optional)form-datafileNo
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X POST --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' -F "file0=@/path/to/file0" -F "file1=@/path/to/file1" 'http://localhost:3000/units/1/task_definitions/1/test_overseer_assessment'
  • Response body:

    {
    "status": "Overseer assessment performed successfully"
    }

POST: Upload the task assessment resources for a given task

POST /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources

  • URL: /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    fileTask assessment resources zipform-datafileYes
  • Response: 201 OK

  • Example Request:

    Terminal window
    curl -X POST --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' -F 'file=@/path/to/resources.zip' 'http://localhost:3000/api/units/1/task_definitions/2/task_assessment_resources'
  • Response body:

    true

DELETE: Remove the task assessment resources for a given task

DELETE /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources

  • URL: /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources

  • Method: DELETE

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 204 OK

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/api/units/1/task_definitions/2/task_assessment_resources'
  • Response body:

    true

GET: Download the task assessment resources

GET /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources

  • URL: /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit IDpathintegerYes
    task_def_idTask Definition IDpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/api/units/1/task_definitions/2/task_assessment_resources'
  • Response body:

    <binary data of the zip file>

GET /api/units/{unit_id}/task_definitions/{task_def_id}/task_pdf

  • URL: /api/units/{unit_id}/task_definitions/{task_def_id}/task_pdf

  • Method: GET

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idThe unit to upload tasks forpathintegerYes
    task_def_idThe task definition to get the PDF ofpathintegerYes
    as_attachmentWhether or not to download file as attachment. Default is false.querybooleanNo
    UsernameUsername of the userheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/pdf' --header 'Username: aadmin' --header 'Auth_Token: EJbyGkogpxtnNjXcvisj' 'http://localhost:3000/api/units/1/task_definitions/1/task_pdf?as_attachment=true'
  • Response Body:

    Download task_pdf?as_attachment=true

GET /api/units/{unit_id}/task_definitions/{task_def_id}/tasks

  • URL: /api/units/{unit_id}/task_definitions/{task_def_id}/tasks
  • Method: GET
  • Parameter:
ParameterDescriptionParameter TypeData TypeMandatory
unit_idThe unit containing the task definitionpathintegerYes
task_def_idThe task definition’s idpathintegerYes
UsernameUsername of the userheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/json' --header 'Username: atutor' --header 'Auth_Token: Ym3A6yiuucA-82kcxcgF' 'http://localhost:3000/api/units/1/task_definitions/1/tasks'
  • Response Body:

    [
    {
    "project_id": 2,
    "id": 12,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-22",
    "submission_date": "2024-04-20T10:56:18.978Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 3,
    "id": 31,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-21",
    "submission_date": "2024-04-20T10:56:24.059Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 4,
    "id": 45,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-16",
    "submission_date": "2024-04-20T10:57:04.514Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 5,
    "id": 63,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-21",
    "submission_date": "2024-04-20T10:57:35.703Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 7,
    "id": 86,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-19",
    "submission_date": "2024-04-20T10:58:28.084Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 8,
    "id": 105,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-16",
    "submission_date": "2024-04-20T10:58:33.116Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 9,
    "id": 127,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-16",
    "submission_date": "2024-04-20T10:58:38.421Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 10,
    "id": 146,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-17",
    "submission_date": "2024-04-20T10:58:43.259Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 11,
    "id": 165,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-23",
    "submission_date": "2024-04-20T10:59:13.681Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 12,
    "id": 177,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-23",
    "submission_date": "2024-04-20T10:59:16.725Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 13,
    "id": 201,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-19",
    "submission_date": "2024-04-20T10:59:22.471Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 15,
    "id": 226,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-18",
    "submission_date": "2024-04-20T10:59:48.270Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 16,
    "id": 245,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-23",
    "submission_date": "2024-04-20T10:59:53.349Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 17,
    "id": 269,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-19",
    "submission_date": "2024-04-20T11:00:28.887Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 18,
    "id": 288,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "complete",
    "completion_date": "2024-03-20",
    "submission_date": "2024-04-20T11:00:33.670Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 14,
    "id": 223,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "working_on_it",
    "completion_date": null,
    "submission_date": "2024-04-20T10:59:27.895Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 6,
    "id": 77,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "redo",
    "completion_date": null,
    "submission_date": "2024-04-20T10:58:04.345Z",
    "times_assessed": 1,
    "similarity_flag": false,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    },
    {
    "project_id": 1,
    "id": 3,
    "task_definition_id": 1,
    "tutorial_id": null,
    "tutorial_stream_id": null,
    "status": "demonstrate",
    "completion_date": "2024-03-18",
    "submission_date": "2024-04-20T10:56:15.653Z",
    "times_assessed": 1,
    "similarity_flag": true,
    "grade": null,
    "quality_pts": -1,
    "has_extensions": 0
    }
    ]

POST: Upload a zip file containing the task pdfs for a given task

POST /api/units/{unit_id}/task_definitions/task_pdfs

  • URL: /api/units/{unit_id}/task_definitions/task_pdfs

  • Method: POST

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idThe unit to upload tasks forpathintegerYes
    fileBatch file uploadformDatafileYes
    UsernameUsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 201

  • Example Request:

    Terminal window
    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: S8Qzr1uoToYidkezNeZL' -F file=@"1.1P submission.zip" 'http://localhost:3000/api/units/1/task_definitions/task_pdfs'
  • Response Body:

    {
    "success": [
    {
    "row": "1.1P submission.pdf",
    "message": "Added as task 1.1P"
    }
    ],
    "errors": [],
    "ignored": []
    }

DELETE: Remove the task sheet for a given task

DELETE /api/units/{unit_id}/task_definitions/{task_def_id}/task_sheet

  • URL: /api/units/{unit_id}/task_definitions/{task_def_id}/task_sheet

  • Method: DELETE

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idThe related unitpathintegerYes
    task_def_idThe related task definitionpathintegerYes
    UsernameUsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 204

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: Say13yA497H8wSFFXZxh' 'http://localhost:3000/api/units/1/task_definitions/12/task_sheet'
  • Response Body:

    true

POST: Upload the task sheet for a given task

POST /api/units/{unit_id}/task_definitions/{task_def_id}/task_sheet

  • URL: /api/units/{unit_id}/task_definitions/{task_def_id}/task_sheet

  • Method: POST

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idThe related unitpathintegerYes
    task_def_idThe related task definitionpathintegerYes
    fileThe task sheet pdfformDatafileYes
    UsernameUsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 201

  • Example Request:

    Terminal window
    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: S8Qzr1uoToYidkezNeZL' -F file=@"1.1P submission.pdf" 'http://localhost:3000/api/units/1/task_definitions/1/task_sheet'
  • Response Body:

    true

DELETE: Delete a task definition

DELETE /api/units/{unit_id}/task_definitions/{id}

  • URL: /api/units/{unit_id}/task_definitions/{id}

  • Method: DELETE

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUsername of the userheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    unit_idID of the unitheaderintegerYes
    idID of the taskpathintegerYes
  • Response: 204

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: Say13yA497H8wSFFXZxh' 'http://localhost:3000/api/units/1/task_definitions/1'
  • Response Body:

    true

PUT: Edits the given task definition

  • PUT /api/units/{unit_id}/task_definitions/{id}

  • URL: /api/units/{unit_id}/task_definitions/{id}

  • Method: PUT

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    id(required) The task id to editpathintegerYes
    task_def[tutorial_stream_abbr]The abbreviation of the tutorial streamformDatastring
    task_def[name]The name of this task defformDatastring
    task_def[description]The description of this task defformDatastring
    task_def[weighting]The weighting of this taskformDatainteger
    task_def[target_grade]Target grade for taskformDatainteger
    task_def[group_set_id]Related group setformDatainteger
    task_def[start_date]The date when the task should be startedformDatadate
    task_def[target_date]The date when the task is dueformDatadate
    task_def[due_date]The deadline dateformDatadate
    task_def[abbreviation]The abbreviation of the taskformDatastring
    task_def[restrict_status_updates]Restrict updating of the status to staffformDataboolean
    task_def[upload_requirements]Task file upload requirementsformDatastring
    task_def[plagiarism_checks]The list of checks to performformDatastring
    task_def[plagiarism_warn_pct]The percent at which to record and warn about plagiarismformDatainteger
    task_def[is_graded]Whether or not this task definition is a graded taskformDataboolean
    task_def[max_quality_pts]A range for quality points when quality is assessedformDatainteger
    task_def[assessment_enabled]Enable or disable assessmentformDataboolean
    task_def[overseer_image_id]The id of the Docker image name for overseerformDatainteger
    Username(required) UsernameheaderstringYes
    Auth_Token(required) Authentication tokenheaderstringYes
    unit_id(required)headerintegerYes
  • Response: 200

  • Example Request:

    Terminal window
    curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: EJbyGkogpxtnNjXcvisj' -d 'task_def%5Boverseer_image_id%5D=6578' 'http://localhost:3000/api/units/1/task_definitions/1'
  • Response Body:

    {
    "id": 1,
    "abbreviation": "1.1P",
    "name": "Pass Task 1.1 - Hello World",
    "description": "As a first step, create the classic 'Hello World' program. This will help ensure that you have all of the software installed correctly, and are ready to move on with creating other,,, programs.",
    "weighting": 1,
    "target_grade": 0,
    "target_date": "2024-03-19",
    "due_date": "2024-04-08",
    "start_date": "2024-03-12",
    "upload_requirements": [
    {
    "key": "file0",
    "name": "HelloWorld.pas",
    "type": "code"
    },
    {
    "key": "file1",
    "name": "Screenshot",
    "type": "image"
    }
    ],
    "tutorial_stream_abbr": "wrkshop-1",
    "plagiarism_checks": null,
    "plagiarism_warn_pct": 90,
    "restrict_status_updates": false,
    "group_set_id": null,
    "has_task_sheet": true,
    "has_task_resources": true,
    "has_task_assessment_resources": false,
    "is_graded": false,
    "max_quality_pts": 0,
    "overseer_image_id": 6578,
    "assessment_enabled": false,
    "moss_language": null
    }

POST: Add a new task definition to the given unit

POST /api/units/{unit_id}/task_definitions

  • URL: /api/units/{unit_id}/task_definitions

  • Method: POST

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    task_def[tutorial_stream_abbr]The abbreviation of tutorial streamformDatastringNo
    task_def[name]The name of this task defformDatastringYes
    task_def[description]The description of this task defformDatastringYes
    task_def[weighting]The weighting of this taskformDataintegerYes
    task_def[target_grade]Minimum grade for taskformDataintegerYes
    task_def[group_set_id]Related group setformDataintegerNo
    task_def[start_date]The date when the task should be startedformDatadateYes
    task_def[target_date]The date when the task is dueformDatadateYes
    task_def[due_date]The deadline dateformDatadateNo
    task_def[abbreviation]The abbreviation of the taskformDatastringYes
    task_def[restrict_status_updates]Restrict updating of the status to staffformDatabooleanNo
    task_def[upload_requirements]Task file upload requirementsformDatastringNo
    task_def[plagiarism_checks]The list of checks to performformDatastringNo
    task_def[plagiarism_warn_pct]The percent at which to record and warn about plagiarismformDataintegerYes
    task_def[is_graded]Whether or not this task definition is a graded taskformDatabooleanNo
    task_def[max_quality_pts]A range for quality points when quality is assessedformDataintegerYes
    task_def[assessment_enabled]Enable or disable assessmentformDatabooleanNo
    task_def[overseer_image_id]The id of the Docker image for overseerformDataintegerNo
    UsernameUsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    unit_idThe id for the unitpathintegerYes
  • Response: 201

  • Example Request:

    Terminal window
    curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: text/error' --header 'Username: aadmin' --header 'Auth_Token: EJbyGkogpxtnNjXcvisj' -d 'task_def%5Bname%5D=test_test123&task_def%5Bdescription%5D=test_test1234&task_def%5Bweighting%5D=55&task_def%5Btarget_grade%5D=0&task_def%5Bstart_date%5D=2024-06-09T00%3A00%3A00.000Z&task_def%5Btarget_date%5D=2024-09-20T00%3A00%3A00.000Z&task_def%5Babbreviation%5D=test_test123&task_def%5Brestrict_status_updates%5D=true&task_def%5Bplagiarism_warn_pct%5D=40&task_def%5Bis_graded%5D=true&task_def%5Bmax_quality_pts%5D=99' 'http://localhost:3000/api/units/1/task_definitions'
  • Response Body:

    {
    "id": 1234,
    "name": "Assignment 1",
    "description": "This is the first assignment",
    "weighting": 10,
    "target_grade": 80,
    "group_set_id": 5678,
    "start_date": "2024-06-01",
    "target_date": "2024-06-30",
    "due_date": "2024-07-05",
    "abbreviation": "ASS1",
    "restrict_status_updates": true,
    "upload_requirements": "PDF only",
    "plagiarism_checks": "Turnitin",
    "plagiarism_warn_pct": 20,
    "is_graded": true,
    "max_quality_pts": 5,
    "assessment_enabled": true,
    "overseer_image_id": 9876
    }