style: unify student exam pages with the dark exam theme

The three student exam pages still rendered on a white content panel, which
clashed with the dark student workspace used everywhere else. Register the
exam-only components in the UI standard (section 14) and move all three pages
onto one shared .exam-page token set, so button, option, table and tag styling
comes from a single stylesheet instead of per-page copies.
fix/exam-question-access-material-excel-delete-draft
chenyuan 2 months ago
parent 613a28a6b9
commit 61193f65de

@ -4,7 +4,7 @@
- **唯一标准页**:`/foundation/new-product-survey`(新产品调查与分析)。 - **唯一标准页**:`/foundation/new-product-survey`(新产品调查与分析)。
- **实现来源**:`src/views/foundation/new-product-survey.vue`。 - **实现来源**:`src/views/foundation/new-product-survey.vue`。
- **适用对象**:学生端全部实训任务页,包括产品、渠道、评估、测试等模块;不适用于教师端、平台管理端和登录页。 - **适用对象**:学生端全部实训任务页,包括产品、渠道、评估、测试等模块;同时适用于学生端考试模块(`/examination/index` 考试考核列表、`/examination/take/:id` 在线作答、`/examination/result/:id` 成绩详情),其差异化组件与令牌登记在第 14 节;不适用于教师端、平台管理端和登录页。
- **目标**:所有实训页面在布局层级、深色主题、文本对比度、表单、表格、按钮及 AI 侧栏上,呈现与标准页同一套产品体验。 - **目标**:所有实训页面在布局层级、深色主题、文本对比度、表单、表格、按钮及 AI 侧栏上,呈现与标准页同一套产品体验。
> 以后页面改造以本文件为验收依据。若现有页面的业务结构不同,保留业务内容和交互,只将视觉组件收敛到本规范;不使用旧的图片按钮、白底内容卡或浅色文字配浅色背景。 > 以后页面改造以本文件为验收依据。若现有页面的业务结构不同,保留业务内容和交互,只将视觉组件收敛到本规范;不使用旧的图片按钮、白底内容卡或浅色文字配浅色背景。
@ -449,3 +449,93 @@
3. 只改视觉与布局,不改业务逻辑和持久化。 3. 只改视觉与布局,不改业务逻辑和持久化。
4. 在本地 Vite 中编译目标页面;可登录时实际检查关键视图。 4. 在本地 Vite 中编译目标页面;可登录时实际检查关键视图。
5. 报告已对齐的项目与仍受业务结构限制的差异。 5. 报告已对齐的项目与仍受业务结构限制的差异。
## 14. 学生端考试模块
### 14.1 适用场景与令牌
适用于 `/examination/index`(考试考核列表)、`/examination/take/:id`(在线作答)、`/examination/result/:id`(成绩详情)。考试页没有步骤导航和 AI 侧栏,业务结构是"题目流 + 答题卡",因此第 4.5、5、10 节的结构条目不直接套用;其余全部沿用第 2、3、6、7、9、11 节。
考试模块的面板材质沿用已上线的考试列表页数值(第 4.5 节 `training-core` 的 `rgba(8,18,28,.60)` 在考试页的深色背景图上对比不足,故保留更实的蓝黑渐变),其余令牌与第 3 节一一对应:
| 令牌 | 值 | 对应第 3 节 |
| --- | --- | --- |
| `--exam-text` | `#e8f5ff` | 页面主文字 |
| `--exam-text-strong` | `#ffffff` | 强正文 |
| `--exam-secondary` | `#d7ecff` | 次正文 |
| `--exam-muted` | `#8eafc2` | 弱提示 |
| `--exam-accent` | `#71dfff` | 青蓝强调 |
| `--exam-panel` | `linear-gradient(145deg, rgba(6,34,58,.9), rgba(3,15,27,.94))` | 主工作台底色 |
| `--exam-panel-border` | `rgba(49,151,221,.34)` | 常规描边 |
| `--exam-card` | `rgba(1,14,26,.72)` | 深卡片底色(同第 9.1 节资料块) |
| `--exam-card-border` | `rgba(0,180,255,.22)` | 第 9.1 节资料块描边 |
| `--exam-line` | `rgba(127,186,215,.22)` | 第 9 节分隔线 |
| `--exam-ok` / `--exam-bad` / `--exam-pending` | `#57d9a8` / `#ff9b86` / `#7fd0ff` | 结果状态专用,仅用于对错与待评 |
| `--exam-current` | `#ffc861` | 当前题标记,与"已答"语义正交,允许独立色 |
| 圆角 | 面板与卡片 `14px`、选项与输入 `14px`、题号 `8px`、按钮 `999px` | 第 3 节圆角档位 |
### 14.2 页面框架
- 页面根元素必须带 `.exam-page` 类,由 `assets/styles/exam-theme.scss` 提供令牌、面板材质、文字基色和 Element Plus 深色覆盖。
- 外层面板:内边距 `28px 32px 34px`、圆角 `14px`、`--exam-panel` 底色 + `--exam-panel-border` 描边、下边距不小于 `32px`;不得再套第二层无边界大底板。
- 页头:左侧标题组(眉题 `12px/800/--exam-accent`、主标题 `28px/800/#f1f8ff`、说明 `14px/--exam-muted`),底部 `1px solid --exam-line` 分割线;页头右侧只放只读信息,不放操作按钮。眉题与说明均由业务数据提供,无有效内容时不渲染该层级,也不保留占位高度(同第 4.4 节)。
- 在线作答页主体为两列:`250px minmax(0,1fr)`、间距 `22px`;小于等于 `760px` 改单列。
- 卡片高度由内容决定,禁止用固定 `min-height` 撑出空白底板。
### 14.3 答题卡
- 适用场景:在线作答与成绩详情页用于快速跳题和查看作答/判分状态。层级为页面框架内的左侧栏,成绩详情页为 `.result-layout` 左列。
- 结构:`答题卡` 标题 → 按题型的分组(分组眉题 + 题号网格)→ 图例。成绩详情页无分组眉题时直接排布题号网格,不渲染空分组容器。
- 尺寸与间距:外层用 `--exam-card` 底 + `--exam-card-border` 描边、圆角 `14px`、内边距 `18px`;标题 `16px/800/#ffffff`,与网格间距 `18px`;分组眉题 `13px/700/--exam-muted`,与网格间距 `8px`;分组之间 `16px`;网格 `repeat(5, 1fr)`、间距 `7px`。
- 题号项:语义化 `button`,`aspect-ratio: 1`、圆角 `8px`、`14px/700`;默认 `--exam-secondary` 文字、透明底、`1px solid rgba(127,186,215,.35)`。
- 状态:已答为 `rgba(87,217,168,.16)` 底 + `rgba(87,217,168,.55)` 描边 + `#d9fff0` 文字;当前题叠加 `2px solid --exam-current` 外描边(`outline-offset: 1px`);判对/判错/待评分别用 `--exam-ok`/`--exam-bad`/`--exam-pending` 的 16% 透明底与 55% 透明描边,文字提亮为对应色。Hover 仅提高底色亮度,位移不超过 `1px`。
- 图例:`12px/--exam-muted`,色块 `10px × 10px`、圆角 `2px`,与文字间距 `5px`,项间距 `18px`,顶部用 `1px solid --exam-line` 与网格分隔。
- 交互:题号必须可点击并切换当前题,禁止只做视觉态;无题目数据时不渲染答题卡容器。
- 窄屏:小于等于 `760px` 取消 `position: sticky`,网格改为 `repeat(8, 1fr)` 并全宽排在题目卡之前。
### 14.4 考试倒计时
- 适用场景:在线作答页页头,用于提示剩余作答时间;只读信息,不是操作按钮。
- 结构与时序:时钟图标 → `剩余时间` 标签 → 时间数值,横向排列、间距 `8px`,位于页头中部。
- 字体与色值:图标与标签 `14px/--exam-muted`;数值 `22px/800/#7fe3ff`,必须使用 `font-variant-numeric: tabular-nums` 防止跳动。
- 状态:剩余时间不多于 `5` 分钟时数值改为 `#ffb35c`;仅允许颜色变化,不得闪烁、抖动或自动轮播(沿用第 5.3 节过渡约束)。时间归零由业务自动交卷,页面不额外做视觉告警。
- 窄屏:小于等于 `760px` 时倒计时独占页头第二行,左对齐、全宽。
### 14.5 题目卡与选项
- 层级:位于答题卡右侧的当前题内容卡,使用 `--exam-card` 底、`--exam-card-border` 描边、圆角 `14px`、内边距 `24px 28px 28px`。
- 头部:左侧题型眉题 `12px/800/--exam-accent`,右侧分值 `14px/800/--exam-secondary`,两端对齐,底部 `1px solid --exam-line`、下内边距 `12px`、与题干间距 `22px`。
- 题干:`18px/1.7/#eef5ff`,题号与题干同段,长题干自然换行,不截断。
- 选项:完全执行第 7.3 节——网格排列、间距 `8px`、非选中深色底与 `--exam-muted` 弱文字、选中使用激活标签渐变 `#0a6b9e → #0a5c86` 加白字与 `rgba(92,224,255,.7)` 描边;单项内边距 `14px 16px`、圆角 `14px`、行高 `1.5`、允许换行;选项字母用 `800` 字重与内容之间留 `12px`。判断题为两列。禁止暴露 Element Plus 默认白色选项与蓝色圆点。
- 简答题文本域与作答文件上传分别执行第 7.2、7.4 节;文本域不得设固定高度底板。
- 题目资料链接:`--exam-accent` 文字 + 下载图标,图标与文字间距 `6px`,位于题干下方、选项上方。
### 14.6 题目导航与交卷
- 上一题 / 下一题:按第 6.5 节的固定排版执行——位于题目卡内容之后、与题目卡间距 `22px`、桌面端水平居中、组内间距 `14px`、`min-height: 40px`、内边距 `0 18px`、圆角 `999px`、`14px/800`;上一题为小型轮廓按钮(第 6.1 节色值),下一题为常规主按钮(第 6.2 节渐变);首题禁用上一题、末题禁用下一题,禁用态 `opacity: .45`。禁止一左一右贴内容卡两端。
- 交卷:属于成果操作,按第 6.3 节底部大操作区实现——位于题目导航之后、间距 `36px`、桌面端居中、最小宽度 `172px`、高度 `64px`、内边距 `0 28px`、圆角 `6px`、`24px/900`、文字 `#dff7ff`、背景 `rgba(13,64,88,.62)`、描边 `#2c83aa`。不得放在页头,不得使用 `danger` 粉红或白色描边按钮。
- 交卷确认与自动交卷逻辑保持业务现状,本节只约束承载位置与视觉。
- 窄屏:小于等于 `900px` 时题目导航纵向全宽排列、间距 `14px`,交卷按钮同样全宽。
### 14.7 成绩带与作答详情
- 成绩带:位于页头下方的同级统计条,`1.25fr repeat(4, 1fr)` 网格;单元格内边距 `18px`、右侧 `1px solid --exam-line` 分隔;标签 `13px/--exam-muted`,数值 `19px/800/#7fe3ff`。
- 总分单元格:背景 `rgba(0,127,184,.25)`、描边 `rgba(106,226,255,.45)`(第 9 节步骤芯片同族),数值 `38px/900/#7fe3ff`,单位 `--exam-muted`。
- 作答详情:题干与选项按第 14.5 节;"你的答案 / 正确答案 / 答案解析"信息块按第 9.1 节资料信息块材质(`--exam-card` 底、`--exam-card-border` 描边、圆角 `14px`、内边距 `16px`),标签 `--exam-muted`、正文 `--exam-secondary`、`line-height: 1.65`;判分状态标签用第 14.1 节状态色,禁止白色标签底。作答附件链接与第 14.5 节题目资料链接同族:文字 `--exam-accent`、无背景无边框、距信息块 `12px`,文件名过长时自然换行,不得裁切。
- 窄屏:小于等于 `760px` 成绩带改为两列,作答详情与答题卡改为单列且答题卡在前。
### 14.8 实现约束
- 三页必须共用 `assets/styles/exam-theme.scss` 中 `.exam-page` 的令牌、面板材质、按钮类和 Element Plus 深色覆盖;页面 scoped 样式只保留自身布局,不得再各自定义一套 `--exam-*`(对应第 11 节第 5 条)。
- 教师端考试页(`views/teacherEnd/exam/*`)不在本节范围内,第 1 节的教师端排除仍然有效。
### 14.9 考试列表页(题卡流之外)
- 适用场景:`/examination/index`,用于按状态浏览可参加的考试、进入作答和查看已结束考试的成绩;它是考试模块的入口页,没有题目卡与答题卡。
- **页头只读规则**:页头承载主标题 `28px/800/#f1f8ff` 与说明 `14px/--exam-muted`,底部 `1px solid --exam-line` 分割线。页头**不放操作按钮**;唯一允许的例外是成绩/详情类页面左上角的**返回入口**——`el-button text`(`.is-text`),`14px/700`、文字 `--exam-accent`、无背景无边框、Hover 仅提亮为 `#a8efff`,位于主标题上方、独占一行。刷新等数据操作不得放在页头。
- **状态筛选工具栏**:位于页头分割线下方、与页头间距 `8px`,本身底部再用 `1px solid --exam-line` 收尾。页签使用语义化 `button`,`14px/--exam-muted`,计数 `b` 为 `--exam-secondary/600`、与文字间距 `7px`;激活项文字与下划线用 `--exam-accent`、字重 `600`,下划线高 `3px`、`border-radius: 3px 3px 0 0`、贴住底部分割线;页签横向间距 `30px`。
- **刷新入口**:允许且只允许一个圆形刷新按钮,位于筛选工具栏右端(`margin-left: auto`、与页签同一行),尺寸 `40px × 40px`、圆角 `50%`,使用第 6.1 节小型轮廓按钮的底色与描边,必须带 `title` 或 `aria-label` 说明用途。
- **考试行**:三列网格 `78px minmax(0,1fr) 150px`、列间距 `22px`、上下内边距 `22px 8px`,行之间用 `1px solid --exam-line` 分隔;日期块右侧竖线,日期数字 `28px/--exam-accent`、月份 `13px/--exam-muted`;考试名称 `18px/800`,状态标签使用第 14.1 节状态色;行右端为操作位,桌面端右对齐,进入考试/继续考试/查看成绩使用第 6.2 节常规主按钮,"未开始倒计时"和"未参加"为纯文本 `--exam-muted`,不渲染禁用按钮;"已交卷"是唯一的例外,保留禁用态常规主按钮以标记该考试的进入入口已关闭。
- **窄屏**:小于等于 `900px` 时页面内边距改为 `20px 16px 24px`;小于等于 `650px` 时考试行改两列、操作位移到第二列且左对齐,筛选工具栏间距降为 `14px` 并允许换行,刷新按钮不换行、留在当前行右端。
- **空数据**:当前筛选无考试时渲染 Element Plus 空状态,说明文字 `--exam-muted`;列表容器不设固定 `min-height`,不得渲染空行骨架或占位卡片(同第 14.2 节)。
- 考试名称、时间、时长、状态与倒计时均由接口数据提供,本节只定义承载结构与视觉,不固定任何文案。

