diff --git a/apps/web/src/oj/classroom/components/ExplainModal.vue b/apps/web/src/oj/classroom/components/ExplainModal.vue index 4e27a46..52a4805 100644 --- a/apps/web/src/oj/classroom/components/ExplainModal.vue +++ b/apps/web/src/oj/classroom/components/ExplainModal.vue @@ -15,11 +15,15 @@ import { useThemeVars } from "naive-ui" import SubmissionView from "oj/submission/components/SubmissionView.vue" import UserName from "shared/components/UserName.vue" import type { ClassBoardProblem } from "utils/types" +import ProblemBrief from "./ProblemBrief.vue" /** * 课堂看板「讲错误」(设计稿 BdOpen):点一个红格子或错法堆里的名字打开。老师在讲台上 * 一个个讲这道题错着的人,所以顶上是这几个人,← → 换人;下面和独立的提交详情页同一块 * (代码占满宽、为什么错在后),只是不出名字那一行、点「第几次」就地换。 + * + * 「题目」按钮:演示错误时题目和代码要并排(用户要的),点了左边出题目,再点收起。 + * 平时收着,代码照样占满宽。开没开记在这台电脑上,讲下一个人、下一道题还是那样 */ const props = defineProps<{ problem: ClassBoardProblem | null @@ -44,6 +48,7 @@ const vars = computed(() => ({ "--hover": theme.value.hoverColor, })) const current = computed(() => props.people[index.value] ?? null) +const showProblem = useStorage("oj_explain_show_problem", false) function step(delta: -1 | 1) { const next = index.value + delta @@ -87,6 +92,14 @@ onKeyStroke(["ArrowLeft", "ArrowRight"], (event) => { ←→ 换人
+ + 题目 + { - +
+ +
+ +
+
@@ -197,4 +217,25 @@ kbd { .spacer { flex: 1 1 0; } + +.body.split { + display: grid; + grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); + gap: 20px; + align-items: start; +} + +/* 题目自己滚:讲到代码后半段时题目还在旁边 */ +.statement { + position: sticky; + top: 0; + max-height: calc(100vh - 140px); + overflow: auto; + padding-right: 8px; + color: var(--text1); +} + +.main { + min-width: 0; +} diff --git a/apps/web/src/oj/classroom/components/ProblemBrief.vue b/apps/web/src/oj/classroom/components/ProblemBrief.vue new file mode 100644 index 0000000..eaca0a6 --- /dev/null +++ b/apps/web/src/oj/classroom/components/ProblemBrief.vue @@ -0,0 +1,122 @@ + + + + +