Assignment grades

An assignment grade is the grade that a student will have for a specific assignment. Assignment grades reference assignments to obtain general info such as max grades

The assignment grade model

The assignment grade model contains all the information about the assignments.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the assignment grade.

  • Name
    assignment_id
    Type
    string
    Description

    Unique identifier for the assignment to be referenced.

  • Name
    course_grade_id
    Type
    string
    Description

    Unique identifier for the course grade to be referenced. This course grade tne references the student id.

  • Name
    earned_grade
    Type
    number
    Description

    The score earned by the student on the assignment. Shouldn't be higher than the assignment's max grade. Null by default.

  • Name
    turned_in
    Type
    boolean
    Description

    Indicates if the student has turned in anything for the assignment

  • Name
    created_at
    Type
    string
    Description

    Timestamp of when the assignment was created. Generated automatically at creation in ISO 8601 format.


POST/v1/assignment-grade/create

Create an assignment grade

This endpoint allows you to create a new assignment grade.

Required parameters

  • Name
    assignment_id
    Type
    string
    Description

    Unique identifier for the assignment to be referenced.

  • Name
    course_grade_id
    Type
    string
    Description

    Unique identifier for the course grade to be referenced. This course grade tne references the student id.

  • Name
    earned_grade
    Type
    number
    Description

    The score earned by the student on the assignment. Shouldn't be higher than the assignment's max grade.

  • Name
    turned_in
    Type
    boolean
    Description

    Indicates if the student has turned in anything for the assignment

Optional parameters

  • Name
    id
    Type
    string
    Description

    Unique identifier for the assignment grade. Generates a random uuid by default

Request

POST
/v1/assignment-grade/create
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.assignmentGrade.createAssignmentGrade({
  assignment_id: "03792e42-c9f1-4097-88f0-1856a0451ec3",
  course_grade_id: "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  earned_grade: 31,
  turned_in: true
})

Response

{
  "id": "6eb0d026-a07e-4448-84f2-13532032e247",
  "assignment_id": "03792e42-c9f1-4097-88f0-1856a0451ec3",
  "course_grade_id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "earned_grade": 31,
  "turned_in": true,
		"created_at": "2024-07-05T18:27:56.231408+00:00"
}

GET/v1/assignment-grade/:id/:type

Retrieve an assignment grade letter or percentage

This endpoint allows you to retrieve an assignment grade in the form of a letter grade or a percentage rounded to the nearest hundredth. Provide the assignment grade id then the type which can be 'percentage' or 'letter'.

Request

GET
/v1/assignment-grade/6eb0d026-a07e-4448-84f2-13532032e247
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.assignmentGrade.getGradeByType('6eb0d026-a07e-4448-84f2-13532032e247', 'percentage')
await client.assignmentGrade.getGradeByType('6eb0d026-a07e-4448-84f2-13532032e247', 'letter')

Response with percentage

{
  "id": "6eb0d026-a07e-4448-84f2-13532032e247",
  "grade": 88.57
}

Response with letter grade

{
"id": "6eb0d026-a07e-4448-84f2-13532032e247",
"grade": "B"
}

GET/v1/assignment-grade/:id

Retrieve an assignment grade

This endpoint allows you to retrieve an assignment grade by providing the assignment grade id. Refer to the list at the top of this page to see which properties are included with assignment grade object.

Request

GET
/v1/assignment-grade/6eb0d026-a07e-4448-84f2-13532032e247
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.assignmentGrade.getAssignmentGrade('6eb0d026-a07e-4448-84f2-13532032e247')

Response

{
  "id": "6eb0d026-a07e-4448-84f2-13532032e247",
  "assignment_id": "03792e42-c9f1-4097-88f0-1856a0451ec3",
  "course_grade_id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "earned_grade": 31,
  "turned_in": true,
		"created_at": "2024-07-05T18:27:56.231408+00:00"
}

PATCH/v1/assignment-grade/update/:id

Update an assignment grade

This endpoint allows you to perform an update on an assignment grade. the id, course_grade_id, and assignment_id can't be changed. Changing the earned grade of the assignment will update the earned grade of the course accordingly.

Optional parameters

  • Name
    earned_grade
    Type
    number
    Description

    The score earned by the student on the assignment. Shouldn't be higher than the assignment's max grade.

  • Name
    turned_in
    Type
    boolean
    Description

    Indicates if the student has turned in anything for the assignment

Request

PATCH
/v1/assignment-grade/update/6eb0d026-a07e-4448-84f2-13532032e247
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.assignmentGrade.updateAssignmentGrade('03792e42-c9f1-4097-88f0-1856a0451ec3', {
    earned_grade: 32
})

Response

{
  "id": "6eb0d026-a07e-4448-84f2-13532032e247",
  "assignment_id": "03792e42-c9f1-4097-88f0-1856a0451ec3",
  "course_grade_id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "earned_grade": 32,
  "turned_in": true,
		"created_at": "2024-07-05T18:27:56.231408+00:00"
}

DELETE/v1/assignment-grade/delete/:id

Delete an assignment

This endpoint allows you to delete assignment grades. Note: This will permanently delete the assignment grade. The course earned grade will be adjusted accordingly when an assignment grade is deleted.

Request

DELETE
/v1/assignment-grade/delete/6eb0d026-a07e-4448-84f2-13532032e247
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.assignmentGrade.deleteAssignmentGrade('6eb0d026-a07e-4448-84f2-13532032e247')

Was this page helpful?