hezarfen_frontend
Clone
https://git.tahinli.com/Hezarfen/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits
| 1 | import { client } from "../client"; |
| 2 | import type { Exam } from "../client"; |
| 3 | |
| 4 | export type PostInstanceExamBody = { |
| 5 | title: string; |
| 6 | description?: string | null; |
| 7 | kind: string; |
| 8 | /** The dönem the exam is filed in — its marks count into that term's karne. */ |
| 9 | term: string; |
| 10 | /** Omit for an offline-graded exam nobody can sit. */ |
| 11 | mode?: string | null; |
| 12 | starts_at?: number | null; |
| 13 | ends_at?: number | null; |
| 14 | duration_ms?: number | null; |
| 15 | /** Default 1; `0` = unlimited retakes. */ |
| 16 | max_attempts?: number | null; |
| 17 | allow_rejoin?: boolean | null; |
| 18 | allow_review?: boolean | null; |
| 19 | /** Keeps the exam private to the instance's managers until published. */ |
| 20 | draft?: boolean | null; |
| 21 | }; |
| 22 | |
| 23 | /** Only a class-delivered course (`kind` `course`) carries exams. */ |
| 24 | export function postInstanceExam(instanceId: string, body: PostInstanceExamBody): Promise<Exam> { |
| 25 | return client<Exam>(`/instances/${instanceId}/exams`, { method: "POST", body }); |
| 26 | } |