diff --git a/src/components/common/SemiCircleProgress.vue b/src/components/common/SemiCircleProgress.vue new file mode 100644 index 0000000..e9d6469 --- /dev/null +++ b/src/components/common/SemiCircleProgress.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/src/views/CourseExchanged.vue b/src/views/CourseExchanged.vue index 304838b..ff8ad59 100644 --- a/src/views/CourseExchanged.vue +++ b/src/views/CourseExchanged.vue @@ -44,7 +44,7 @@ - +
此视频请在2025.10.23 23:59前完成学习,快进拖拽或逾期学习不计入观看进度和成绩。 @@ -55,178 +55,213 @@
- -
- -
-
-

练习说明

-
    -
  • 本次练习共{{ practiceQuestions.length }}道题,总分{{ practiceQuestions.reduce((sum, q) => sum + q.score, 0) }}分
  • -
  • 练习没有时间限制,可以随时暂停和继续
  • -
  • 每道题可以多次修改答案
  • -
  • 完成后可以查看正确答案和解析
  • -
  • 练习结果不会影响最终成绩
  • -
-
- - + +
+ +
+ +
+ + + + +
+ + {{ practiceMode ? '此练习' : '此讨论' }}请在2025.10.23 23:59前完成学习,快进拖拽或逾期学习不计入观看进度和成绩。 +
+ + + +
+
+ + + + +
+
+
+ {{ String(currentQuestionIndex + 1).padStart(2, '0') }}【{{ getPracticeQuestionTypeShort(currentPracticeQuestion.type) }}】{{ currentPracticeQuestion.score }}分 +
+ +
+
+ {{ currentPracticeQuestion.title }} +
+ + +
+
+
+ +
+ {{ String.fromCharCode(65 + index) }}. + {{ option }} +
+
+ + +
+
+ {{ index + 1 }}. + +
+
+ *请在上方输入框内输入填空内容 +
+
+ + +
+
+ +
+ +
+
+ +
+ + +
+
-
- -
-
- -
-
-
- {{ String(currentQuestionIndex + 1).padStart(2, '0') }}【{{ getPracticeQuestionTypeShort(currentPracticeQuestion.type) }}】{{ currentPracticeQuestion.score }}分 + +
+
+ +
+
答题报告
-
-
- {{ currentPracticeQuestion.title }} -
+ +
- -
-
-
- -
- {{ String.fromCharCode(65 + index) }}. - {{ option }} -
-
+ +
+ + +
难度·4.8
+
- -
-
- {{ index + 1 }}. - -
-
- *请在上方输入框内输入填空内容 -
+ +
+
+ 答题时间: + 2025.07.13 12:34
- - -
-
- -
- +
+ 答题时长: + 1分23秒 +
+
+ 答题总数: + {{ getAnsweredCount() }}/{{ practiceQuestions.length }}
-
- - -
-
-
+ +
- -
-
- -
-

答题报告

-
难度·4.8
-
- - -
-
- - - - -
-
{{ getCurrentPracticeScore() }}
-
当前得分
-
-
-
- - -
-
- 答题时间: - -- -
-
- 答题时长: - -- -
-
- 答题总数: - {{ getAnsweredCount() }}/{{ practiceQuestions.length }} -
-
- - -
-

得分情况

