hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB4e0a329Burak Boduroğlu2 months ago537 commits
| 1 | import { client } from "../client"; |
| 2 | import type { ExamQuestion, QuestionKind } from "../client"; |
| 3 | |
| 4 | export type PatchExamQuestionBody = { |
| 5 | subject_id?: string; |
| 6 | text?: string | null; |
| 7 | kind?: QuestionKind | null; |
| 8 | points?: number | null; |
| 9 | /** Each option carries its key: a known key keeps that option (and its image), any other is new. */ |
| 10 | choices?: { id?: string | null; text: string }[] | null; |
| 11 | /** Choice id — must name one of the submitted choices. */ |
| 12 | correct?: string | null; |
| 13 | }; |
| 14 | |
| 15 | export function patchExamQuestionById( |
| 16 | examId: string, |
| 17 | questionId: string, |
| 18 | body: PatchExamQuestionBody, |
| 19 | ): Promise<ExamQuestion> { |
| 20 | return client<ExamQuestion>(`/exams/${examId}/questions/${questionId}`, { method: "PATCH", body }); |
| 21 | } |