- {Array.from({ length: 10 }).map((_, i) => (
-
- _____________________________________________________________________________
+ {Array.from({ length: 5 }).map((_, i) => (
+
+
))}
@@ -319,13 +343,8 @@ const ExamPrint: React.FC = () => {
// 渲染题目组
const renderQuestionGroup = (type: string, questions: Question[]) => {
- let startIndex = 0
- // 计算该题型的起始序号
- Object.keys(groupedQuestions)
- .filter((t) => TYPE_ORDER[t] < TYPE_ORDER[type])
- .forEach((t) => {
- startIndex += groupedQuestions[t].length
- })
+ // 每个题型分类都从1开始编号
+ const startIndex = 0
// 计算该题型总分
const totalScore = questions.length * TYPE_SCORE[type]
@@ -333,7 +352,7 @@ const ExamPrint: React.FC = () => {
return (
-
+
{TYPE_NAME[type]}
{TYPE_SCORE[type] > 0 && (
@@ -397,22 +416,13 @@ const ExamPrint: React.FC = () => {
>
返回
-
- }
- onClick={handlePrintPaper}
- >
- 打印试卷
-
- }
- onClick={handlePrintAnswer}
- >
- 打印答案
-
-
+ }
+ onClick={handlePrint}
+ >
+ 打印试卷
+
{/* 打印内容区 */}
@@ -422,12 +432,11 @@ const ExamPrint: React.FC = () => {
保密知识模拟考试{showAnswer ? '(答案)' : ''}
-
-
- 姓名:__________________
-
-
- 日期:__________________
+
+
+ 日期:{formatDate(new Date())}
+ 姓名:________________
+ 成绩:________________
@@ -437,10 +446,9 @@ const ExamPrint: React.FC = () => {
考试说明
- - 本试卷满分100分,考试时间为90分钟
- - 请在答题区域内作答,字迹清晰工整
- - 简答题仅供参考,不计入总分
- - 论述题从以下2道题目中任选1道作答
+ - 本试卷满分100分,考试时间为60分钟
+ - 填空题每题8分,请在答题区域内作答,字迹清晰工整
+ - 论述题每题9分,从以下2道题目中任选1道作答
)}
@@ -455,11 +463,11 @@ const ExamPrint: React.FC = () => {
{essayQuestions.length > 0 && (
-
+
{TYPE_NAME['ordinary-essay']}
- (以下2道论述题任选1道作答,共25分)
+ (以下2道论述题任选1道作答,共9分)
diff --git a/web/src/types/question.ts b/web/src/types/question.ts
index 191f3b8..bd50a0a 100644
--- a/web/src/types/question.ts
+++ b/web/src/types/question.ts
@@ -16,6 +16,7 @@ export interface Question {
options: Option[]
category: string
answer?: any // 正确答案(用于题目管理编辑)
+ answer_lengths?: number[] // 答案长度数组(用于打印时计算横线长度)
}
// 提交答案