You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dianshang-qianduan/src/views/teacherEnd/exam/editor.vue

288 lines
26 KiB
Vue

<template>
<main class="exam-editor app-container" v-loading="loading">
<header class="editor-head">
<el-button text :icon="ArrowLeft" @click="$router.push('/exam/index')">返回考评管理</el-button>
<div class="title-block"><h1>{{ isNew ? '新建考试' : form.name || '编辑考试' }}</h1><el-tag v-if="!isNew" :type="statusMeta[status]?.tone">{{ statusMeta[status]?.label }}</el-tag></div>
<div v-if="inProgress"><el-button @click="save(false)">保存结束时间</el-button></div>
</header>
<nav v-if="!inProgress" class="prototype-nav" aria-label="考试编辑步骤">
<el-button type="primary" @click="activeStep = 1">添加试题</el-button><span>&gt;&gt;&gt;</span><el-button type="primary" @click="activeStep = 2">试卷预览</el-button><span>&gt;&gt;&gt;</span><el-button type="primary" @click="activeStep = 0">考试设置</el-button>
</nav>
<section v-if="activeStep === 0 || activeStep === 1" class="editor-panel prototype-base-panel">
<h2>基础设置</h2>
<el-form ref="formRef" :model="form" :rules="rules" label-width="110px" class="base-form">
<el-form-item label="考试名称" prop="name"><el-input v-model="form.name" maxlength="20" show-word-limit :disabled="inProgress" /></el-form-item>
<el-form-item label="开始时间" prop="startTime"><el-date-picker v-model="form.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" :disabled="inProgress" /></el-form-item>
<el-form-item label="结束时间" prop="endTime"><el-date-picker v-model="form.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" /></el-form-item>
<el-form-item label="考试时长"><el-input-number v-model="duration" :min="1" :max="1440" @change="syncEndTime" /><span class="unit">分钟</span></el-form-item>
<el-form-item label="考试班级" prop="classIds">
<el-select v-model="form.classIds" multiple collapse-tags placeholder="选择教师名下的教学班" :disabled="inProgress"><el-option v-for="item in classes" :key="item.id" :label="item.name" :value="item.id" /></el-select>
</el-form-item>
</el-form>
<section class="score-matrix">
<div class="score-matrix-head"><span>题型</span><span>题库题目数量</span><span>选题数量</span><span>每题分值</span><span>小计</span></div>
<div v-for="item in typeOptions" :key="item.value" class="score-matrix-row"><span>{{ item.label }}</span><span>{{ questionCount(item.value) }}</span><span>{{ selectedByType(item.value) }}</span><span>{{ selectedByType(item.value) ? scoreByType(item.value) / selectedByType(item.value) : 0 }}</span><span>{{ scoreByType(item.value) }}</span></div>
</section>
</section>
<section v-if="!inProgress && activeStep === 0" class="editor-panel settings-stage">
<header class="section-head"><div><h2>考试设置</h2><p>设置试题展示、作答行为和多选题计分方式</p></div></header>
<div class="settings-grid">
<div class="setting-row"><span>题目乱序(同一题型内)</span><el-radio-group v-model="form.questionOrderMode"><el-radio label="FIXED">不随机打乱</el-radio><el-radio label="RANDOM">随机打乱</el-radio></el-radio-group></div>
<div class="setting-row"><span>选项乱序(同一题型内)</span><el-radio-group v-model="form.optionOrderMode"><el-radio label="FIXED">不随机打乱</el-radio><el-radio label="RANDOM">随机打乱</el-radio></el-radio-group></div>
<div class="setting-row"><span>允许复制试题</span><el-radio-group v-model="form.allowCopyQuestion"><el-radio :label="false">不允许复制</el-radio><el-radio :label="true">允许复制</el-radio></el-radio-group></div>
<div class="setting-row"><span>允许粘贴答案</span><el-radio-group v-model="form.allowPasteAnswer"><el-radio :label="false">不允许粘贴</el-radio><el-radio :label="true">允许粘贴</el-radio></el-radio-group></div>
<div class="setting-row"><span>考试过程可以回退</span><el-radio-group v-model="form.allowRollback"><el-radio :label="false">不允许回退</el-radio><el-radio :label="true">允许回退</el-radio></el-radio-group></div>
<div class="setting-row multiple-score-row"><span>多选题计分方式</span><el-radio-group v-model="form.multipleScoreMode"><el-radio label="ALL_OR_NOTHING">多选、少选、错选不得分</el-radio><el-radio label="PARTIAL_BY_COUNT">少选时,按照选项个数计分</el-radio><el-radio label="HALF_FOR_PARTIAL">少选时,得一半分数</el-radio></el-radio-group></div>
</div>
</section>
<section v-if="!inProgress && activeStep === 1" class="editor-panel question-stage">
<header class="section-head"><div><h2>选择试题</h2><p>勾选题目并设置该题分值,选择结果实时同步到试卷概览</p></div>
<div class="import-tools">
<div class="import-actions"><el-button class="template-button" :icon="Download" @click="downloadTemplate">下载 Word 模板</el-button><el-upload class="word-upload" :show-file-list="false" accept=".docx" :http-request="importPaperQuestions"><el-button type="primary" :icon="Upload">导入 Word 试题</el-button></el-upload></div>
<span class="import-hint">按模板填写后上传,系统会解析题干、选项、答案和解析,并自动选中题目</span>
</div>
</header>
<div class="question-layout">
<aside class="type-nav">
<button v-for="item in typeOptions" :key="item.value" :class="{ active: activeType === item.value }" @click="activeType=item.value">
<span>{{ item.label }}</span><b>{{ selectedByType(item.value) }} / {{ questionCount(item.value) }}</b>
</button>
</aside>
<div class="question-list">
<article v-for="question in filteredQuestions" :key="question.id" :class="['question-item', { selected: isSelected(question.id) }]">
<el-checkbox :model-value="isSelected(question.id)" @change="toggleQuestion(question, $event)" />
<div class="question-body"><h3>{{ question.stem }}</h3><div v-if="question.options?.length" class="options"><span v-for="option in question.options" :key="option.label">{{ option.label }}. {{ option.content }}</span></div></div>
<div v-if="isSelected(question.id)" class="score-input"><el-input-number :model-value="selectedScore(question.id)" :min="0.5" :precision="1" :step="0.5" controls-position="right" @change="setScore(question.id, $event)" /><span>分</span></div>
</article>
<el-empty v-if="!filteredQuestions.length" description="该题型暂无题目" />
</div>
</div>
</section>
<section v-if="!inProgress && activeStep === 2" class="editor-panel preview-stage">
<header class="section-head"><div><h2>试卷概览</h2><p>{{ form.questions.length }} 道题,共 {{ totalScore }} 分</p></div><el-button :icon="Download" @click="exportPaper" :disabled="isNew">导出 Word 试卷</el-button></header>
<div class="score-summary">
<div v-for="item in typeOptions" :key="item.value"><span>{{ item.label }}</span><strong>{{ selectedByType(item.value) }}</strong><small>{{ scoreByType(item.value) }} 分</small></div>
<div class="total"><span>总分</span><strong>{{ totalScore }}</strong><small>自动合计</small></div>
</div>
<nav class="anchor-nav"><button v-for="item in selectedTypes" :key="item.value" @click="scrollToType(item.value)">{{ item.label }}</button></nav>
<section v-for="item in selectedTypes" :id="`paper-${item.value}`" :key="item.value" class="paper-section">
<h3>{{ item.label }}</h3>
<article v-for="(question, index) in selectedQuestions(item.value)" :key="question.id" class="paper-question">
<el-checkbox :model-value="true" @change="toggleQuestion(question, false)" /><div><h4>{{ index + 1 }}. {{ question.stem }} <b>{{ selectedScore(question.id) }} 分</b></h4><p v-for="option in question.options" :key="option.label">{{ option.label }}. {{ option.content }}</p></div>
</article>
</section>
<el-empty v-if="!form.questions.length" description="尚未选择试题" />
</section>
<footer v-if="!inProgress" class="editor-footer"><el-button @click="$router.push('/exam/index')">取消</el-button><el-button @click="save(false)">保存考试</el-button><el-button v-if="status === 'DRAFT'" type="primary" @click="save(true)">立即发布</el-button></footer>
</main>
</template>
<script setup>
import { computed, onMounted, reactive, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import { ArrowLeft, ArrowRight, Download, Upload } from "@element-plus/icons-vue";
import { saveAs } from "file-saver";
import * as examApi from "@/api/exam";
const route = useRoute(); const router = useRouter(); const id = computed(() => route.params.id); const isNew = computed(() => id.value === "new");
const loading = ref(false); const activeStep = ref(1); const activeType = ref("SINGLE"); const status = ref("DRAFT"); const classes = ref([]); const bank = ref([]); const formRef = ref(); const duration = ref(60);
const typeOptions = [{ label: "单选题", value: "SINGLE" }, { label: "多选题", value: "MULTIPLE" }, { label: "判断题", value: "TRUE_FALSE" }, { label: "简答题", value: "SHORT_ANSWER" }];
const statusMeta = { DRAFT: { label: "未发布", tone: "info" }, NOT_STARTED: { label: "未开始", tone: "" }, IN_PROGRESS: { label: "进行中", tone: "success" }, ENDED: { label: "已结束", tone: "warning" } };
const form = reactive({ name: "", startTime: "", endTime: "", classIds: [], questionOrderMode: "FIXED", optionOrderMode: "FIXED", allowCopyQuestion: false, allowPasteAnswer: false, allowRollback: true, multipleScoreMode: "ALL_OR_NOTHING", questions: [] });
const rules = { name: [{ required: true, message: "请输入考试名称" }, { pattern: /^[\p{L}\p{N}]+$/u, message: "仅支持汉字、字母和数字" }], startTime: [{ required: true, message: "请选择开始时间" }], endTime: [{ required: true, message: "请选择结束时间" }], classIds: [{ type: "array", required: true, min: 1, message: "至少选择一个班级" }] };
const inProgress = computed(() => status.value === "IN_PROGRESS");
const filteredQuestions = computed(() => bank.value.filter((item) => item.type === activeType.value));
const totalScore = computed(() => form.questions.reduce((sum, item) => sum + Number(item.score || 0), 0));
const selectedTypes = computed(() => typeOptions.filter((item) => selectedByType(item.value)));
onMounted(load);
async function load() { loading.value = true; try { const [classRes, questionRes] = await Promise.all([examApi.getExamClasses(), examApi.getQuestions({})]); classes.value = classRes.data || []; bank.value = questionRes.data || []; if (!isNew.value) { const { data } = await examApi.getTeacherExam(id.value); status.value = data.status; const bankIds = new Set(bank.value.map((item) => item.id)); bank.value = [...bank.value, ...data.questions.filter((item) => !bankIds.has(item.id))]; Object.assign(form, { name: data.name, startTime: formatValue(data.startTime), endTime: formatValue(data.endTime), classIds: data.classes.map((item) => item.id), questionOrderMode: data.questionOrderMode || "FIXED", optionOrderMode: data.optionOrderMode || "FIXED", allowCopyQuestion: toBoolean(data.allowCopyQuestion, false), allowPasteAnswer: toBoolean(data.allowPasteAnswer, false), allowRollback: toBoolean(data.allowRollback, true), multipleScoreMode: data.multipleScoreMode || "ALL_OR_NOTHING", questions: data.questions.map((item) => ({ questionId: item.id, score: Number(item.score) })) }); duration.value = data.durationMinutes; } else { const start = new Date(Date.now() + 3600000); form.startTime = formatValue(start); form.endTime = formatValue(new Date(start.getTime() + 3600000)); } } finally { loading.value = false; } }
function syncEndTime() { if (!form.startTime) return; form.endTime = formatValue(new Date(new Date(form.startTime.replace(" ", "T")).getTime() + duration.value * 60000)); }
function isSelected(questionId) { return form.questions.some((item) => item.questionId === questionId); }
function selectedScore(questionId) { return form.questions.find((item) => item.questionId === questionId)?.score || 1; }
function toggleQuestion(question, checked) { if (checked) form.questions.push({ questionId: question.id, score: 1 }); else form.questions = form.questions.filter((item) => item.questionId !== question.id); }
function setScore(questionId, score) { const item = form.questions.find((row) => row.questionId === questionId); if (item) item.score = Number(score); }
function selectedByType(type) { const ids = new Set(bank.value.filter((item) => item.type === type).map((item) => item.id)); return form.questions.filter((item) => ids.has(item.questionId)).length; }
function questionCount(type) { return bank.value.filter((item) => item.type === type).length; }
function scoreByType(type) { return selectedQuestions(type).reduce((sum, item) => sum + Number(selectedScore(item.id)), 0); }
function selectedQuestions(type) { const selected = new Set(form.questions.map((item) => item.questionId)); return bank.value.filter((item) => item.type === type && selected.has(item.id)); }
async function nextStep() { if (activeStep.value === 0) { try { await formRef.value.validate(); const start = new Date(form.startTime.replace(" ", "T")); const end = new Date(form.endTime.replace(" ", "T")); if (end <= start) return ElMessage.warning("结束时间必须晚于开始时间"); duration.value = Math.round((end - start) / 60000); } catch { return; } } if (activeStep.value === 1 && !form.questions.length) return ElMessage.warning("至少选择一道试题"); activeStep.value++; }
async function save(publish) { if (inProgress.value) { await examApi.updateExam(id.value, form); ElMessage.success("结束时间已更新"); return router.push("/exam/index"); } try { await formRef.value?.validate(); } catch { activeStep.value = 0; return; } if (!form.questions.length) { activeStep.value = 1; return ElMessage.warning("至少选择一道试题"); } const result = isNew.value ? await examApi.createExam(form) : await examApi.updateExam(id.value, form); const examId = result.data.id; if (publish) await examApi.publishExam(examId); ElMessage.success(publish ? "考试已保存并发布" : "考试已保存"); router.push("/exam/index"); }
async function importPaperQuestions({ file }) { const formData = new FormData(); formData.append("file", file); const { data } = await examApi.importQuestions(formData); bank.value = [...data, ...bank.value]; for (const q of data) if (!isSelected(q.id)) form.questions.push({ questionId: q.id, score: 1 }); ElMessage.success(`导入并选中 ${data.length} 道题`); }
async function downloadTemplate() { saveAs(await examApi.downloadQuestionTemplate(), "考试题库导入模板.docx"); }
async function exportPaper() { saveAs(await examApi.exportExamPaper(id.value), `${form.name}试卷.docx`); }
function scrollToType(type) { document.getElementById(`paper-${type}`)?.scrollIntoView({ behavior: "smooth", block: "start" }); }
function formatValue(value) { const date = value instanceof Date ? value : new Date(value); const pad = (n) => String(n).padStart(2, "0"); return `${date.getFullYear()}-${pad(date.getMonth()+1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`; }
function toBoolean(value, fallback) { if (value === undefined || value === null || value === "") return fallback; return value === true || value === 1 || value === "1" || value === "true"; }
</script>
<style scoped lang="scss">
.exam-editor {
--exam-line: rgba(57, 174, 224, 0.28);
--exam-line-soft: rgba(57, 174, 224, 0.16);
--exam-panel: rgba(2, 18, 31, 0.58);
--exam-text: #e8f6ff;
--exam-muted: #8fb6d0;
color: var(--exam-text);
padding-bottom: 92px;
}
.editor-head {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
padding: 2px 0 16px;
border-bottom: 1px solid var(--exam-line);
> :last-child { justify-self: end; }
:deep(.el-button) { font-weight: 700; }
:deep(.el-button:not(.el-button--primary)) { color: #9edcff; }
:deep(.el-button:not(.el-button--primary):hover) { color: #fff; background: rgba(20, 116, 160, 0.24); }
}
.title-block {
display: flex;
align-items: center;
gap: 10px;
h1 {
margin: 0;
color: #f3fbff;
font-size: 24px;
font-weight: 800;
letter-spacing: 0.02em;
text-shadow: 0 0 18px rgba(65, 201, 255, 0.18);
}
}
.steps {
max-width: 820px;
margin: 28px auto 34px;
:deep(.el-step__title) { color: #7597ad; font-size: 15px; font-weight: 700; }
:deep(.el-step__title.is-process) { color: #e9fbff; }
:deep(.el-step__title.is-finish) { color: #bceeff; }
:deep(.el-step__head.is-process) { color: #6fe2ff; border-color: #42c9f5; }
:deep(.el-step__head.is-finish) { color: #62d9df; border-color: #36bfc6; }
:deep(.el-step__head.is-wait) { color: #628399; border-color: rgba(96, 151, 180, 0.58); }
:deep(.el-step__icon) { background: #071a2a; }
:deep(.el-step__icon-inner) { font-weight: 800; }
:deep(.el-step__line) { background-color: rgba(77, 157, 193, 0.38); }
:deep(.el-step__line-inner) { border-color: #40c7e7; }
}
.prototype-nav {
display: flex;
align-items: center;
justify-content: center;
gap: 28px;
margin: 12px auto 22px;
color: #d9f7ff;
font-size: 22px;
font-weight: 800;
}
.prototype-nav .el-button { min-width: 150px; height: 42px; border-radius: 8px; font-weight: 700; }
.prototype-base-panel { max-width: 1440px; padding: 0 26px 20px; }
.prototype-base-panel > h2 { margin-bottom: 14px; }
.score-matrix { margin-top: 8px; border: 1px solid rgba(76, 135, 159, .7); background: rgba(244, 248, 250, .04); }
.score-matrix-head, .score-matrix-row { display: grid; grid-template-columns: 1.1fr 1.35fr 1.1fr 1.1fr 1.1fr; min-height: 42px; align-items: center; text-align: center; }
.score-matrix-head { color: #d9f7ff; background: rgba(25, 117, 153, .24); font-weight: 700; }
.score-matrix-row { color: #c1dbe8; border-top: 1px solid rgba(76, 135, 159, .55); }
.score-matrix-head span, .score-matrix-row span { padding: 8px 6px; border-right: 1px solid rgba(76, 135, 159, .55); }
.score-matrix-head span:last-child, .score-matrix-row span:last-child { border-right: 0; }
.editor-panel {
width: 100%;
max-width: 1180px;
margin: auto;
padding: 0 24px 26px;
box-sizing: border-box;
h2 {
display: flex;
align-items: center;
gap: 10px;
margin: 0 0 24px;
color: #eaf9ff;
font-size: 20px;
font-weight: 800;
&::before { width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(#61e5ff, #168dd1); content: ''; }
}
}
.base-form {
max-width: 820px;
padding: 22px 26px 12px;
border: 1px solid var(--exam-line-soft);
border-radius: 12px;
background: var(--exam-panel);
box-shadow: inset 0 1px 0 rgba(161, 229, 255, 0.04);
:deep(.el-form-item) { margin-bottom: 20px; }
:deep(.el-form-item__label) { color: #d4efff; font-weight: 700; }
:deep(.el-form-item__error) { color: #ff9c91; }
:deep(.el-input), :deep(.el-select), :deep(.el-date-editor) { width: 100%; }
:deep(.el-input__wrapper), :deep(.el-select__wrapper) {
min-height: 40px;
border: 1px solid rgba(52, 169, 218, 0.48);
background: rgba(3, 27, 43, 0.86);
box-shadow: none;
}
:deep(.el-input__wrapper:hover), :deep(.el-input__wrapper.is-focus), :deep(.el-select__wrapper:hover), :deep(.el-select__wrapper.is-focused) { border-color: #3cc8f2; box-shadow: 0 0 0 3px rgba(20, 164, 218, 0.12); }
:deep(.el-input__inner), :deep(.el-select__selected-item), :deep(.el-select__placeholder), :deep(.el-range-input) { color: #eaf8ff; }
:deep(.el-input__count-inner) { color: #8fb6d0; background: transparent; }
:deep(.el-input-number) { width: 180px; }
:deep(.el-input-number .el-input__wrapper) { padding-right: 58px; }
:deep(.el-input-number__decrease), :deep(.el-input-number__increase) { color: #bdeaff; background: rgba(16, 82, 111, 0.55); border-color: rgba(56, 162, 207, 0.34); }
:deep(.el-switch__label) { color: #75b9dd; }
:deep(.el-switch__label.is-active) { color: #43c3ff; }
}
.prototype-base-panel .base-form { max-width: none; display: grid; grid-template-columns: 1.7fr 1.2fr 1.2fr .9fr 1.35fr; gap: 8px 18px; padding: 8px 0 12px; border: 0; background: transparent; box-shadow: none; }
.prototype-base-panel .base-form :deep(.el-form-item) { margin-bottom: 8px; }
.prototype-base-panel .base-form :deep(.el-form-item:first-child) { grid-column: 1 / -1; }
.prototype-base-panel .base-form :deep(.el-form-item__label) { color: #d4efff; }
.prototype-base-panel .base-form :deep(.el-input), .prototype-base-panel .base-form :deep(.el-select), .prototype-base-panel .base-form :deep(.el-date-editor) { width: 100%; }
.settings-stage { max-width: 1180px; }
.settings-grid { border: 1px solid var(--exam-line-soft); border-radius: 12px; background: var(--exam-panel); padding: 8px 24px; }
.setting-row { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: center; min-height: 64px; border-bottom: 1px solid rgba(76, 135, 159, .24); gap: 18px; }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span { color: #d4efff; font-weight: 700; }
.setting-row :deep(.el-radio-group) { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.setting-row :deep(.el-radio) { color: #b8d6e5; margin-right: 0; }
.setting-row :deep(.el-radio__label) { color: inherit; }
.setting-row :deep(.el-radio__input.is-checked + .el-radio__label) { color: #e9fbff; }
.multiple-score-row { align-items: start; padding: 16px 0; }
.multiple-score-row :deep(.el-radio-group) { gap: 12px 22px; }
.unit { margin-left: 10px; color: var(--exam-muted); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 18px; h2 { margin: 0; } p { margin: 6px 0 0; color: var(--exam-muted); } }
.import-tools { display: grid; justify-items: end; gap: 8px; }
.import-actions { display: flex; gap: 8px; :deep(.el-button) { height: 38px; border-radius: 8px; font-weight: 700; } :deep(.template-button) { color: #b9e8fa; border-color: rgba(86, 173, 212, 0.48); background: rgba(12, 67, 93, 0.5); } :deep(.template-button:hover) { color: #fff; border-color: #4acbf0; background: rgba(18, 111, 149, 0.62); } :deep(.word-upload .el-button) { border-color: rgba(48, 185, 255, 0.85); background: linear-gradient(135deg, #078dce, #1557d6); } }
.import-hint { max-width: 420px; color: #7faec5; font-size: 12px; line-height: 1.45; text-align: right; }
.question-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; }
.type-nav { align-self: start; display: grid; gap: 5px; padding: 10px; border: 1px solid var(--exam-line-soft); border-radius: 12px; background: rgba(2, 18, 31, 0.72); box-shadow: inset 0 1px 0 rgba(161, 229, 255, 0.04); button { appearance: none; -webkit-appearance: none; width: 100%; border: 1px solid transparent; background: transparent !important; padding: 12px; display: flex; justify-content: space-between; color: #9ab9ce !important; cursor: pointer; border-radius: 8px; font: inherit; text-align: left; &.active { color: #e4fbff !important; border-color: rgba(55, 197, 235, 0.34); background: rgba(11, 112, 151, 0.28) !important; } &:hover { color: #fff !important; background: rgba(24, 117, 158, 0.2) !important; } b { font-weight: 700; color: #74d4ec; } } }
.question-list { min-width: 0; }
.question-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 16px 14px; border-bottom: 1px solid var(--exam-line-soft); &.selected { background: rgba(17, 120, 155, 0.14); } h3 { color: #e7f7ff; font-size: 15px; line-height: 1.6; margin: 0; font-weight: 600; } }
.options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 20px; color: #9abbd0; margin-top: 9px; }
.score-input { display: flex; align-items: center; gap: 6px; color: #bde9f7; :deep(.el-input-number) { width: 104px; } }
.score-summary { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--exam-line); border-radius: 10px; overflow: hidden; margin-bottom: 18px; > div { padding: 16px; border-right: 1px solid var(--exam-line-soft); display: grid; gap: 5px; &:last-child { border-right: 0; } span, small { color: #8fb6d0; } strong { font-size: 24px; color: #8ee9ff; } } .total { background: rgba(18, 116, 124, 0.24); } }
.anchor-nav { display: flex; gap: 8px; margin: 18px 0; button { border: 1px solid rgba(73, 181, 218, 0.46); background: rgba(7, 56, 82, 0.52); color: #8cdef4; padding: 7px 14px; border-radius: 6px; cursor: pointer; } }
.paper-section { scroll-margin-top: 20px; border-top: 2px solid #1f9db5; padding-top: 16px; margin-top: 26px; h3 { color: #e9fbff; font-size: 17px; } }
.paper-question { display: grid; grid-template-columns: 26px 1fr; padding: 12px 0; border-bottom: 1px solid var(--exam-line-soft); h4 { margin: 0 0 8px; color: #e5f5ff; line-height: 1.6; font-weight: 500; b { float: right; color: #70ddf8; } } p { margin: 4px 0; color: #9dbfd2; } }
.editor-footer { position: fixed; bottom: 0; left: 0; right: 0; height: 76px; display: flex; justify-content: center; align-items: center; gap: 12px; background: linear-gradient(180deg, rgba(4, 24, 38, 0.86), rgba(2, 13, 24, 0.98)); border-top: 1px solid rgba(66, 181, 225, 0.34); box-shadow: 0 -12px 32px rgba(0, 8, 18, 0.28); backdrop-filter: blur(14px); z-index: 10; :deep(.el-button) { min-width: 112px; height: 40px; border-radius: 8px; font-weight: 700; } :deep(.el-button:not(.el-button--primary)) { color: #b9e8fa; border-color: rgba(86, 173, 212, 0.42); background: rgba(12, 67, 93, 0.45); } }
@media (max-width: 760px) { .editor-head { grid-template-columns: 1fr; gap: 12px; .title-block { grid-row: 1; } > :last-child { justify-self: start; } } .question-layout { grid-template-columns: 1fr; } .type-nav { display: flex; overflow-x: auto; border: 1px solid var(--exam-line-soft); } .score-summary { grid-template-columns: 1fr 1fr; } .section-head { align-items: flex-start; flex-direction: column; gap: 12px; } .import-tools { justify-items: start; width: 100%; } .import-hint { max-width: none; text-align: left; } }
</style>
<style lang="scss">
#app .teacherLayout .editor-footer { left: 304px; }
#app .teacherLayout.hideSidebar .editor-footer { left: 64px; }
#app .mobile.teacherLayout .editor-footer { left: 0; }
</style>