forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

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

postBankQuestion.ts17 lines, 625 bytesHistoryRawDownload
1import { client } from "../client";
2import type { BankQuestion, QuestionKind } from "../client";
3
4export type BankQuestionBody = {
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};
14
15export function postBankQuestion(body: BankQuestionBody): Promise<BankQuestion> {
16 return client<BankQuestion>(`/bank-questions`, { method: "POST", body });
17}