From 30f71c5db270ede6a436fd0f114b789dca715019 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 23 Apr 2026 13:48:36 -0600 Subject: [PATCH] add fills --- src/admin/api.ts | 4 +- .../tutorial/components/ExerciseManager.vue | 139 ++++++++++++--- src/admin/tutorial/detail.vue | 1 - src/oj/api.ts | 4 +- src/oj/learn/components/ExerciseFill.vue | 160 ++++++++++++++++++ src/oj/learn/components/ExerciseMcq.vue | 19 ++- src/oj/learn/components/ExerciseSort.vue | 74 ++++++-- src/oj/learn/components/ExerciseWidget.vue | 12 +- src/oj/learn/composables/useExerciseParse.ts | 10 +- src/oj/learn/index.vue | 46 ++++- src/shared/components/Header.vue | 37 ++-- src/shared/components/MermaidEditor.vue | 3 +- src/utils/types.ts | 9 +- 13 files changed, 435 insertions(+), 83 deletions(-) create mode 100644 src/oj/learn/components/ExerciseFill.vue diff --git a/src/admin/api.ts b/src/admin/api.ts index 2e68b2c..e0fb00c 100644 --- a/src/admin/api.ts +++ b/src/admin/api.ts @@ -263,7 +263,9 @@ export function setTutorialVisibility(id: number, is_public: boolean) { } export async function getAdminExercises(tutorialId: number) { - const res = await http.get("admin/exercise", { params: { tutorial_id: tutorialId } }) + const res = await http.get("admin/exercise", { + params: { tutorial_id: tutorialId }, + }) return res.data as Exercise[] } diff --git a/src/admin/tutorial/components/ExerciseManager.vue b/src/admin/tutorial/components/ExerciseManager.vue index c538ca3..9237a67 100644 --- a/src/admin/tutorial/components/ExerciseManager.vue +++ b/src/admin/tutorial/components/ExerciseManager.vue @@ -1,5 +1,10 @@ @@ -110,7 +150,9 @@ function typeName(type: string) {
共 {{ exercises.length }} 道练习题 - + 添加练习题 + + 添加练习题 @@ -119,11 +161,7 @@ function typeName(type: string) {
- + {{ typeName(ex.type) }} @@ -133,12 +171,16 @@ function typeName(type: string) { 将 [[exercise:{{ ex.id }}]] 粘贴到 Markdown 内容中 编辑 - 删除 + 删除 @@ -155,11 +197,16 @@ function typeName(type: string) { 选择题 代码排序 + 代码填空 - + -