async fn get_module_completions(
req: HttpRequest,
path: Path<(String, Uuid)>,
pool: Data<PgPool>,
query: Query<GetCompletionsQueryParamers>,
) -> ControllerResult<HttpResponse>
Expand description
GET /api/v0/study-registry/completions/[:course_id | :uh_course_code | :course_slug]/:course_module_id
– Get completions from a single course module.
Gets all course completions for a submodule of a given course. The course identifier can either be its University of Helsinki course code, or a system-local slug or hash id. For module identifier, only the hash id is supported.
This endpoint is only available to authorized study registries, and requires a valid authorization token to access. Results are also streamed rather than included in the response body. In case of an error during transmission, an error message will be appended to the end of the broken stream output.
This endpoint returns an array of StudyRegistryCompletion structs.
§Excluding already registering completions.
If the study registry has already registered some completions, it can exclude them from the results. This is achieved by adding a query parameter ?exclude_already_registered=true
to the request. The value of the parameter is a boolean, and it defaults to false
.
§Example requests
Using University of Helsinki course code:
GET /api/v0/study-registry/completions/BSCS1001/caf3ccb2-abe9-4661-822c-20b117049dbf HTTP/1.1
Authorization: Basic documentationOnlyExampleSecretKey-12345
Content-Type: application/json
Using course slug:
GET /api/v0/study-registry/completions/introduction-to-programming/caf3ccb2-abe9-4661-822c-20b117049dbf HTTP/1.1
Authorization: Basic documentationOnlyExampleSecretKey-12345
Content-Type: application/json
Using course id:
GET /api/v0/study-registry/completions/b3e9575b-fa13-492c-bd14-10cb27df4eec/caf3ccb2-abe9-4661-822c-20b117049dbf HTTP/1.1
Authorization: Basic documentationOnlyExampleSecretKey-12345
Content-Type: application/json
Exclude already registereed:
```http
GET /api/v0/study-registry/completions/BSCS1001/caf3ccb2-abe9-4661-822c-20b117049dbf?exlcude_already_registered=true HTTP/1.1
Authorization: Basic documentationOnlyExampleSecretKey-12345
§Response TypeScript definition
type Vec<StudyRegistryCompletion> = Array<{
completion_date: string
completion_language: string
completion_registration_attempt_date: string | null
email: string
grade: StudyRegistryGrade
id: string
user_id: string
tier: number | null
}>
§Example response
[
{
"completion_date": "2022-06-21T00:00:00Z",
"completion_language": "en-US",
"completion_registration_attempt_date": null,
"email": "student@example.com",
"grade": {
"scale": "sis-0-5",
"grade": "4"
},
"id": "633852ce-c82a-4d60-8ab5-28745163f6f9",
"user_id": "307fa56f-9853-4f5c-afb9-a6736c232f32",
"tier": null
}
]