forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

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

postExamQuestionRefreshFromBank.ts17 lines, 652 bytesHistoryRawDownload
1import { client } from "../client";
2import type { ExamQuestion } from "../client";
3
4/**
5 * Re-copy the question's bank template over it — the escape hatch for a copy that
6 * drifted from its template (a bank↔exam copy is deep, never a live link). Only
7 * for a question that still has `from_bank`; the backend refuses with 409 once
8 * any attempt exists, and 400 when there is no template to refresh from.
9 */
10export function postExamQuestionRefreshFromBank(
11 examId: string,
12 questionId: string,
13): Promise<ExamQuestion> {
14 return client<ExamQuestion>(`/exams/${examId}/questions/${questionId}/refresh-from-bank`, {
15 method: "POST",
16 });
17}