forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB078b459Burak Boduroğlu2 months ago671 commits

patchExamQuestionById.ts21 lines, 736 bytesHistoryRawDownload
1import { client } from "../client";
2import type { ExamQuestion, QuestionKind } from "../client";
3
4export 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
15export 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}