From 1b70f00dbcecacc3e3fd70b7bf2c24dd1ae55310 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 30 Oct 2024 17:13:18 +0800 Subject: [PATCH] fix --- src/pages/achievement/info/project.vue | 15 +-- src/pages/achievement/list/project.vue | 2 +- src/pages/assessment/add/index.vue | 27 ++-- src/pages/match/manage/theoryReport.vue | 158 +++++++++++++++++++----- 4 files changed, 145 insertions(+), 57 deletions(-) diff --git a/src/pages/achievement/info/project.vue b/src/pages/achievement/info/project.vue index 6f2b3b3..16d5c27 100644 --- a/src/pages/achievement/info/project.vue +++ b/src/pages/achievement/info/project.vue @@ -277,7 +277,7 @@ export default { this.errorAnalysis = res.errorAnalysis || {} this.max = res.highestErrorRate || {} this.min = res.minimumErrorRate || {} - this.scores = res.getFractionalSegmentNum + this.scores = res.calculateRangeCounts this.getChart() this.errorChart() } catch (e) { @@ -309,7 +309,7 @@ export default { // 查看成绩报告 show (row) { this.$store.commit('achievement/setRow', null) - this.$router.push(`show?reportId=${row.reportId}`) + this.$router.push(`${row.paperId ? '/match/theoryReport' : 'show'}?reportId=${row.reportId}`) }, // 导出(有勾选:就导勾选中的;没有勾选:就导全部) exportData () { @@ -347,7 +347,7 @@ export default { mallId: this.mallId, reportIds } - data[this.permissions ? 'assessmentId' : 'projectId'] = this.id + data[this.permissions ? 'assessmentId' : this.paperId ? 'paperId' : 'projectId'] = this.id || this.paperId const res = await axios.post(this.api.batchExportReportsAsZip, data, { headers: { token: this.token @@ -446,10 +446,7 @@ export default { util.downloadFileDirect(`活跃度.xls`, new Blob([res.data])) }, getChart () { // 初始化折线图 - const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - for (const i in this.scores) { - data[+(i.replace('num', '')) - 1] = this.scores[i] - } + const data = this.scores let myChart = echarts.init(document.getElementById("chart")); myChart.setOption({ title: { text: "实验分数分布图" }, @@ -462,7 +459,7 @@ export default { // axisLabel: { // interval: 9, // }, - data: ["0-10", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"] + data: data.map(e => e.range) }, yAxis: { name: this.permissions ? "人数" : '成绩报告数量', @@ -470,7 +467,7 @@ export default { minInterval: 5, }, series: [{ - data, + data: data.map(e => e.count), type: "line", areaStyle: {}, label: { diff --git a/src/pages/achievement/list/project.vue b/src/pages/achievement/list/project.vue index e4e8e2e..654b037 100644 --- a/src/pages/achievement/list/project.vue +++ b/src/pages/achievement/list/project.vue @@ -251,7 +251,7 @@ export default { // 进入实验记录 entry (row) { this.$store.commit('achievement/setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`) - this.$router.push(`project?id=${row.assessmentId || row.projectId || ''}&paperId=${row.paperId || ''}&projectName=${row.projectName}&permissions=${row.permissions || 0}&mallId=${this.form.mallId}&classId=${row.classId || ''}`) + this.$router.push(`project?id=${row.assessmentId || row.projectId || ''}&paperId=${row.paperId || ''}&projectName=${row.projectName}&permissions=${this.form.permissions}&mallId=${this.form.mallId}&classId=${row.classId || ''}`) }, handleDelete (row) { // 删除 this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { diff --git a/src/pages/assessment/add/index.vue b/src/pages/assessment/add/index.vue index 2149d01..f9bf5bc 100644 --- a/src/pages/assessment/add/index.vue +++ b/src/pages/assessment/add/index.vue @@ -3,7 +3,7 @@
- +
{{ form.id ? "更新" : "创建" }}
@@ -30,10 +30,10 @@
-

实验时间

+

考核时间

- 实验时长: + 考核时长: @@ -72,7 +72,7 @@
- 实训项目 + 考核项目
@@ -379,7 +379,6 @@ export default { }, getProjectData () { const curItem = this.curriculumList.find(e => e.mallId === this.form.mallId) - console.log("🚀 ~ file: index.vue:471 ~ getProjectData ~ curItem:", curItem) let data = { pageNum: this.page, pageSize: this.pageSize, @@ -419,18 +418,18 @@ export default { let day = hour * 24; this.form.experimentDuration = `${Math.floor(timestamp / day)}d${Math.floor(timestamp % day / hour)}h${Math.floor(timestamp % day % hour / minute)}m`; } - if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return util.warningMsg("请填写实验时长"); - if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return util.warningMsg("请填写实验时间"); + if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return util.warningMsg("请填写考核时长"); + if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return util.warningMsg("请填写考核时间"); if (this.form.type == 1) { const { day, hour, minute } = this.duration - if (String(day).includes('.')) return util.warningMsg('实验天数请填写整数') - if (day < 0) return util.warningMsg('实验天数请勿填写负数') - if (String(hour).includes('.')) return util.warningMsg('实验小时请填写整数') - if (hour < 0) return util.warningMsg('实验小时请勿填写负数') - if (String(minute).includes('.')) return util.warningMsg('实验分钟请填写整数') - if (minute < 0) return util.warningMsg('实验分钟请勿填写负数') + if (String(day).includes('.')) return util.warningMsg('考核天数请填写整数') + if (day < 0) return util.warningMsg('考核天数请勿填写负数') + if (String(hour).includes('.')) return util.warningMsg('考核小时请填写整数') + if (hour < 0) return util.warningMsg('考核小时请勿填写负数') + if (String(minute).includes('.')) return util.warningMsg('考核分钟请填写整数') + if (minute < 0) return util.warningMsg('考核分钟请勿填写负数') } - if (!form.uuid) return util.warningMsg("请选择实训项目"); + if (!form.uuid) return util.warningMsg("请选择考核项目"); const item = this.projectData.find(e => form.uuid === e.projectId || form.uuid === e.paperId) if (item) form[item.projectId ? 'projectId' : 'paperId'] = form.uuid if (this.form.isSpecify == 0 && this.form.isEnableCode == 1) { diff --git a/src/pages/match/manage/theoryReport.vue b/src/pages/match/manage/theoryReport.vue index 727a6d5..17f4b56 100644 --- a/src/pages/match/manage/theoryReport.vue +++ b/src/pages/match/manage/theoryReport.vue @@ -64,7 +64,7 @@
{{ info.score }} -

(部分试题待判分,成绩待定)

+

(部分试题待判分,成绩待定)

  • @@ -96,14 +96,16 @@ -
    - 【知识点】 + 【知识点】 {{ kp.name }}
    - 【解析】 + 【解析】
    暂无解析
    -
    +
    + + -
    题目分值:{{ ques.questionScore }}分
    -
    考生得分:分 +
    题目分值:{{ ques.notScored ? '不计分' : ques.questionScore + '分' }}
    +
    考生得分: + +
    + +
    + 评语{{ k + 1 }}: +
    @@ -280,10 +303,15 @@ export default { id: 4, name: '待判分' }, + { + id: 5, + name: '不计分' + }, ], outlines: [], paper: [], essayExist: 0, + notReview: 0, previewImgVisible: false, previewImg: '', pdfVisible: false, @@ -305,8 +333,12 @@ export default { const { questionTypes: types, difficults } = QuesConst const { numToLetter } = Util let essayExist = 0 + let notReview = 0 outline.map(e => { - if (e.questionType === 'essay') essayExist = 1 + if (e.questionType === 'essay') { + essayExist = 1 + if (e.scoringStatus === '未判分') notReview = 1 + } e.shrink = false const type = e.questionType e.questionTypeName = types.find(n => n.id === type).name @@ -319,10 +351,12 @@ export default { } } + n.notScored = n.questionScore === 0 // 不计分(题目分值=0,则为不计分) + if (n.notScored) n.userScore = '-' const opts = n.questionAnswerVersionsList if (type !== 'fill_blank' && type !== 'essay') { // 选择题 if (!n.userScore) n.userScore = 0 - n.isCorrect = n.userScore && n.userScore === n.questionScore ? 1 : 2 + this.handleIsCorrect(n) // 用户选择结果 let { userAnswer } = n @@ -367,14 +401,15 @@ export default { // 填空题需要区分部分正确还是正确、错误 let rightLen = 0 if (n.userAnswerFill) rightLen = n.userAnswerFill.filter(m => m.correct).length // 正确的空的数量 - n.isCorrect = n.userScore && n.questionScore === n.userScore ? 1 : (rightLen ? 3 : 2) + n.isCorrect = n.notScored ? 5 : (n.userScore && n.questionScore === n.userScore ? 1 : (rightLen ? 3 : 2)) } else if (type === 'essay') { // 简答题 - n.isCorrect = 4 // 简答题显示待判分 + this.handleIsCorrect(n) } }) }) this.essayExist = essayExist // 是否存在简答题 + this.notReview = notReview // 是否存在未判分的简答题 this.paper = outline this.outlines = [ ...outline, @@ -402,6 +437,10 @@ export default { this.loading = false } }, + // 判断试题的对错 + handleIsCorrect (n) { + n.isCorrect = n.notScored ? 5 : (n.userScore === undefined ? 4 : (n.userScore === n.questionScore ? 1 : n.userScore ? 3 : 2)) // 简答题没有reviewScore则显示待判分, 有则判断是否跟题目分数相同,完全相同是正确,小于则部分正确,0则错误 + }, scrollToSmooth (position, duration) { let startTime = Date.now() @@ -464,10 +503,44 @@ export default {