diff --git a/src/admin/api.ts b/src/admin/api.ts index eddffd1..ebb2d94 100644 --- a/src/admin/api.ts +++ b/src/admin/api.ts @@ -8,6 +8,7 @@ import type { BlankProblem, Contest, Exercise, + ExerciseType, Server, TestcaseUploadedReturns, Tutorial, @@ -272,7 +273,7 @@ export async function getAdminExercises(tutorialId: number) { export async function createExercise(data: { tutorial_id: number - type: "mcq" | "sort" | "fill" + type: ExerciseType data: object order: number }) { @@ -282,7 +283,7 @@ export async function createExercise(data: { export async function updateExercise(data: { id: number - type: "mcq" | "sort" | "fill" + type: ExerciseType data: object order: number }) { diff --git a/src/admin/tutorial/components/ExerciseManager.vue b/src/admin/tutorial/components/ExerciseManager.vue index 01a4e79..6d87712 100644 --- a/src/admin/tutorial/components/ExerciseManager.vue +++ b/src/admin/tutorial/components/ExerciseManager.vue @@ -1,9 +1,14 @@ @@ -208,6 +400,10 @@ function typeTagType(type: string): "success" | "info" | "warning" { 选择题 代码排序 代码填空 + 连线匹配 + 输出预测 + 代码找错 + 归类分组 @@ -251,7 +447,7 @@ function typeTagType(type: string): "success" | "info" | "warning" { @click=" () => { mcqOptions.splice(i, 1) - mcqAnswer.value = mcqAnswer.value + mcqAnswer = mcqAnswer .filter((a) => a !== i) .map((a) => (a > i ? a - 1 : a)) } @@ -287,7 +483,7 @@ function typeTagType(type: string): "success" | "info" | "warning" { -