Course grades

An course grade is the grade that a student will have for a specific course. Course grades reference courses to obtain general info such as max grades

The course grade model

The course grade model contains all the information about the courses.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the course grade.

  • Name
    course_id
    Type
    string
    Description

    Unique identifier for the course to be referenced.

  • Name
    student_id
    Type
    string
    Description

    Unique identifier for the student to be referenced.

  • Name
    minor_earned_grade
    Type
    number
    Description

    The score earned by the student on the course for minor grades. Shouldn't be higher than the course's minor max grade.

  • Name
    major_earned_grade
    Type
    number
    Description

    The score earned by the student on the course for major grades. Shouldn't be higher than the course's major max grade.

  • Name
    practice_earned_grade
    Type
    number
    Description

    The score earned by the student on the course for practice grades. Shouldn't be higher than the course's practice max grade.


POST/v1/course-grade/create

Create a course grade

This endpoint allows you to create a new course grade. All earned grades are null on creation.

Required parameters

  • Name
    course_id
    Type
    string
    Description

    Unique identifier for the course to be referenced.

  • Name
    student_id
    Type
    string
    Description

    Unique identifier for the student to be referenced.

Optional parameters

  • Name
    id
    Type
    string
    Description

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

Request

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

const client = new ApiClient(token)

await client.courseGrade.createCourseGrade({
  course_id: "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  student_id: "627a64c9-645a-491f-a851-b59331248af7",
})

Response

{
  "id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "course_id": "03792e42-c9f1-4097-88f0-1856a0451ec3",
  "student_id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "minor_earned_grade": null,
  "major_earned_grade": null,
  "practice_earned_grade": null,
		"created_at": "2024-07-04T15:30:24.209408+00:00"
}

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

Retrieve a course grade letter or percentage

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

Request

GET
/v1/course-grade/070b0afa-8be0-4b00-bbed-9ea8b9dead55
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.courseGrade.getGradeByType('070b0afa-8be0-4b00-bbed-9ea8b9dead55', 'percentage')
await client.courseGrade.getGradeByType('070b0afa-8be0-4b00-bbed-9ea8b9dead55', 'letter')

Response with percentage

{
  "id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "grade": 90.86
}

Response with letter grade

{
"id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
"grade": "A"
}

GET/v1/course-grade/:id

Retrieve a course grade

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

Request

GET
/v1/course-grade/070b0afa-8be0-4b00-bbed-9ea8b9dead55
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.courseGrade.getCourseGrade('070b0afa-8be0-4b00-bbed-9ea8b9dead55')

Response

{
  "id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "course_id": "03792e42-c9f1-4097-88f0-1856a0451ec3",
  "student_id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "minor_earned_grade": null,
  "major_earned_grade": null,
  "practice_earned_grade": null,
		"created_at": "2024-07-04T15:30:24.209408+00:00"
}

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

Update a course grade

This endpoint allows you to perform an update on a course grade. Only the student_id can be changed with this endpoint.

Optional parameters

  • Name
    student_id
    Type
    string
    Description

    Unique identifier for the student to be referenced.

Request

PATCH
/v1/course-grade/update/070b0afa-8be0-4b00-bbed-9ea8b9dead55
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.courseGrade.updateCourseGrade('03792e42-c9f1-4097-88f0-1856a0451ec3', {
    student_id: 'f4a1d759-7da9-447a-a013-8698f71867be'
})

Response

{
  "id": "070b0afa-8be0-4b00-bbed-9ea8b9dead55",
  "course_id": "03792e42-c9f1-4097-88f0-1856a0451ec3",
  "student_id": "f4a1d759-7da9-447a-a013-8698f71867be",
  "minor_earned_grade": null,
  "major_earned_grade": null,
  "practice_earned_grade": null,
		"created_at": "2024-07-04T15:30:24.209408+00:00"
}

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

Delete an course

This endpoint allows you to delete course grades. Note: This will permanently delete a student's course grade.

Request

DELETE
/v1/course-grade/delete/070b0afa-8be0-4b00-bbed-9ea8b9dead55
import ApiClient from '@example/protocol-api'

const client = new ApiClient(token)

await client.courseGrade.deleteCourseGrade('070b0afa-8be0-4b00-bbed-9ea8b9dead55')

Was this page helpful?