feat(课堂): 布置这节课的题时可以选用什么语言做,学生用别的语言交对不算这份作业做完

class_lesson 加一列 language(0024,可空:以前布置的、按提交推断出来的课都不限语言)。
布置时有题不支持选的语言就整个拒掉并点名是哪几道;看板的格子、学生首页的做完状态、
提交列表「这节课」都只认这个语言的代码提交,流程图照旧算。看板多给 lastLanguage 当默认值。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-09-30 09:54:21 +08:00
1 parent e3be3cd62c
commit a18e129f4c
6 files changed
+4218 -19

No files matched your search

+6
View File
@@ -50,6 +50,7 @@ import type {
ProblemSetDifficulty,
ProblemSetStatus,
ReactionKey,
RunnableLanguage,
SqlConfig,
SqlDisplay,
TagCategory,
@@ -1477,6 +1478,11 @@ export const classLesson = pgTable(
className: text("class_name").notNull(),
day: text().notNull(),
problemIds: jsonb("problem_ids").notNull().$type<number[]>(),
/**
* 这份作业用什么语言做(Python / C / C++),老师布置时选。可空:加这一列之前布置的
* 没有它。写入侧在 PUT /classroom/lesson 按 runnableLanguageSchema 校验过
*/
language: text().$type<RunnableLanguage>(),
createdBy: integer("created_by").notNull(),
updatedAt: timestamp("updated_at", {
withTimezone: true,