Skip to main content

Crate exercise_services_api

Crate exercise_services_api 

Source
Expand description

Wire types for the exercise-services client API (/api/v0/exercise-services/client), the HTTP surface a native client authenticates against and exchanges for course, exercise, and submission data. Consumed externally by tmc-langs-rust, so it stays free of server-internal dependencies; the openapi feature adds utoipa::ToSchema derives for the server’s own OpenAPI generation and is off by default for other consumers.

Structs§

AnswerFile
A file the host stored on a client’s behalf. The host assigns id; a client never invents one. Returned by the upload endpoint and echoed back by submission download.
Course
A course the current user can browse or is enrolled in.
CourseProgress
The current user’s progress across every exercise they can see in a course, returned by courses/{id}/progress in a single round-trip. Course-level totals are not sent separately; the client derives them by summing over exercises (e.g. total awarded = sum(score_given), total available = sum(score_maximum)).
ExerciseProgress
The current user’s progress on a single exercise.
ExerciseSlide
One selected slide of an exercise, carrying only the tasks whose exercise service can serve the requesting client. An exercise with no client-servable task is omitted entirely by endpoints that return this type, rather than appearing with an empty tasks.
ExerciseSlideSubmission
Body of POST exercises/{id}/submit. Plain JSON — no file parts, no archive: the previously uploaded files named here are the answer.
ExerciseSlideSubmissionListItem
A past submission of the current user to an exercise. id is the exercise-slide-submission id, which is what submissions/{id}/download takes.
ExerciseTask
One task of an exercise slide, as produced by a specific exercise service.
ExerciseTaskSubmissionResult
Result of a submit. Carries both ids so a client never re-derives one from the other: grading polling takes task_submission_id, download/share take slide_submission_id.
PasteResult
A shareable URL for a submission.
SubmissionFiles
Response of GET submissions/{id}/download: the files the submission was made from, recovered from the host’s own file records rather than from the service’s answer.
UploadedFiles
Response of POST exercises/{id}/files, in the same order as the request’s parts.

Enums§

AnswerKind
Which of the two representations an answer is: the JSON in data_json, or the files in data_files. A request that omits it means Json.
ExerciseTaskSubmissionStatus
The grading status of a task submission, as polled after submit.
GradingProgress
How far along a task submission’s grading is.

Type Aliases§

Token
The token exchanged at the OAuth2 token endpoint; its access_token is the bearer token sent with every other request in this API.