hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits
| 1 | import { client } from "../client"; |
| 2 | import type { BankQuestion, BankVisibility, QuestionKind } from "../client"; |
| 3 | |
| 4 | export type PatchBankQuestionBody = { |
| 5 | subject_id?: string; |
| 6 | text?: string; |
| 7 | kind?: QuestionKind; |
| 8 | points?: number; |
| 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 | /** Publishing (`school`) hands the answer key to every teacher — send it only on an explicit choice. */ |
| 14 | visibility?: BankVisibility; |
| 15 | }; |
| 16 | |
| 17 | export function patchBankQuestionById( |
| 18 | bankQuestionId: string, |
| 19 | body: PatchBankQuestionBody, |
| 20 | ): Promise<BankQuestion> { |
| 21 | return client<BankQuestion>(`/bank-questions/${bankQuestionId}`, { method: "PATCH", body }); |
| 22 | } |