diff --git a/apps/api/src/routes/classroom.ts b/apps/api/src/routes/classroom.ts index a7bceff..ad81606 100644 --- a/apps/api/src/routes/classroom.ts +++ b/apps/api/src/routes/classroom.ts @@ -1,4 +1,5 @@ import { + isSqlProblem, classComparisonRequestSchema, STUDENT_ROLES, classLessonRequestSchema, @@ -929,7 +930,7 @@ classroomRoutes.put("/classroom/lesson", requireTeacher, async (c) => { // SQL 题除外:它只收 SQL,C 的作业里夹一道也不会让人选错语言,计数那边也放行了 SQL if (language) { const unsupported = found - .filter((row) => !row.languages.includes(language) && !row.languages.includes("SQL")) + .filter((row) => !row.languages.includes(language) && !isSqlProblem(row)) .map((row) => row.displayId) if (unsupported.length) { return failure( diff --git a/apps/api/src/routes/contest.ts b/apps/api/src/routes/contest.ts index 4d15a17..300fffc 100644 --- a/apps/api/src/routes/contest.ts +++ b/apps/api/src/routes/contest.ts @@ -1,4 +1,5 @@ import { + isSqlProblem, contestPasswordRequestSchema, STUDENT_ROLES, type Contest, @@ -244,7 +245,7 @@ contestRoutes.get( allowFlowchart: problem.allowFlowchart, showFlowchart: problem.showFlowchart, hasAstRules: problem.astRules !== null, - isSql: problem.languages.includes("SQL"), + isSql: isSqlProblem(problem), myStatus: myStatusOf(statuses, problem.id), // 按人数是公开题库列表的列;比赛题表看的是榜单,不下发 solvedUsers: 0, diff --git a/apps/api/src/routes/problem.ts b/apps/api/src/routes/problem.ts index 696e424..822eedd 100644 --- a/apps/api/src/routes/problem.ts +++ b/apps/api/src/routes/problem.ts @@ -1,4 +1,5 @@ import { + isSqlProblem, normalizeLanguage, problemListSortSchema, problemTypeFilterSchema, @@ -121,7 +122,7 @@ function listItem( allowFlowchart: row.problem.allowFlowchart, showFlowchart: row.problem.showFlowchart, hasAstRules: row.problem.astRules !== null, - isSql: row.problem.languages.includes("SQL"), + isSql: isSqlProblem(row.problem), // 流程图评到 A / S 也打勾:problemStates 已经把它算进 solved myStatus: states?.solved.has(id) ? JudgeStatus.ACCEPTED diff --git a/apps/web/src/admin/problem/components/SQLTestcaseEditor.vue b/apps/web/src/admin/problem/components/SQLTestcaseEditor.vue deleted file mode 100644 index 91e5531..0000000 --- a/apps/web/src/admin/problem/components/SQLTestcaseEditor.vue +++ /dev/null @@ -1,352 +0,0 @@ - - - - - diff --git a/apps/web/src/oj/problem/components/ProblemContent.vue b/apps/web/src/oj/problem/components/ProblemContent.vue index 4ff4666..3c93429 100644 --- a/apps/web/src/oj/problem/components/ProblemContent.vue +++ b/apps/web/src/oj/problem/components/ProblemContent.vue @@ -1,4 +1,5 @@