-
+ +
+
得分情况
+
+
单选 +
+
+
{{ getSingleChoiceScore() }}/{{ getSingleChoiceTotal() }}
-
+
+
+
多选 +
+
+
{{ getMultiChoiceScore() }}/{{ getMultiChoiceTotal() }}
-
+
+
+
判断 +
+
+
{{ getJudgeScore() }}/{{ getJudgeTotal() }}
+
- -
-
-
6
-
最高分
-
-
-
30
-
练习人数3892人
-
-
-
90
-
答错人数
+ +
+ + +
+
+
6
+
最高分
+
+
+
+
+ + 30 +
+
练习人数3892人
+
+
+
+
90
+
答错人数
@@ -1332,6 +1367,7 @@ import type { Course, CourseSection, CourseComment } from '@/api/types' import QuillEditor from '@/components/common/QuillEditor.vue' import DPlayerVideo from '@/components/course/DPlayerVideo.vue' import SafeAvatar from '@/components/common/SafeAvatar.vue' +import SemiCircleProgress from '@/components/common/SemiCircleProgress.vue' // import LoginModal from '@/components/auth/LoginModal.vue' // import RegisterModal from '@/components/auth/RegisterModal.vue' @@ -2383,7 +2419,7 @@ const handlePractice = async (section: CourseSection) => { practiceQuestions.value = mockQuestions currentPracticeSection.value = section practiceMode.value = true - practiceStarted.value = false + practiceStarted.value = true // 直接开始练习,不需要点击开始按钮 practiceFinished.value = false currentQuestionIndex.value = 0 @@ -2568,6 +2604,32 @@ const getJudgeTotal = () => { return practiceQuestions.value.filter(q => q.type === '判断题').length } +// 计算各题型进度百分比 +const getSingleChoiceProgress = () => { + const total = getSingleChoiceTotal() + if (total === 0) return 0 + return Math.round((getSingleChoiceScore() / total) * 100) +} + +const getMultiChoiceProgress = () => { + const total = getMultiChoiceTotal() + if (total === 0) return 0 + return Math.round((getMultiChoiceScore() / total) * 100) +} + +const getJudgeProgress = () => { + const total = getJudgeTotal() + if (total === 0) return 0 + return Math.round((getJudgeScore() / total) * 100) +} + +// 获取练习总分 +const getTotalPracticeScore = () => { + return practiceQuestions.value.reduce((total, question) => { + return total + (question.score || 0) + }, 0) +} + // 处理考试操作 const handleExam = (section: CourseSection) => { console.log('开始考试:', section) @@ -3161,10 +3223,77 @@ onActivated(() => { padding-right: 120px; } -.breadcrumb { +/* 练习/讨论模式整体布局 */ +.practice-overall-layout { + display: flex; + gap: 20px; + align-items: flex-start; +} + +.practice-left-container { + width: 70%; + flex-shrink: 0; + display: flex; + flex-direction: column; + gap: 0; +} + +.practice-answer-card { + width: 300px; + flex-shrink: 0; + align-self: flex-start; + margin-top: 72px; /* 与提示区域顶部对齐 */ +} + +/* 面包屑导航样式 */ +.breadcrumb-section { padding: 12px 0; } +.breadcrumb { + display: flex; + align-items: center; + font-size: 14px; + line-height: 20px; +} + +.breadcrumb-course { + width: 70px; + height: 20px; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: #333333; + line-height: 20px; + text-align: left; + font-style: normal; + cursor: pointer; +} + +.breadcrumb-separator { + margin: 0 8px; + color: #333333; +} + +.breadcrumb-current { + width: 154px; + height: 20px; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: #999999; + line-height: 20px; + text-align: left; + font-style: normal; +} + +/* 练习模式提示样式调整 */ +.tip-section.practice-tip { + width: 100%; /* 占满左侧容器宽度 */ + background: rgba(255, 255, 255, 0.5); + margin-bottom: 20px; +} + .breadcrumb-text { color: #666; font-size: 14px; @@ -7511,9 +7640,9 @@ onActivated(() => { /* 练习模式样式 */ .practice-section { - background: white; - border-radius: 8px; - overflow: hidden; + background: transparent; /* 改为透明 */ + border-radius: 0; + overflow: visible; width: 100%; max-width: none; } @@ -7599,29 +7728,13 @@ onActivated(() => { background: #e6f7ff; } -.practice-main { - padding: 20px; -} - -.practice-layout { - display: flex; - gap: 24px; - width: 100%; - align-items: flex-start; -} - -.practice-sidebar { - width: 300px; - flex-shrink: 0; -} - .practice-content { - flex: 1; - min-width: 0; - background: white; - border-radius: 8px; + width: 100%; + background: rgba(255, 255, 255, 0.5); + border-radius: 2px; + border: 1px solid #FFFFFF; padding: 24px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + min-height: 560px; } .answer-sheet { @@ -7743,72 +7856,87 @@ onActivated(() => { } .question-card { - background: white; - border: 1px solid #e8e8e8; - border-radius: 8px; - padding: 30px; + height: 100%; + display: flex; + flex-direction: column; + background: transparent; + border: none; + border-radius: 0; + padding: 0; } .question-header { - margin-bottom: 20px; - padding-bottom: 15px; - border-bottom: 1px solid #f0f0f0; + margin-bottom: 12px; } .question-title-info { + color: #0088D1; font-size: 16px; - color: #1890ff; font-weight: 500; } .question-title-info span { - color: #ff4d4f; + background-color: #EEF9FF; + font-size: 12px; + padding: 2px 4px; + border-radius: 10px; } .question-content { - margin-bottom: 30px; + flex: 1; + margin-bottom: 24px; } .question-title { - font-size: 18px; + font-size: 16px; + font-weight: 400; color: #333; - line-height: 1.6; - margin-bottom: 20px; + margin: 0 0 24px 0; + line-height: 1.8; } .question-options { - margin-top: 20px; + margin-bottom: 24px; } .option-item { display: flex; - align-items: flex-start; - gap: 12px; - padding: 12px; - border: 1px solid #e8e8e8; + align-items: center; + padding: 5px 20px; + border: none; border-radius: 6px; - margin-bottom: 12px; + margin-bottom: 16px; cursor: pointer; transition: all 0.3s; + background: #EEF9FF; + min-height: 50px; } .option-item:hover { - border-color: #1890ff; - background: #f6ffed; + background: #EEF9FF; } .option-item.selected { - border-color: #1890ff; - background: #e6f7ff; + background: #EEF9FF; + color: #333; } -.option-checkbox input { +.option-checkbox { + margin-right: 12px; + position: relative; +} + +.option-checkbox input[type="checkbox"] { + width: 16px; + height: 16px; margin: 0; + cursor: pointer; } .option-label { font-weight: 500; color: #333; + margin-right: 8px; min-width: 20px; } @@ -7954,25 +8082,77 @@ onActivated(() => { } } -/* 练习答题卡样式 */ -.practice-answer-card { +/* 答题卡容器样式 */ +.answer-card-container { width: 300px; - flex-shrink: 0; + height: 566px; + background: rgba(255, 255, 255, 0.5); + border: 1px solid #FFFFFF; + border-radius: 0; + box-shadow: none; + padding: 20px; } -.answer-card-container { - background: white; - border-radius: 12px; - box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); - padding: 20px; - border: 1px solid #e8e8e8; +/* 答题报告标题 */ +.answer-card-title { + font-family: PingFangSC, PingFang SC; + font-weight: 500; + font-size: 16px; + color: #000000; + line-height: 22px; + text-align: center; + margin-bottom: 16px; + width: 100%; + display: flex; + justify-content: center; } +/* 圆环右上角的难度标签 */ +.difficulty-tag-circle { + position: absolute; + top: 0px; + right: 5px; + width: 56px; + height: 20px; + background: #0288D1; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; + font-family: AppleSystemUIFont; + font-size: 10px; + color: #FFFFFF; + line-height: 14px; + text-align: left; + font-style: normal; + text-transform: none; + white-space: nowrap; + z-index: 10; +} + +/* 分割线 */ +.divider-line { + width: 252px; + height: 1px; + border: 1px solid #E6E6E6; + margin: 16px auto; +} + +/* 得分圆环容器 */ +.score-circle-container { + display: flex; + justify-content: center; + margin: 20px 0; + position: relative; /* 为难度标签提供定位基准 */ +} + +/* 使用新的SemiCircleProgress组件,移除旧的圆环样式 */ + .answer-card-header { display: flex; justify-content: space-between; align-items: center; - margin-bottom: 20px; + margin-bottom: -20px; } .answer-card-header h3 { @@ -8346,4 +8526,181 @@ onActivated(() => { background: #52c41a; color: white; } + +/* 新的答题卡样式 */ +/* 答题信息样式 */ +.answer-info { + margin: 20px 0; +} + +.info-item { + display: flex; + justify-content: flex-start; + align-items: center; + margin-bottom: 8px; + padding-left: 20px; + gap: 2px; /* 非常小的间距 */ +} + +.info-label { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: #999999; + line-height: 17px; + text-align: left; + font-style: normal; + flex-shrink: 0; +} + +.info-value { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: #999999; + line-height: 17px; + flex-shrink: 0; +} + +/* 得分情况样式 */ +.score-breakdown { + margin: 20px 0; +} + +.score-breakdown-title { + width: 100%; + height: 22px; + font-family: PingFangSC, PingFang SC; + font-weight: 500; + font-size: 16px; + color: #000000; + line-height: 22px; + text-align: center; + font-style: normal; + margin-bottom: 16px; + display: flex; + justify-content: center; +} + +.score-item { + margin-bottom: 12px; /* 减少高度 */ +} + +.score-item-content { + display: flex; + align-items: center; + gap: 8px; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: #999999; + line-height: 17px; +} + +.score-type { + width: 30px; + flex-shrink: 0; +} + +.score-progress-bar { + width: 150px; /* 增加宽度,让进度条更长 */ + height: 8px; + background: #E6E6E6; + border-radius: 5px; + overflow: hidden; + flex-shrink: 0; +} + +.score-progress-fill { + height: 100%; + background: #0288D1; + border-radius: 5px; + transition: width 0.3s ease; +} + +.score-count { + margin-left: 8px; + flex-shrink: 0; +} + +/* 排名信息样式 */ +.ranking-info { + display: flex; + align-items: center; + justify-content: space-between; + margin: 20px 0; + padding: 0 10px; +} + +.ranking-item { + display: flex; + flex-direction: column; + align-items: center; + flex: 1; +} + +.ranking-item-left { + margin-left: -20px; /* 左边项目往左移 */ +} + +.ranking-item-right { + margin-right: -20px; /* 右边项目往右移 */ +} + +.ranking-number { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24px; + color: #F38505; + line-height: 33px; + text-align: center; + font-style: normal; + text-transform: none; +} + +.ranking-number-with-text { + display: flex; + align-items: center; + justify-content: center; + height: 33px; +} + +.ranking-prefix { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 10px; + color: #999999; + line-height: 14px; + text-align: left; + font-style: normal; + margin-right: 4px; /* 往左,增加与数字的间距 */ +} + +.ranking-suffix { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 10px; + color: #999999; + line-height: 14px; + text-align: left; + font-style: normal; + margin-left: 4px; /* 往右,增加与数字的间距 */ +} + +.ranking-label { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: #999999; + line-height: 17px; + text-align: center; + margin-top: 4px; + white-space: nowrap; /* 防止换行,保持一行显示 */ +} + +.ranking-divider { + width: 1px; + height: 40px; + background: #EDEDED; +} \ No newline at end of file