forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

patchBankQuestionById.ts22 lines, 850 bytesHistoryRawDownload
1import { client } from "../client";
2import type { BankQuestion, BankVisibility, QuestionKind } from "../client";
3
4export 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
17export function patchBankQuestionById(
18 bankQuestionId: string,
19 body: PatchBankQuestionBody,
20): Promise<BankQuestion> {
21 return client<BankQuestion>(`/bank-questions/${bankQuestionId}`, { method: "PATCH", body });
22}