feat: 新增题目导入服务并优化用户端答题流程

- 新增 question-importer 服务,支持从 JSON 文件批量导入题目到题库
- 重构用户端答题流程,整合抽题、答题、结果分析页面状态管理
- 将题目分类从 UI 模板类型切换为业务分类(question_category_name)
- 在题库管理页面支持题目批量选择和删除功能
- 优化用户端组别选择,增加“已结束”状态提示和禁用逻辑
- 修复题目新增/更新 API 请求参数格式问题
- 为富文本编辑器配置排除不必要的工具栏按键
This commit is contained in:
2026-02-11 17:27:08 +08:00
parent 61a7412fc1
commit f3136cd9ad
34 changed files with 4154 additions and 225 deletions

View File

@ -38,13 +38,13 @@ declare namespace Api {
type QuestionTimeType = 5 | 10 | 15 | 20 | 30 | 45 | 60 | 90 /** 5s | 10s | 15s | 20s | 30s | 45s | 60s | 90s */
/** question template id */
type QuestionTemplateId =
| 'TEMPLATE_DICTATION_HINT'
| 'TEMPLATE_DICTATION_HOMOPHONE'
| 'TEMPLATE_COMPONENT_ADD'
| 'TEMPLATE_WORD_DICTATION'
| 'TEMPLATE_IDIOM_TEXT_REQ'
| 'TEMPLATE_IDIOM_IMAGE' /** 汉字听写-提示 | 汉字听写-同音 | 汉字加一加 | 词语听写 | 成语-文字要求 | 成语-看图 */
type QuestionCategoryName =
| 'ChineseCharacterDictation' // 汉字听写-提示 (jiu)
| 'CharacterRadicalAddition' // 汉字加一加 (车)
| 'WordDictation' // 词语听写 (zhi re)
| 'IdiomWriting' // 成语-文字要求 (反义字)
// | 'TEMPLATE_IDIOM_IMAGE' // 成语-看图
| 'PoetryComprehension' // 诗词理解-选择题
/** question score type */
type QuestionScoreType = 0 | 1 /** 固定分数 | 答题个数 */
@ -83,7 +83,6 @@ declare namespace Api {
QuestionID: number
QuestionDetaiID: number
}
interface QuestionListDetailRound {
/** 题目 id */
Id: number
@ -95,6 +94,18 @@ declare namespace Api {
ImageUrl: string
}
/** get current question params */
interface GetCurrentQuestionParams {
/** 活动 id */
ActivityID: number
/** 队伍分组 id */
GroupID: number
/** 轮次类型 */
RoundType: CompetitionRoundType
/** 是否已使用 */
isUse?: boolean
}
/** activity detail */
interface ActivityDetail {
/** 背景图片 */
@ -147,6 +158,26 @@ declare namespace Api {
backgroundImg: string
}
/** 当前题目响应 */
interface CurrentQuestionResponse {
/** 活动题目记录 */
Activity_Question: QuestionListRecord
/** 题目列表 */
QuestionList: {
/** 题目 id */
Id: number
/** 题目名称 */
Name: string
/** 题目内容 */
QuestionContent: string
/** 题目类型 */
QuestionType: string
}
/** 队伍分组题目 id */
TeamGroup_QuestionID: number
IsCompleted: boolean
}
/** update room request */
interface UpdateRoomRequest {
/** 活动 id */
@ -236,7 +267,24 @@ declare namespace Api {
/** 题目模板 id */
TemplateID: number
/** UI 类型 */
UIType: QuestionTemplateId
UIType: QuestionCategoryName
}
interface ActivityTeamGroup {
/** 队伍分组 id */
Id: number
/** 是否已结束 */
IsEnd: boolean
/** 主活动 id */
MainId: number
/** 分组名称 */
Name: string
/** 图标 */
icon: string
/** 队伍分组 id兼容字段 */
id: number
/** 分组名称(兼容字段) */
name: string
}
interface CreateQuestionRequest {