@ -0,0 +1,179 @@
%exam-pill-action {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
height: 40px;
min-height: 40px;
padding: 0 18px;
border-radius: 999px;
font-size: 14px;
font-weight: 800;
cursor: pointer;
transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
/*
* 学生端考试模块主题:令牌、面板材质、按钮与 Element Plus 深色覆盖。
* 规范见 docs/student-training-ui-standard.md 第 14 节;页面 scoped 样式不得再定义另一套 --exam-*。
*/
.exam-page {
--exam-text: #e8f5ff;
--exam-text-strong: #ffffff;
--exam-secondary: #d7ecff;
--exam-muted: #8eafc2;
--exam-accent: #71dfff;
--exam-panel: linear-gradient(145deg, rgba(6, 34, 58, 0.9), rgba(3, 15, 27, 0.94));
--exam-panel-border: rgba(49, 151, 221, 0.34);
--exam-card: rgba(1, 14, 26, 0.72);
--exam-card-border: rgba(0, 180, 255, 0.22);
--exam-line: rgba(127, 186, 215, 0.22);
--exam-ok: #57d9a8;
--exam-bad: #ff9b86;
--exam-pending: #7fd0ff;
--exam-current: #ffc861;
--exam-primary-gradient: linear-gradient(110deg, #0b84bd, #096491);
--exam-primary-border: rgba(92, 224, 255, 0.7);
--exam-active-gradient: linear-gradient(110deg, #0a6b9e, #0a5c86);
--exam-outline-bg: rgba(17, 126, 178, 0.36);
--exam-outline-border: rgba(99, 217, 255, 0.55);
box-sizing: border-box;
color: var(--exam-text);
border: 1px solid var(--exam-panel-border);
border-radius: 14px;
background: var(--exam-panel);
box-shadow: 0 14px 36px rgba(0, 12, 30, 0.38), inset 0 1px 0 rgba(173, 225, 255, 0.08), 0 0 18px rgba(16, 109, 189, 0.25);
h1, h2, h3 { color: var(--exam-text-strong); }
p { color: var(--exam-muted); }
/* 第 6.1 节 小型轮廓按钮 */
.exam-outline-action {
@extend %exam-pill-action;
border: 1px solid var(--exam-outline-border);
background: var(--exam-outline-bg);
color: #e9fbff;
&:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(116, 235, 255, 0.85); background: rgba(18, 146, 204, 0.5); }
&:disabled { opacity: 0.45; cursor: not-allowed; }
}
/* 第 6.2 节 常规主按钮 */
.exam-primary-action {
@extend %exam-pill-action;
border: 1px solid var(--exam-primary-border);
background: var(--exam-primary-gradient);
color: #ffffff;
&:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(116, 235, 255, 0.85); }
&:disabled { opacity: 0.45; cursor: not-allowed; }
}
/* 第 6.3 节 底部大操作按钮 */
.exam-submit-action {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 172px;
height: 64px;
padding: 0 28px;
border: 1px solid #2c83aa;
border-radius: 6px;
background: rgba(13, 64, 88, 0.62);
color: #dff7ff;
font-size: 24px;
font-weight: 900;
cursor: pointer;
transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
&:hover { transform: translateY(-1px); border-color: rgba(116, 235, 255, 0.85); background: rgba(16, 82, 112, 0.72); }
}
/* Element Plus 深色覆盖:第 11 节第 4 条 */
.el-button {
height: 40px;
padding: 0 18px;
border: 1px solid var(--exam-outline-border);
border-radius: 999px;
background: var(--exam-outline-bg);
color: #e9fbff;
font-size: 14px;
font-weight: 800;
&:hover, &:focus { border-color: rgba(116, 235, 255, 0.85); background: rgba(18, 146, 204, 0.5); color: #f2fdff; }
&.is-circle { width: 40px; padding: 0; border-radius: 50%; }
&.el-button--primary {
border-color: var(--exam-primary-border);
background: var(--exam-primary-gradient);
color: #ffffff;
&:hover, &:focus { background: var(--exam-primary-gradient); color: #ffffff; }
}
&.is-text, &.el-button--text {
height: auto;
padding: 0;
border-color: transparent;
background: none;
color: var(--exam-accent);
font-weight: 700;
&:hover, &:focus { background: none; border-color: transparent; color: #a8efff; }
}
&:disabled { opacity: 0.45; cursor: not-allowed; }
&:disabled:not(.el-button--primary):hover { background: var(--exam-outline-bg); }
}
.el-tag {
border: 1px solid rgba(106, 226, 255, 0.45);
border-radius: 999px;
background: rgba(0, 127, 184, 0.25);
color: var(--exam-secondary);
&.el-tag--success { border-color: rgba(87, 217, 168, 0.55); background: rgba(87, 217, 168, 0.16); color: #b7f4dc; }
&.el-tag--danger { border-color: rgba(255, 155, 134, 0.55); background: rgba(255, 155, 134, 0.16); color: #ffd3c8; }
&.el-tag--info { border-color: rgba(127, 208, 255, 0.45); background: rgba(127, 208, 255, 0.14); color: #d6efff; }
}
.el-input__wrapper, .el-textarea__inner {
background: #0f1a24;
box-shadow: 0 0 0 1px rgba(45, 95, 126, 0.95) inset;
border-radius: 14px;
color: var(--exam-text);
}
.el-input__inner { color: var(--exam-text); }
.el-textarea__inner { padding: 12px 14px; line-height: 1.65; }
.el-input__inner::placeholder, .el-textarea__inner::placeholder { color: #8299aa; }
.el-input__wrapper.is-focus, .el-textarea__inner:focus { box-shadow: 0 0 0 1px rgba(92, 224, 255, 0.7) inset, 0 0 0 3px rgba(0, 174, 255, 0.13); }
/* 第 7.3 节 选项:整行为深色卡,选中用激活渐变,圆点不再是默认蓝色 */
.el-radio, .el-checkbox {
margin: 0;
height: auto;
padding: 14px 16px;
border: 1px solid rgba(127, 186, 215, 0.35);
border-radius: 14px;
background: var(--exam-card);
white-space: normal;
transition: border-color 0.2s ease, background 0.2s ease;
&:hover { border-color: rgba(99, 217, 255, 0.55); }
.el-radio__inner, .el-checkbox__inner {
width: 18px;
height: 18px;
border: 1px solid rgba(99, 217, 255, 0.55);
background: #0f1a24;
}
.el-radio__inner { border-radius: 50%; }
.el-radio__inner::after { background: var(--exam-accent); }
.el-checkbox__inner { border-radius: 5px; }
.el-checkbox__inner::after { border-color: #04121d; border-width: 2px; }
.el-radio__label, .el-checkbox__label { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; color: var(--exam-secondary); font-weight: 400; }
&.is-checked {
border-color: var(--exam-primary-border);
background: var(--exam-active-gradient);
.el-radio__label, .el-checkbox__label { color: #ffffff; }
.el-radio__inner, .el-checkbox__inner { border-color: var(--exam-accent); background: #062430; }
}
}
.el-empty__description p { color: var(--exam-muted); }
.el-loading-mask { background-color: rgba(3, 15, 27, 0.72); }
.el-icon { color: inherit; }
}
@media (max-width: 900px) {
.exam-page .exam-submit-action { width: 100%; }
}

@ -7,6 +7,7 @@
@import "./ruoyi.scss"; @import "./ruoyi.scss";
@import "./dialog.scss"; @import "./dialog.scss";
@import "./student-training.scss"; @import "./student-training.scss";
@import "./exam-theme.scss";
body { body {
height: 100%; height: 100%;

@ -1,14 +1,14 @@
<template> <template>
<main class="student-exams app-container" v-loading="loading"> <main class="student-exams exam-page" v-loading="loading">
<header class="page-head"><div><h1>考试考核</h1><p>按考试时间完成作答并查看已结束考试成绩</p></div><el-button :icon="Refresh" circle title="刷新" @click="load" /></header> <header class="page-head"><div><h1>考试考核</h1><p>按考试时间完成作答并查看已结束考试成绩</p></div></header>
<section class="status-filter"><button v-for="item in filters" :key="item.value" :class="{ active: filter === item.value }" @click="filter=item.value">{{ item.label }}<b>{{ count(item.value) }}</b></button></section> <section class="status-filter"><button v-for="item in filters" :key="item.value" :class="{ active: filter === item.value }" @click="filter=item.value">{{ item.label }}<b>{{ count(item.value) }}</b></button><el-button class="refresh" :icon="Refresh" circle title="刷新" @click="load" /></section>
<section class="exam-list"> <section class="exam-list">
<article v-for="exam in visibleExams" :key="exam.id" class="exam-row"> <article v-for="exam in visibleExams" :key="exam.id" class="exam-row">
<div class="date-block"><strong>{{ day(exam.startTime) }}</strong><span>{{ month(exam.startTime) }}</span></div> <div class="date-block"><strong>{{ day(exam.startTime) }}</strong><span>{{ month(exam.startTime) }}</span></div>
<div class="exam-info"><div><el-tag :type="statusMeta[exam.status].tone">{{ statusMeta[exam.status].label }}</el-tag><span v-if="exam.attemptStatus === 'SUBMITTED'" class="submitted">已交卷</span></div><h2>{{ exam.name }}</h2><p><el-icon><Clock /></el-icon>{{ formatTime(exam.startTime) }} 至 {{ formatTime(exam.endTime) }} · {{ exam.durationMinutes }} 分钟</p></div> <div class="exam-info"><div><el-tag :type="statusMeta[exam.status].tone">{{ statusMeta[exam.status].label }}</el-tag><span v-if="exam.attemptStatus === 'SUBMITTED'" class="submitted">已交卷</span></div><h2>{{ exam.name }}</h2><p><el-icon><Clock /></el-icon>{{ formatTime(exam.startTime) }} 至 {{ formatTime(exam.endTime) }} · {{ exam.durationMinutes }} 分钟</p></div>
<div class="exam-action"> <div class="exam-action">
<el-button v-if="exam.status === 'IN_PROGRESS'" type="primary" :disabled="exam.attemptStatus === 'SUBMITTED'" @click="enter(exam)">{{ exam.attemptStatus === 'IN_PROGRESS' ? '继续考试' : exam.attemptStatus === 'SUBMITTED' ? '已交卷' : '进入考试' }}</el-button> <el-button v-if="exam.status === 'IN_PROGRESS'" type="primary" :disabled="exam.attemptStatus === 'SUBMITTED'" @click="enter(exam)">{{ exam.attemptStatus === 'IN_PROGRESS' ? '继续考试' : exam.attemptStatus === 'SUBMITTED' ? '已交卷' : '进入考试' }}</el-button>
<el-button v-else-if="exam.status === 'ENDED' && exam.attemptStatus === 'SUBMITTED'" type="primary" plain @click="$router.push(`/examination/result/${exam.id}`)">查看成绩</el-button> <el-button v-else-if="exam.status === 'ENDED' && exam.attemptStatus === 'SUBMITTED'" type="primary" @click="$router.push(`/examination/result/${exam.id}`)">查看成绩</el-button>
<span v-else-if="exam.status === 'NOT_STARTED'">{{ countdown(exam.startTime) }}</span><span v-else>未参加</span> <span v-else-if="exam.status === 'NOT_STARTED'">{{ countdown(exam.startTime) }}</span><span v-else>未参加</span>
</div> </div>
</article> </article>
@ -27,20 +27,11 @@ function count(value){return value==="ALL"?exams.value.length:exams.value.filter
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.student-exams { .student-exams {
--exam-text: #e8f5ff;
--exam-muted: #8eafc2;
--exam-line: rgba(127, 186, 215, 0.22);
box-sizing: border-box;
width: 100%; width: 100%;
max-width: none; max-width: none;
min-height: calc(100vh - 104px); min-height: calc(100vh - 104px);
margin: 10px auto; margin: 10px auto 32px;
padding: 28px 32px 34px; padding: 28px 32px 34px;
color: var(--exam-text);
border: 1px solid rgba(49, 151, 221, 0.34);
border-radius: 14px;
background: linear-gradient(145deg, rgba(6, 34, 58, 0.9), rgba(3, 15, 27, 0.94));
box-shadow: 0 14px 36px rgba(0, 12, 30, 0.38), inset 0 1px 0 rgba(173, 225, 255, 0.08), 0 0 18px rgba(16, 109, 189, 0.25);
} }
.page-head { .page-head {
display: flex; display: flex;
@ -48,16 +39,17 @@ function count(value){return value==="ALL"?exams.value.length:exams.value.filter
align-items: flex-start; align-items: flex-start;
padding: 0 4px 20px; padding: 0 4px 20px;
border-bottom: 1px solid var(--exam-line); border-bottom: 1px solid var(--exam-line);
h1 { color: #f1f8ff; font-size: 28px; line-height: 1.2; margin: 0; letter-spacing: .02em; } h1 { font-size: 28px; line-height: 1.2; margin: 0; letter-spacing: .02em; }
p { color: var(--exam-muted); margin: 8px 0 0; font-size: 14px; } p { margin: 8px 0 0; font-size: 14px; }
:deep(.el-button.is-circle) { color: #31576e; border-color: rgba(255,255,255,.65); }
} }
.status-filter { .status-filter {
display: flex; display: flex;
align-items: center;
gap: 30px; gap: 30px;
border-bottom: 1px solid var(--exam-line); border-bottom: 1px solid var(--exam-line);
margin-top: 8px; margin-top: 8px;
button { .refresh { margin-left: auto; flex: 0 0 auto; }
button:not(.el-button) {
border: 0; border: 0;
background: none; background: none;
padding: 14px 2px 13px; padding: 14px 2px 13px;
@ -66,16 +58,15 @@ function count(value){return value==="ALL"?exams.value.length:exams.value.filter
position: relative; position: relative;
font-size: 14px; font-size: 14px;
transition: color .2s ease; transition: color .2s ease;
b { margin-left: 7px; font-weight: 600; color: #b8d0de; } b { margin-left: 7px; font-weight: 600; color: var(--exam-secondary); }
&:hover { color: #d9f3ff; } &:hover { color: var(--exam-text); }
&.active { color: #55d4ee; font-weight: 600; &:after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: #27c7e5; box-shadow: 0 0 10px rgba(39,199,229,.65); } } &.active { color: var(--exam-accent); font-weight: 600; &:after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--exam-accent); box-shadow: 0 0 10px rgba(113, 223, 255, .65); } }
} }
} }
.exam-list { min-height: 280px; } .exam-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 150px; gap: 22px; align-items: center; padding: 22px 8px; border-bottom: 1px solid var(--exam-line); }
.exam-row { display: grid; grid-template-columns: 78px 1fr 150px; gap: 22px; align-items: center; padding: 22px 8px; border-bottom: 1px solid var(--exam-line); } .date-block { border-right: 1px solid var(--exam-line); display: grid; text-align: center; strong { font-size: 28px; color: var(--exam-accent); } span { color: var(--exam-muted); font-size: 13px; } }
.date-block { border-right: 1px solid var(--exam-line); display: grid; text-align: center; strong { font-size: 28px; color: #5ed3ed; } span { color: var(--exam-muted); font-size: 13px; } } .exam-info { h2 { font-size: 18px; font-weight: 800; margin: 9px 0; } .submitted { margin-left: 8px; color: var(--exam-ok); font-size: 13px; } p { display: flex; align-items: center; gap: 5px; margin: 0; } }
.exam-info { h2 { color: #edf8ff; font-size: 18px; margin: 9px 0; } .submitted { margin-left: 8px; color: #7ed9bd; font-size: 13px; } p { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--exam-muted); } }
.exam-action { text-align: right; color: var(--exam-muted); } .exam-action { text-align: right; color: var(--exam-muted); }
:deep(.el-empty__description p) { color: var(--exam-muted); } @media(max-width:900px){.student-exams{padding:20px 16px 24px}}
@media(max-width:650px){.student-exams{width:calc(100% - 12px);padding:20px 16px 24px}.exam-row{grid-template-columns:58px 1fr}.exam-action{grid-column:2;text-align:left}.status-filter{gap:14px;overflow-x:auto}} @media(max-width:650px){.student-exams{width:calc(100% - 12px)}.exam-row{grid-template-columns:58px 1fr}.exam-action{grid-column:2;text-align:left}.status-filter{gap:14px;flex-wrap:wrap}}
</style> </style>

@ -1,19 +1,39 @@
<template> <template>
<main class="result-page app-container" v-loading="loading"> <main class="result-page exam-page" v-loading="loading">
<header><el-button text :icon="ArrowLeft" @click="$router.push('/examination/index')">返回考试列表</el-button><h1>{{ result.examName }}</h1><p>试卷成绩与作答详情</p></header> <header><el-button text :icon="ArrowLeft" @click="$router.push('/examination/index')">返回考试列表</el-button><h1>{{ result.examName }}</h1><p>试卷成绩与作答详情</p></header>
<section class="score-band"><div class="total"><span>总成绩</span><strong>{{ result.totalScore || 0 }}</strong><small>分</small></div><div><span>客观题正确率</span><b>{{ result.objectiveAccuracy || 0 }}%</b></div><div><span>答对</span><b>{{ result.objectiveCorrect || 0 }} 题</b></div><div><span>答错</span><b>{{ result.objectiveWrong || 0 }} 题</b></div><div><span>主观题得分</span><b>{{ result.subjectiveScore || 0 }} 分</b></div></section> <section class="score-band"><div class="total"><span>总成绩</span><strong>{{ result.totalScore || 0 }}</strong><small>分</small></div><div><span>客观题正确率</span><b>{{ result.objectiveAccuracy || 0 }}%</b></div><div><span>答对</span><b>{{ result.objectiveCorrect || 0 }} 题</b></div><div><span>答错</span><b>{{ result.objectiveWrong || 0 }} 题</b></div><div><span>主观题得分</span><b>{{ result.subjectiveScore || 0 }} 分</b></div></section>
<div class="result-layout"><aside><h2>答题卡</h2><div><button v-for="q in result.questions||[]" :key="q.id" :class="answerClass(q)" @click="currentId=q.id">{{ q.order }}</button></div></aside> <div class="result-layout"><aside><h2>答题卡</h2><div><button v-for="q in result.questions||[]" :key="q.id" :class="answerClass(q)" @click="currentId=q.id">{{ q.order }}</button></div></aside>
<article v-if="current" class="result-question"><header><el-tag :type="current.correct===false?'danger':'success'">{{ current.type==='SHORT_ANSWER'?'教师评分':current.correct?'回答正确':'回答错误' }}</el-tag><b>{{ current.awardedScore || 0 }} / {{ current.score }} 分</b></header><h2>{{ current.order }}. {{ current.stem }}</h2><p v-for="o in current.options" :key="o.label">{{ o.label }}. {{ o.content }}</p><dl><dt>你的答案</dt><dd>{{ display(current.studentAnswer) }}</dd><dt>正确答案</dt><dd>{{ display(current.answer) }}</dd><template v-if="current.analysis"><dt>答案解析</dt><dd>{{ current.analysis }}</dd></template></dl><a v-if="current.answerFileUrl" :href="current.answerFileUrl" target="_blank">作答附件:{{ current.answerFileName }}</a></article></div> <article v-if="current" class="result-question"><header><el-tag :type="current.type==='SHORT_ANSWER'?'info':current.correct===false?'danger':'success'">{{ current.type==='SHORT_ANSWER'?'教师评分':current.correct?'回答正确':'回答错误' }}</el-tag><b>{{ current.awardedScore || 0 }} / {{ current.score }} 分</b></header><h2>{{ current.order }}. {{ current.stem }}</h2><p v-for="o in current.options" :key="o.label">{{ o.label }}. {{ o.content }}</p><dl><dt>你的答案</dt><dd>{{ display(current.studentAnswer) }}</dd><dt>正确答案</dt><dd>{{ display(current.answer) }}</dd><template v-if="current.analysis"><dt>答案解析</dt><dd>{{ current.analysis }}</dd></template></dl><a v-if="current.answerFileUrl" :href="current.answerFileUrl" target="_blank">作答附件:{{ current.answerFileName }}</a></article></div>
</main> </main>
</template> </template>
<script setup> <script setup>
import{computed,onMounted,ref}from"vue";import{useRoute}from"vue-router";import{ArrowLeft}from"@element-plus/icons-vue";import{getExamResult}from"@/api/exam";const route=useRoute(),loading=ref(false),result=ref({questions:[]}),currentId=ref(null);const current=computed(()=>result.value.questions?.find(q=>q.id===currentId.value));onMounted(async()=>{loading.value=true;try{result.value=(await getExamResult(route.params.id)).data;currentId.value=result.value.questions?.[0]?.id}finally{loading.value=false}});function display(v){if(Array.isArray(v))return v.join("、");if(v===true)return"正确";if(v===false)return"错误";return v||"未作答"}function answerClass(q){return{current:q.id===currentId.value,wrong:q.correct===false,right:q.correct===true,subjective:q.type==="SHORT_ANSWER"}} import{computed,onMounted,ref}from"vue";import{useRoute}from"vue-router";import{ArrowLeft}from"@element-plus/icons-vue";import{getExamResult}from"@/api/exam";const route=useRoute(),loading=ref(false),result=ref({questions:[]}),currentId=ref(null);const current=computed(()=>result.value.questions?.find(q=>q.id===currentId.value));onMounted(async()=>{loading.value=true;try{result.value=(await getExamResult(route.params.id)).data;currentId.value=result.value.questions?.[0]?.id}finally{loading.value=false}});function display(v){if(Array.isArray(v))return v.join("、");if(v===true)return"正确";if(v===false)return"错误";return v||"未作答"}function answerClass(q){return{current:q.id===currentId.value,wrong:q.correct===false,right:q.correct===true,subjective:q.type==="SHORT_ANSWER"}}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.result-page { width: 100%; max-width: none; margin: auto; color: #20282d; > header h1 { font-size: 25px; margin: 12px 0 4px; } > header p { color: #6b7280; margin: 0; } } .result-page { min-height: calc(100vh - 104px); margin: 10px auto 32px; padding: 28px 32px 34px; }
.score-band { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); margin: 24px 0; border-block: 1px solid #dce3e5; > div { padding: 18px; border-right: 1px solid #e4e8ea; display: grid; gap: 6px; span { color: #6b7280; font-size: 13px; } b { font-size: 19px; color: #185e70; } } .total { grid-template-columns: auto auto 1fr; align-items: end; background: #edf7f4; span { grid-column: 1 / 4; } strong { font-size: 38px; color: #11657a; } small { padding-bottom: 7px; } } } .result-page > header { padding: 0 4px 20px; border-bottom: 1px solid var(--exam-line);
.result-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; } h1 { font-size: 28px; font-weight: 800; line-height: 1.2; color: #f1f8ff; margin: 12px 0 0; letter-spacing: .02em; } p { color: var(--exam-muted); font-size: 14px; margin: 8px 0 0; }
aside { border-right: 1px solid #dce3e5; padding-right: 20px; h2 { font-size: 16px; } div { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; } button { aspect-ratio: 1; border: 1px solid #ccd5d8; background: #fff; border-radius: 3px; &.right { background: #dff3ea; border-color: #61a88b; } &.wrong { background: #fde8e5; border-color: #d87a6e; } &.subjective { background: #e7eef7; border-color: #7696bc; } &.current { outline: 2px solid #e4a53c; outline-offset: 1px; } } } }
.result-question { padding: 6px 12px; > header { display: flex; justify-content: space-between; } h2 { font-size: 18px; line-height: 1.7; margin: 20px 0; } p { color: #4b5563; } dl { display: grid; grid-template-columns: 90px 1fr; gap: 10px; background: #f6f8f8; padding: 16px; margin-top: 22px; dt { color: #6b7280; } dd { margin: 0; white-space: pre-wrap; line-height: 1.6; } } a { display: inline-block; color: #176b87; margin-top: 12px; } } .score-band { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); margin: 24px 0; border-block: 1px solid var(--exam-line);
@media(max-width:760px){.score-band{grid-template-columns:1fr 1fr}.result-layout{grid-template-columns:1fr}aside{border-right:0;border-bottom:1px solid #dce3e5;padding-bottom:18px}} > div { padding: 18px; border-right: 1px solid var(--exam-line); display: grid; gap: 6px; span { color: var(--exam-muted); font-size: 13px; } b { font-size: 19px; font-weight: 800; color: #7fe3ff; } }
.total { grid-template-columns: auto auto 1fr; align-items: end; border: 1px solid rgba(106, 226, 255, .45); border-radius: 14px; background: rgba(0, 127, 184, .25); span { grid-column: 1 / 4; } strong { font-size: 38px; font-weight: 900; color: #7fe3ff; } small { padding-bottom: 7px; color: var(--exam-muted); } }
}
.result-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.result-layout aside { background: var(--exam-card); border: 1px solid var(--exam-card-border); border-radius: 14px; padding: 18px;
h2 { font-size: 16px; font-weight: 800; margin: 0 0 18px; } div { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
button { aspect-ratio: 1; border: 1px solid rgba(127, 186, 215, .35); background: transparent; border-radius: 8px; color: var(--exam-secondary); font-size: 14px; font-weight: 700; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease;
&:hover { border-color: rgba(99, 217, 255, .55); transform: translateY(-1px); }
&.right { background: rgba(87, 217, 168, .16); border-color: rgba(87, 217, 168, .55); color: var(--exam-ok); }
&.wrong { background: rgba(255, 155, 134, .16); border-color: rgba(255, 155, 134, .55); color: var(--exam-bad); }
&.subjective { background: rgba(127, 208, 255, .16); border-color: rgba(127, 208, 255, .55); color: var(--exam-pending); }
&.current { outline: 2px solid var(--exam-current); outline-offset: 1px; } }
}
.result-question { background: var(--exam-card); border: 1px solid var(--exam-card-border); border-radius: 14px; padding: 24px 28px 28px;
> header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--exam-line); padding-bottom: 12px; b { font-size: 14px; font-weight: 800; color: var(--exam-secondary); } }
h2 { font-size: 18px; line-height: 1.7; color: var(--exam-text); margin: 22px 0; }
> p { color: var(--exam-secondary); line-height: 1.5; margin: 0 0 8px; }
dl { display: grid; grid-template-columns: 90px 1fr; gap: 10px 14px; background: rgba(1, 14, 26, .72); border: 1px solid var(--exam-card-border); border-radius: 14px; padding: 16px; margin: 22px 0 0; dt { color: var(--exam-muted); } dd { margin: 0; color: var(--exam-secondary); white-space: pre-wrap; line-height: 1.65; } }
a { display: inline-block; color: var(--exam-accent); margin-top: 12px; }
}
@media(max-width:760px){.result-page{padding:20px 16px 24px}.score-band{grid-template-columns:1fr 1fr}.result-layout{grid-template-columns:1fr}.result-layout aside{position:static}.result-question{padding:20px 18px 22px}}
</style> </style>

@ -1,6 +1,6 @@
<template> <template>
<main class="take-page" v-loading="loading"> <main class="take-page exam-page" v-loading="loading">
<header class="take-head"><div><h1>{{ paper.name }}</h1><p>考试结束时间 {{ formatTime(paper.endTime) }}</p></div><div class="timer" :class="{ urgent: remaining < 300 }"><el-icon><Timer /></el-icon><span>剩余时间</span><strong>{{ timerText }}</strong></div><el-button type="danger" plain @click="confirmSubmit">交卷</el-button></header> <header class="take-head"><div class="head-title"><h1>{{ paper.name }}</h1><p>考试结束时间 {{ formatTime(paper.endTime) }}</p></div><div class="timer" :class="{ urgent: remaining < 300 }"><el-icon><Timer /></el-icon><span>剩余时间</span><strong>{{ timerText }}</strong></div></header>
<div class="exam-body"> <div class="exam-body">
<aside class="answer-sheet"><h2>答题卡</h2><div v-for="group in grouped" :key="group.type" class="sheet-group"><h3>{{ typeName[group.type] }}</h3><div><button v-for="question in group.items" :key="question.id" :class="{current:current?.id===question.id,answered:isAnswered(question)}" @click="select(question.id)">{{ question.order }}</button></div></div><footer><span><i class="answered-dot" />已答</span><span><i />未答</span></footer></aside> <aside class="answer-sheet"><h2>答题卡</h2><div v-for="group in grouped" :key="group.type" class="sheet-group"><h3>{{ typeName[group.type] }}</h3><div><button v-for="question in group.items" :key="question.id" :class="{current:current?.id===question.id,answered:isAnswered(question)}" @click="select(question.id)">{{ question.order }}</button></div></div><footer><span><i class="answered-dot" />已答</span><span><i />未答</span></footer></aside>
<section v-if="current" class="question-panel"> <section v-if="current" class="question-panel">
@ -9,10 +9,11 @@
<el-radio-group v-if="current.type==='SINGLE'" v-model="answers[current.id]" class="choice-list" @change="persist(current)"><el-radio v-for="option in current.options" :key="option.label" :label="option.label"><b>{{ option.label }}</b>{{ option.content }}</el-radio></el-radio-group> <el-radio-group v-if="current.type==='SINGLE'" v-model="answers[current.id]" class="choice-list" @change="persist(current)"><el-radio v-for="option in current.options" :key="option.label" :label="option.label"><b>{{ option.label }}</b>{{ option.content }}</el-radio></el-radio-group>
<el-checkbox-group v-else-if="current.type==='MULTIPLE'" v-model="answers[current.id]" class="choice-list" @change="persist(current)"><el-checkbox v-for="option in current.options" :key="option.label" :label="option.label"><b>{{ option.label }}</b>{{ option.content }}</el-checkbox></el-checkbox-group> <el-checkbox-group v-else-if="current.type==='MULTIPLE'" v-model="answers[current.id]" class="choice-list" @change="persist(current)"><el-checkbox v-for="option in current.options" :key="option.label" :label="option.label"><b>{{ option.label }}</b>{{ option.content }}</el-checkbox></el-checkbox-group>
<el-radio-group v-else-if="current.type==='TRUE_FALSE'" v-model="answers[current.id]" class="choice-list judgement" @change="persist(current)"><el-radio :label="true"><b>✓</b>正确</el-radio><el-radio :label="false"><b>×</b>错误</el-radio></el-radio-group> <el-radio-group v-else-if="current.type==='TRUE_FALSE'" v-model="answers[current.id]" class="choice-list judgement" @change="persist(current)"><el-radio :label="true"><b>✓</b>正确</el-radio><el-radio :label="false"><b>×</b>错误</el-radio></el-radio-group>
<template v-else><el-input v-model="answers[current.id]" type="textarea" :rows="10" placeholder="请输入答案" @blur="persist(current)" /><div class="file-answer"><el-upload :show-file-list="false" :http-request="uploadAnswer" accept=".pdf,.doc,.docx,.png,.jpg,.jpeg"><el-button :icon="Upload">上传作答文件</el-button></el-upload><span v-if="files[current.id]">{{ files[current.id].name }}</span></div></template> <template v-else><el-input v-model="answers[current.id]" type="textarea" :rows="10" placeholder="请输入答案" @blur="persist(current)" /><div class="file-answer"><el-upload :show-file-list="false" :http-request="uploadAnswer" accept=".pdf,.doc,.docx,.png,.jpg,.jpeg"><el-button type="primary" :icon="Upload">上传作答文件</el-button></el-upload><span v-if="files[current.id]">{{ files[current.id].name }}</span></div></template>
<footer class="question-actions"><el-button :icon="ArrowLeft" :disabled="currentIndex===0" @click="move(-1)">上一题</el-button><el-button type="primary" :disabled="currentIndex===paper.questions.length-1" @click="move(1)">下一题<el-icon class="el-icon--right"><ArrowRight /></el-icon></el-button></footer>
</section> </section>
</div> </div>
<footer v-if="paper.questions?.length" class="exam-actions"><button class="exam-outline-action" :disabled="currentIndex===0" @click="move(-1)"><el-icon><ArrowLeft /></el-icon>上一题</button><button class="exam-primary-action" :disabled="currentIndex===paper.questions.length-1" @click="move(1)">下一题<el-icon><ArrowRight /></el-icon></button></footer>
<div v-if="paper.questions?.length" class="exam-submit"><button class="exam-submit-action" @click="confirmSubmit">交卷</button></div>
</main> </main>
</template> </template>
<script setup> <script setup>
@ -30,26 +31,28 @@ async function autoSubmit(){try{await doSubmit()}catch{router.replace("/examinat
function formatTime(v){return v?new Date(v).toLocaleString("zh-CN",{hour12:false}).replaceAll("/","-"):"-"} function formatTime(v){return v?new Date(v).toLocaleString("zh-CN",{hour12:false}).replaceAll("/","-"):"-"}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.take-page { min-height: calc(100vh - 84px); background: #f3f6f6; color: #20282d; } .take-page { min-height: calc(100vh - 104px); margin: 10px auto 32px; padding: 28px 32px 34px; }
.take-head { height: 78px; background: #fff; border-bottom: 1px solid #dce3e5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 28px; .take-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 0 4px 20px; border-bottom: 1px solid var(--exam-line);
h1 { font-size: 20px; margin: 0; } p { margin: 5px 0 0; color: #6b7280; font-size: 13px; } > button { justify-self: end; } h1 { font-size: 28px; font-weight: 800; line-height: 1.2; margin: 0; letter-spacing: .02em; } p { margin: 8px 0 0; color: var(--exam-muted); font-size: 14px; }
.timer { display: flex; align-items: center; gap: 8px; color: #526067; strong { font-size: 22px; font-variant-numeric: tabular-nums; color: #165f71; } &.urgent strong { color: #c24138; } } .timer { display: flex; align-items: center; gap: 8px; color: var(--exam-muted); font-size: 14px; strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: #7fe3ff; } &.urgent strong { color: #ffb35c; } }
} }
.exam-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; padding: 22px; } .exam-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; margin-top: 24px; }
.answer-sheet { background: white; border: 1px solid #dce3e5; padding: 18px; align-self: start; position: sticky; top: 16px; .answer-sheet { background: var(--exam-card); border: 1px solid var(--exam-card-border); border-radius: 14px; padding: 18px; align-self: start; position: sticky; top: 16px;
h2 { font-size: 17px; margin: 0 0 18px; } footer { display: flex; gap: 18px; color: #6b7280; font-size: 12px; border-top: 1px solid #e5e7eb; padding-top: 12px; } h2 { font-size: 16px; font-weight: 800; margin: 0 0 18px; } footer { display: flex; gap: 18px; color: var(--exam-muted); font-size: 12px; border-top: 1px solid var(--exam-line); padding-top: 12px; }
footer i { display: inline-block; width: 10px; height: 10px; border: 1px solid #cbd5d8; margin-right: 5px; } footer .answered-dot { background: #dcefeb; border-color: #68a99b; } footer i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid rgba(127, 186, 215, .55); margin-right: 5px; vertical-align: -1px; } footer .answered-dot { background: rgba(87, 217, 168, .16); border-color: rgba(87, 217, 168, .55); }
} }
.sheet-group { margin-bottom: 16px; h3 { font-size: 13px; color: #66737a; margin: 0 0 8px; } div { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; } .sheet-group { margin-bottom: 16px; &:last-child { margin-bottom: 0; } h3 { font-size: 13px; font-weight: 700; color: var(--exam-muted); margin: 0 0 8px; } div { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
button { aspect-ratio: 1; border: 1px solid #ccd5d8; background: white; border-radius: 3px; cursor: pointer; &.answered { background: #dcefeb; border-color: #68a99b; color: #185e70; } &.current { outline: 2px solid #e6a23c; outline-offset: 1px; } } button { aspect-ratio: 1; border: 1px solid rgba(127, 186, 215, .35); background: transparent; border-radius: 8px; color: var(--exam-secondary); font-size: 14px; font-weight: 700; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease;
&:hover { border-color: rgba(99, 217, 255, .55); transform: translateY(-1px); } &.answered { background: rgba(87, 217, 168, .16); border-color: rgba(87, 217, 168, .55); color: #d9fff0; } &.current { outline: 2px solid var(--exam-current); outline-offset: 1px; } }
} }
.question-panel { background: #fff; border: 1px solid #dce3e5; min-height: 610px; padding: 26px 34px 84px; position: relative; .question-panel { background: var(--exam-card); border: 1px solid var(--exam-card-border); border-radius: 14px; padding: 24px 28px 28px;
> header { display: flex; justify-content: space-between; color: #176b87; border-bottom: 1px solid #edf0f1; padding-bottom: 12px; } > h2 { font-size: 18px; line-height: 1.7; margin: 22px 0; } > header { display: flex; justify-content: space-between; align-items: baseline; color: var(--exam-accent); font-size: 12px; font-weight: 800; border-bottom: 1px solid var(--exam-line); padding-bottom: 12px; b { font-size: 14px; color: var(--exam-secondary); } }
.material { display: inline-flex; align-items: center; gap: 6px; color: #176b87; margin-bottom: 16px; } .choice-list { display: grid; gap: 12px; width: 100%; } > h2 { font-size: 18px; line-height: 1.7; color: var(--exam-text); margin: 22px 0; }
:deep(.el-radio), :deep(.el-checkbox) { margin: 0; border: 1px solid #dce3e5; border-radius: 4px; padding: 14px 16px; height: auto; white-space: normal; } .material { display: inline-flex; align-items: center; gap: 6px; color: var(--exam-accent); margin-bottom: 16px; } .choice-list { display: grid; gap: 8px; width: 100%; }
:deep(.is-checked) { background: #eef8f5; border-color: #68a99b; } :deep(.el-radio__label), :deep(.el-checkbox__label) { display: flex; gap: 12px; line-height: 1.5; } .judgement { grid-template-columns: 1fr 1fr; } .file-answer { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--exam-secondary); }
.judgement { grid-template-columns: 1fr 1fr; } .file-answer { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: #176b87; }
.question-actions { position: absolute; bottom: 24px; left: 34px; right: 34px; display: flex; justify-content: space-between; }
} }
@media (max-width: 760px) { .take-head { grid-template-columns: 1fr auto; padding: 10px 14px; height: auto; .timer { grid-row: 2; grid-column: 1 / 3; margin-top: 8px; } > button { grid-column: 2; grid-row: 1; } } .exam-body { grid-template-columns: 1fr; padding: 10px; } .answer-sheet { position: static; } .question-panel { padding: 20px 18px 78px; .question-actions { left: 18px; right: 18px; } } } .exam-actions { display: flex; justify-content: center; gap: 14px; margin-top: 22px; }
.exam-submit { display: flex; justify-content: center; margin-top: 36px; }
@media (max-width: 900px) { .exam-actions { flex-direction: column; gap: 14px; .exam-outline-action, .exam-primary-action { width: 100%; } } }
@media (max-width: 760px) { .take-page { padding: 20px 16px 24px; } .take-head { grid-template-columns: 1fr; padding: 10px 4px 16px; .timer { grid-row: 2; margin-top: 8px; } } .exam-body { grid-template-columns: 1fr; margin-top: 16px; } .answer-sheet { position: static; } .sheet-group div { grid-template-columns: repeat(8, 1fr); } .question-panel { padding: 20px 18px 22px; } .exam-submit { margin-top: 22px; } }
</style> </style>

Loading…
Cancel
Save