- 和题目页结果页签同一套:黄色小节标题「例子 N 没对上」、正文大小的说明、输入灰 / 正确输出绿 / 学生的输出红 - 这一页一栏 1200 宽,三格横着并排,正确输出和学生的输出一行对一行,不一样的那行两边都垫浅黄 - 窄于 600(手机、课堂任务的弹窗)自动退回竖排 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
566599614a
commit
6b37a4de80
5 files changed
+87
-13
No files matched your search
@@ -126,7 +126,7 @@ const current = computed(() => sampleRuns.value[selected.value] ?? null)
|
|||||||
:code="samplesCode?.value ?? ''"
|
:code="samplesCode?.value ?? ''"
|
||||||
:language="samplesCode?.language ?? ''"
|
:language="samplesCode?.language ?? ''"
|
||||||
:plain="inContest"
|
:plain="inContest"
|
||||||
section
|
section="stack"
|
||||||
/>
|
/>
|
||||||
<!-- 没跑完:编译不过、运行出错、超时 -->
|
<!-- 没跑完:编译不过、运行出错、超时 -->
|
||||||
<TrialErrorNote
|
<TrialErrorNote
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ const columns: DataTableColumn<JudgeCaseResult>[] = [
|
|||||||
>
|
>
|
||||||
<CompileErrorExplain v-if="compileError" :err-info="compileError" :language="submission.language" />
|
<CompileErrorExplain v-if="compileError" :err-info="compileError" :language="submission.language" />
|
||||||
<RuntimeErrorExplain v-if="runtimeError" :info="runtimeError" :code="submission.code" />
|
<RuntimeErrorExplain v-if="runtimeError" :info="runtimeError" :code="submission.code" />
|
||||||
<WrongAnswerExplain v-if="sampleCheck" full section :check="sampleCheck" :code="submission.code" :language="submission.language" />
|
<WrongAnswerExplain v-if="sampleCheck" full section="stack" :check="sampleCheck" :code="submission.code" :language="submission.language" />
|
||||||
<!-- 语法要求逐条对没对:和题面的「语法要求」同一个黄色小节标题 -->
|
<!-- 语法要求逐条对没对:和题面的「语法要求」同一个黄色小节标题 -->
|
||||||
<section v-if="submission.statisticInfo?.ast_results?.length">
|
<section v-if="submission.statisticInfo?.ast_results?.length">
|
||||||
<SectionHead icon="rules" tone="amber">语法要求</SectionHead>
|
<SectionHead icon="rules" tone="amber">语法要求</SectionHead>
|
||||||
|
|||||||
@@ -33,11 +33,14 @@ const props = defineProps<{
|
|||||||
*/
|
*/
|
||||||
peer?: boolean
|
peer?: boolean
|
||||||
/**
|
/**
|
||||||
* 题目页结果页签的样子(设计稿「题目页观感」结果 X):黄色小节标题说哪里不对,说明用正文大小,
|
* 新的样子(设计稿「题目页观感」结果 X):黄色小节标题说哪里不对,说明用正文大小,
|
||||||
* 输入 / 正确输出 / 你的输出竖着排成灰、绿、红三格,和题面的例子一个样子。
|
* 输入 / 正确输出 / 你的输出是灰、绿、红三格。
|
||||||
* 不给的话是原来那张浅灰卡片(提交详情页还在用)
|
* - stack:三格竖着排,和题面的例子一个样子。题目页的结果页签用(左栏只有 500 多宽)
|
||||||
|
* - row:三格横着并排,正确输出和你的输出一行对一行,不一样的那行两边都垫一层浅黄。
|
||||||
|
* 提交详情页用(一栏 1200 宽,多行输出对照着看);放不下(窄于 600,比如手机)就退回竖排
|
||||||
|
* 不给的话是原来那张浅灰卡片
|
||||||
*/
|
*/
|
||||||
section?: boolean
|
section?: 'stack' | 'row'
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const theme = useThemeVars()
|
const theme = useThemeVars()
|
||||||
@@ -121,7 +124,7 @@ function lines(text: string) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="section ? 'explain-section' : 'explain-card'">
|
<div :class="section ? ['explain-section', section] : 'explain-card'">
|
||||||
<template v-if="section">
|
<template v-if="section">
|
||||||
<SectionHead icon="problem" tone="amber">
|
<SectionHead icon="problem" tone="amber">
|
||||||
{{ check.passed ? '例子都对了,错在没给你看的测试点' : `例子 ${(check.index ?? 0) + 1} 没对上` }}
|
{{ check.passed ? '例子都对了,错在没给你看的测试点' : `例子 ${(check.index ?? 0) + 1} 没对上` }}
|
||||||
@@ -148,10 +151,10 @@ function lines(text: string) {
|
|||||||
<div class="label">正确输出</div>
|
<div class="label">正确输出</div>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<template v-for="(line, i) in lines(check.expected ?? '')" :key="i">
|
<template v-for="(line, i) in lines(check.expected ?? '')" :key="i">
|
||||||
<div v-if="i === diffLine && diffParts?.expected" class="line">
|
<div v-if="i === diffLine && diffParts?.expected" class="line hit">
|
||||||
<span v-text="diffParts.expected.before" /><span class="diff" v-text="diffParts.expected.marked" /><span v-text="diffParts.expected.after" />
|
<span v-text="diffParts.expected.before" /><span class="diff" v-text="diffParts.expected.marked" /><span v-text="diffParts.expected.after" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="line" v-text="line" />
|
<div v-else class="line" :class="{ hit: i === diffLine }" v-text="line" />
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -159,10 +162,10 @@ function lines(text: string) {
|
|||||||
<div class="label">{{ peer ? '学生' : '你' }}的输出</div>
|
<div class="label">{{ peer ? '学生' : '你' }}的输出</div>
|
||||||
<div v-if="check.output" class="text">
|
<div v-if="check.output" class="text">
|
||||||
<template v-for="(line, i) in lines(check.output)" :key="i">
|
<template v-for="(line, i) in lines(check.output)" :key="i">
|
||||||
<div v-if="i === diffLine && diffParts?.output" class="line">
|
<div v-if="i === diffLine && diffParts?.output" class="line hit">
|
||||||
<span v-text="diffParts.output.before" /><span class="diff" v-text="diffParts.output.marked" /><span v-text="diffParts.output.after" />
|
<span v-text="diffParts.output.before" /><span class="diff" v-text="diffParts.output.marked" /><span v-text="diffParts.output.after" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="line" v-text="line" />
|
<div v-else class="line" :class="{ hit: i === diffLine }" v-text="line" />
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="text empty">(什么都没有输出)</div>
|
<div v-else class="text empty">(什么都没有输出)</div>
|
||||||
@@ -336,4 +339,66 @@ function lines(text: string) {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: v-bind('theme.textColor3');
|
color: v-bind('theme.textColor3');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 横排(row,提交详情页):三格并排,标签在格子上面;行的左右留白挪到每一行上,
|
||||||
|
* 不一样的那行垫的浅黄才能铺满整格宽、两边对齐
|
||||||
|
*/
|
||||||
|
.explain-section.row {
|
||||||
|
container: explain-row / inline-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .blocks {
|
||||||
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .block {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
min-width: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .label {
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .text {
|
||||||
|
padding: 6px 0;
|
||||||
|
line-height: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .line {
|
||||||
|
min-height: 26px;
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .text.empty {
|
||||||
|
padding: 6px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .line.hit {
|
||||||
|
background-color: rgba(227, 160, 8, 0.14);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 放不下三格(窄于 600:手机、课堂任务的弹窗)就退回竖排 */
|
||||||
|
@container explain-row (max-width: 600px) {
|
||||||
|
.explain-section.row .blocks {
|
||||||
|
grid-template-columns: 64px minmax(0, 1fr);
|
||||||
|
gap: 6px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .block {
|
||||||
|
display: contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explain-section.row .label {
|
||||||
|
line-height: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -310,7 +310,15 @@ function handleMore(key: string) {
|
|||||||
class="code"
|
class="code"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<WrongAnswerExplain v-if="sampleCheck" :check="sampleCheck" :code="shown.code" :language="shown.language" :plain="!!shown.contestId" :peer="!own" />
|
<WrongAnswerExplain
|
||||||
|
v-if="sampleCheck"
|
||||||
|
section="row"
|
||||||
|
:check="sampleCheck"
|
||||||
|
:code="shown.code"
|
||||||
|
:language="shown.language"
|
||||||
|
:plain="!!shown.contestId"
|
||||||
|
:peer="!own"
|
||||||
|
/>
|
||||||
<ExplainNote v-else-if="explain" :explain="explain" :tone="explainTone" />
|
<ExplainNote v-else-if="explain" :explain="explain" :tone="explainTone" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,8 @@ B 看得到。
|
|||||||
例子对比竖着排成灰(输入)/ 绿(正确输出)/ 红(你的输出)三格,和题面的例子一个样子;
|
例子对比竖着排成灰(输入)/ 绿(正确输出)/ 红(你的输出)三格,和题面的例子一个样子;
|
||||||
运行时错误把出错那一行代码放进红格。「让 AI 分析我的代码」「用这组数据运行」是浅绿底按钮。
|
运行时错误把出错那一行代码放进红格。「让 AI 分析我的代码」「用这组数据运行」是浅绿底按钮。
|
||||||
做对了是「接着做」一节 + 写着下一题题号题名的大按钮(原来的浅绿卡片去掉了,竖栏里已经有进度)。
|
做对了是「接着做」一节 + 写着下一题题号题名的大按钮(原来的浅绿卡片去掉了,竖栏里已经有进度)。
|
||||||
提交详情页的答错对比(`WrongAnswerExplain` 不带 `section`)还是原来那张浅灰卡片。
|
提交详情页的答错对比同一套颜色和标题,但三格**横着并排**(`section="row"`):那一页一栏 1200 宽,
|
||||||
|
正确输出和学生的输出一行对一行,不一样的那行两边垫浅黄;窄于 600(手机、课堂任务的弹窗)退回竖排。
|
||||||
|
|
||||||
- **自动切换**:点「运行例子」「提交」或流程图「交给 AI 点评」后,自动切到「结果」对应的分段。
|
- **自动切换**:点「运行例子」「提交」或流程图「交给 AI 点评」后,自动切到「结果」对应的分段。
|
||||||
- **页签上的状态**:✕ 错了 / ✓ 对了 / ! 没交上(语法没过);用图标,不用 7px 的彩点。
|
- **页签上的状态**:✕ 错了 / ✓ 对了 / ! 没交上(语法没过);用图标,不用 7px 的彩点。
|
||||||
|
|||||||
Reference in new issue
Block a user