|
|
@ -3,81 +3,81 @@ |
|
|
|
<el-drawer title="评阅设置" :visible.sync="setupVisible" size="1200px" :close-on-click-modal="false" |
|
|
|
<el-drawer title="评阅设置" :visible.sync="setupVisible" size="1200px" :close-on-click-modal="false" |
|
|
|
custom-class="setup-dia" @closed="closeDia"> |
|
|
|
custom-class="setup-dia" @closed="closeDia"> |
|
|
|
<div class="flex h-full"> |
|
|
|
<div class="flex h-full"> |
|
|
|
<el-form :model="form" ref="form" label-width="220px" label-suffix=":"> |
|
|
|
<el-form class="p-r-10" :model="form" ref="form" label-width="220px" label-suffix=":"> |
|
|
|
<el-form-item prop="name" label="是否隐藏学生信息"> |
|
|
|
<el-form-item prop="name" label="是否隐藏学生信息"> |
|
|
|
<el-radio-group v-model="form.hide"> |
|
|
|
<el-radio-group v-model="form.anonymizeStudents"> |
|
|
|
<el-radio :label="3">是</el-radio> |
|
|
|
<el-radio :label="1">是</el-radio> |
|
|
|
<el-radio :label="6">否</el-radio> |
|
|
|
<el-radio :label="0">否</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="name" label="自动判分题是否允许人工评阅"> |
|
|
|
<el-form-item v-if="row.hasAutoScoreType" prop="name" label="自动判分题是否允许人工评阅"> |
|
|
|
<el-radio-group v-model="form.hide"> |
|
|
|
<el-radio-group v-model="form.allowManualGrading"> |
|
|
|
<el-radio :label="3">是</el-radio> |
|
|
|
<el-radio :label="1">是</el-radio> |
|
|
|
<el-tooltip placement="top"> |
|
|
|
<el-tooltip placement="top"> |
|
|
|
<div slot="content">自动判分题最终得分取最新一次评分</div> |
|
|
|
<div slot="content">自动判分题最终得分取最新一次评分</div> |
|
|
|
<i class="el-icon-question explain"></i> |
|
|
|
<i class="el-icon-question explain"></i> |
|
|
|
</el-tooltip> |
|
|
|
</el-tooltip> |
|
|
|
<el-radio :label="6">否</el-radio> |
|
|
|
<el-radio :label="0">否</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="name" label="评阅的时间限制"> |
|
|
|
|
|
|
|
<el-radio-group v-model="form.hide"> |
|
|
|
|
|
|
|
<el-radio :label="3">不限时</el-radio> |
|
|
|
|
|
|
|
<el-tooltip placement="top"> |
|
|
|
|
|
|
|
<div slot="content">成绩不公布时,可设置评阅时间不限时</div> |
|
|
|
|
|
|
|
<i class="el-icon-question explain"></i> |
|
|
|
|
|
|
|
</el-tooltip> |
|
|
|
|
|
|
|
<el-radio :label="6">限时</el-radio> |
|
|
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
|
|
<el-date-picker class="m-l-10" v-model="date" align="right" unlink-panels type="datetimerange" |
|
|
|
|
|
|
|
start-placeholder="开始日期" end-placeholder="结束日期" clearable></el-date-picker> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="name" label="每题的评阅人数"> |
|
|
|
|
|
|
|
<el-input style="width: 200px;" placeholder="请输入" v-model.number="form.suggestTime" /> 人 |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="name" label="最终得分取值规则(人工判分题多人评阅时)"> |
|
|
|
|
|
|
|
<el-radio-group v-model="form.hide"> |
|
|
|
|
|
|
|
<el-radio :label="1">取平均分</el-radio> |
|
|
|
|
|
|
|
<el-radio :label="1">取修剪平均分</el-radio> |
|
|
|
|
|
|
|
<el-tooltip placement="top"> |
|
|
|
|
|
|
|
<div slot="content"> |
|
|
|
|
|
|
|
<p>去掉最高分、最低分,取平均分</p> |
|
|
|
|
|
|
|
<p class="m-t-5 m-b-5">1.建议评阅人员≥3人;</p> |
|
|
|
|
|
|
|
<p class="m-b-5">2.若评阅人员为2人,则最终得分为2人评分的平均值;</p> |
|
|
|
|
|
|
|
<p>3.若评阅人员为1人,则最终得分为评阅人的评分;</p> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<i class="el-icon-question explain"></i> |
|
|
|
|
|
|
|
</el-tooltip> |
|
|
|
|
|
|
|
<el-radio :label="1">取加权平均分</el-radio> |
|
|
|
|
|
|
|
<el-tooltip placement="top"> |
|
|
|
|
|
|
|
<div slot="content">每位评阅人员的最新评分乘以其对应的权重后求和</div> |
|
|
|
|
|
|
|
<i class="el-icon-question explain"></i> |
|
|
|
|
|
|
|
</el-tooltip> |
|
|
|
|
|
|
|
<el-radio :label="1">取中位分</el-radio> |
|
|
|
|
|
|
|
<el-radio :label="1">取最高分</el-radio> |
|
|
|
|
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<template v-if="row.hasManualScoreType"> |
|
|
|
|
|
|
|
<el-form-item prop="name" label="评阅的时间限制"> |
|
|
|
|
|
|
|
<el-radio-group v-model="form.isTimed"> |
|
|
|
|
|
|
|
<el-radio :label="0" :disabled="!row.resultsDetails">不限时</el-radio> |
|
|
|
|
|
|
|
<el-tooltip placement="top"> |
|
|
|
|
|
|
|
<div slot="content">成绩不公布时,可设置评阅时间不限时</div> |
|
|
|
|
|
|
|
<i class="el-icon-question explain"></i> |
|
|
|
|
|
|
|
</el-tooltip> |
|
|
|
|
|
|
|
<el-radio :label="1" :disabled="!row.resultsDetails">限时</el-radio> |
|
|
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
|
|
<el-date-picker v-show="form.isTimed" class="m-l-10" v-model="timed" align="right" unlink-panels |
|
|
|
|
|
|
|
type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期" clearable |
|
|
|
|
|
|
|
:picker-options="pickerOptions"></el-date-picker> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="name" label="每题的评阅人数"> |
|
|
|
|
|
|
|
<el-input class="hide-spin" style="width: 200px;" placeholder="请输入" type="number" |
|
|
|
|
|
|
|
v-model.number="form.reviewersPerQuestion" /> 人 |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="name" label="人工判分题最终得分"> |
|
|
|
|
|
|
|
<el-radio-group v-model="form.scoreAggregationRule"> |
|
|
|
|
|
|
|
<el-radio :label="0">取平均分</el-radio> |
|
|
|
|
|
|
|
<el-radio :label="1">取修剪平均分</el-radio> |
|
|
|
|
|
|
|
<el-tooltip placement="top"> |
|
|
|
|
|
|
|
<div slot="content"> |
|
|
|
|
|
|
|
<p>去掉最高分、最低分,取平均分</p> |
|
|
|
|
|
|
|
<p class="m-t-5 m-b-5">1.建议评阅人员≥3人;</p> |
|
|
|
|
|
|
|
<p class="m-b-5">2.若评阅人员为2人,则最终得分为2人评分的平均值;</p> |
|
|
|
|
|
|
|
<p>3.若评阅人员为1人,则最终得分为评阅人的评分;</p> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<i class="el-icon-question explain"></i> |
|
|
|
|
|
|
|
</el-tooltip> |
|
|
|
|
|
|
|
<el-radio :label="2">取加权平均分</el-radio> |
|
|
|
|
|
|
|
<el-tooltip placement="top"> |
|
|
|
|
|
|
|
<div slot="content">每位评阅人员的最新评分乘以其对应的权重后求和</div> |
|
|
|
|
|
|
|
<i class="el-icon-question explain"></i> |
|
|
|
|
|
|
|
</el-tooltip> |
|
|
|
|
|
|
|
<el-radio :label="3">取中位分</el-radio> |
|
|
|
|
|
|
|
<el-radio :label="4">取最高分</el-radio> |
|
|
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-form class="info" label-width="120px" label-suffix=":" disabled> |
|
|
|
<el-form class="info" label-width="110px" disabled> |
|
|
|
<h6>答卷信息</h6> |
|
|
|
<h6>答卷信息</h6> |
|
|
|
<el-form-item prop="name" label="答卷信息"> |
|
|
|
<el-form-item prop="name" label="答卷信息"> |
|
|
|
<el-radio-group v-model="form.hide"> |
|
|
|
<el-radio v-for="(item, i) in types" v-model="row.method" :key="i" :label="item.id">{{ item.name |
|
|
|
<el-radio v-for="(item, i) in types" :key="i" label="item.id">{{ item.name }}</el-radio> |
|
|
|
}}</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="name" label="题目判分类型"> |
|
|
|
<el-form-item prop="name" label="题目判分类型"> |
|
|
|
<el-checkbox-group v-model="form.type"> |
|
|
|
<el-checkbox v-model="row.hasAutoScoreType" :true-label="1">自动判分题</el-checkbox> |
|
|
|
<el-checkbox label="自动判分题"></el-checkbox> |
|
|
|
<el-checkbox v-model="row.hasManualScoreType" :true-label="1">人工判分题</el-checkbox> |
|
|
|
<el-checkbox label="人工判分题"></el-checkbox> |
|
|
|
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="name" label="成绩是否公布"> |
|
|
|
<el-form-item prop="name" label="成绩是否公布"> |
|
|
|
<el-radio-group v-model="form.hide"> |
|
|
|
<el-radio v-model="row.resultsDetails" :label="0">是</el-radio> |
|
|
|
<el-radio :label="3">是</el-radio> |
|
|
|
<span style="margin: 0 10px 0 -20px;font-size: 12px;color: #333;">公布时间:{{ row.resultAnnouncementTime |
|
|
|
<span style="margin: 0 10px 0 -20px;font-size: 12px;color: #333;">公布时间:2024-12-12 12:12:12</span> |
|
|
|
}}</span> |
|
|
|
<el-radio style="margin-top: 10px" :label="6">否</el-radio> |
|
|
|
<el-radio v-model="row.resultsDetails" style="margin-top: 10px" :label="1">否</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -96,8 +96,9 @@ import QuesConst from '@/const/ques' |
|
|
|
import TestPaperConst from '@/const/testPaper' |
|
|
|
import TestPaperConst from '@/const/testPaper' |
|
|
|
import _ from 'lodash' |
|
|
|
import _ from 'lodash' |
|
|
|
import Decimal from 'decimal.js' |
|
|
|
import Decimal from 'decimal.js' |
|
|
|
|
|
|
|
import dayjs from 'dayjs' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
props: ['visible'], |
|
|
|
props: ['visible', 'row'], |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
arabicToChinese: Util.arabicToChinese, |
|
|
|
arabicToChinese: Util.arabicToChinese, |
|
|
@ -105,16 +106,27 @@ export default { |
|
|
|
questionTypes: QuesConst.questionTypes, |
|
|
|
questionTypes: QuesConst.questionTypes, |
|
|
|
setupVisible: false, |
|
|
|
setupVisible: false, |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
|
|
|
|
allowManualGrading: 0, |
|
|
|
|
|
|
|
anonymizeStudents: 0, |
|
|
|
|
|
|
|
evaluationId: '', |
|
|
|
|
|
|
|
isTimed: '', |
|
|
|
|
|
|
|
reviewersPerQuestion: '', |
|
|
|
|
|
|
|
scoreAggregationRule: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
originForm: {}, |
|
|
|
|
|
|
|
timed: [], |
|
|
|
|
|
|
|
pickerOptions: { |
|
|
|
|
|
|
|
disabledDate: time => { |
|
|
|
|
|
|
|
return this.row.resultsDetails ? false : time.getTime() > new Date(this.row.resultAnnouncementTime) // 成绩公布时结束时间不可晚于成绩公布时间 |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
date: [], |
|
|
|
|
|
|
|
types: [ |
|
|
|
types: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: 1, |
|
|
|
id: 0, |
|
|
|
name: '实训' |
|
|
|
name: '实训' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: 2, |
|
|
|
id: 1, |
|
|
|
name: '理论' |
|
|
|
name: '理论' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -122,7 +134,7 @@ export default { |
|
|
|
name: '论文报告' |
|
|
|
name: '论文报告' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: 4, |
|
|
|
id: 2, |
|
|
|
name: '其他' |
|
|
|
name: '其他' |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
@ -132,335 +144,72 @@ export default { |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
visible () { |
|
|
|
visible () { |
|
|
|
this.setupVisible = this.visible |
|
|
|
this.setupVisible = this.visible |
|
|
|
// this.visible && this.init() |
|
|
|
this.visible && this.init() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
|
|
|
|
this.originForm = _.cloneDeep(this.form) |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 初始化 |
|
|
|
// 初始化 |
|
|
|
init () { |
|
|
|
async init () { |
|
|
|
this.handleQuesList() |
|
|
|
this.form = _.cloneDeep(this.originForm) |
|
|
|
if (!this.loaded) { |
|
|
|
this.timed = [] |
|
|
|
this.loaded = 1 |
|
|
|
// 成绩公布 |
|
|
|
this.yearCheck = this.years |
|
|
|
if (!this.row.resultsDetails && this.row.hasManualScoreType) { |
|
|
|
this.getQuesBankType() |
|
|
|
const now = await Util.getNow() |
|
|
|
this.initQuesBank() |
|
|
|
this.timed = [dayjs(now).format('YYYY-MM-DD HH:mm:ss'), ''] |
|
|
|
this.difficult = this.$parent.form.difficult |
|
|
|
this.form.isTimed = 1 // 成绩公布时,默认显示(有主观题时) |
|
|
|
this.difficult && this.difficultChange(this.difficult) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.getDetail() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取题库分类 |
|
|
|
// 获取详情 |
|
|
|
async getQuesBankType () { |
|
|
|
async getDetail () { |
|
|
|
try { |
|
|
|
|
|
|
|
const { data } = await this.$post(this.api.getAllQuestionBankCategories, { |
|
|
|
|
|
|
|
createSource: 1, |
|
|
|
|
|
|
|
status: 1, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.handleList(data) |
|
|
|
|
|
|
|
this.quesBankTypes = data |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取题库 |
|
|
|
|
|
|
|
async getQuesBank () { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const type = this.quesBankTypeVal |
|
|
|
|
|
|
|
const res = await this.$post(this.api.questionBankList, { |
|
|
|
|
|
|
|
status: 1, |
|
|
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
|
|
pageSize: 1000, |
|
|
|
|
|
|
|
questionCategoryId: type.length ? type[type.length - 1] : '', |
|
|
|
|
|
|
|
name: this.quesBankKeyword |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.quesBanks = res.message.records |
|
|
|
|
|
|
|
this.totalQuesBank = res.message.total |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initQuesBank () { |
|
|
|
|
|
|
|
this.curQuesBank = {} |
|
|
|
|
|
|
|
this.pageQuesBank = 1 |
|
|
|
|
|
|
|
this.getQuesBank() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 切换页码 |
|
|
|
|
|
|
|
currentChangeQuesBank (val) { |
|
|
|
|
|
|
|
this.pageQuesBank = val |
|
|
|
|
|
|
|
this.getQuesBank() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 题目多选回调 |
|
|
|
|
|
|
|
questionBankClick (item) { |
|
|
|
|
|
|
|
this.curQuesBank = item |
|
|
|
|
|
|
|
this.knowledgeCheck = false |
|
|
|
|
|
|
|
this.getKnowledgeType() |
|
|
|
|
|
|
|
this.getKnowledge() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理树形 |
|
|
|
|
|
|
|
handleList (list) { |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
if (e.children && e.children.length) { |
|
|
|
|
|
|
|
this.handleList(e.children) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
delete e.children |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取知识点分类 |
|
|
|
|
|
|
|
async getKnowledgeType () { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const { data } = await this.$post(this.api.classificationTreeStructure, { |
|
|
|
|
|
|
|
createSource: 1, |
|
|
|
|
|
|
|
questionBankId: this.curQuesBank.id, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.handleList(data) |
|
|
|
|
|
|
|
this.knowledgeTypes = data |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取知识点 |
|
|
|
|
|
|
|
async getKnowledge () { |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
const { id } = this.curQuesBank |
|
|
|
const id = this.row.evaluationId |
|
|
|
if (id) { |
|
|
|
if (id) { |
|
|
|
const type = this.knowledgeTypeVal |
|
|
|
const { data } = await this.$post(`${this.api.evaluationFind}?id=${id}`) |
|
|
|
const res = await this.$post(this.api.knowledgeHierarchyList, { |
|
|
|
this.form = { |
|
|
|
pageNum: 1, |
|
|
|
allowManualGrading: data.allowManualGrading, |
|
|
|
pageSize: 1000, |
|
|
|
anonymizeStudents: data.anonymizeStudents, |
|
|
|
questionBankId: id, |
|
|
|
evaluationId: data.evaluationId, |
|
|
|
knowledgePointCategoryId: type.length ? type[type.length - 1] : '', |
|
|
|
isTimed: data.isTimed, |
|
|
|
name: this.knowledgeKeyword, |
|
|
|
reviewersPerQuestion: data.reviewersPerQuestion, |
|
|
|
}) |
|
|
|
scoreAggregationRule: data.scoreAggregationRule, |
|
|
|
const list = res.message.records |
|
|
|
} |
|
|
|
const { allKnowledges } = this |
|
|
|
if (data.startTime) this.timed = [data.startTime, data.endTime] |
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
e.check = !!allKnowledges.find(n => n.id === e.id) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.knowledges = list |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 切换页码 |
|
|
|
|
|
|
|
currentChangeKn (val) { |
|
|
|
|
|
|
|
this.pageKn = val |
|
|
|
|
|
|
|
this.getKnowledge() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 知识点全选回调 |
|
|
|
|
|
|
|
knowledgeAllCheckChange (val) { |
|
|
|
|
|
|
|
this.knowledges.map(e => { |
|
|
|
|
|
|
|
e.check = val |
|
|
|
|
|
|
|
this.knowledgeChange(val, e) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 知识点勾选回调 |
|
|
|
|
|
|
|
knowledgeChange (checked, data) { |
|
|
|
|
|
|
|
const checkQues = this.curQuesBank |
|
|
|
|
|
|
|
const index = this.checked.findIndex(e => e.quesBank.id === checkQues.id) |
|
|
|
|
|
|
|
// 已选中的题库数组里有该题库,则往该题库的知识点数组里 |
|
|
|
|
|
|
|
if (index !== -1) { |
|
|
|
|
|
|
|
const ques = this.checked[index] |
|
|
|
|
|
|
|
const i = ques.knowledges.findIndex(e => e.id === data.id) |
|
|
|
|
|
|
|
if (checked && i === -1) { |
|
|
|
|
|
|
|
ques.knowledges.push(data) |
|
|
|
|
|
|
|
} else if (!checked && i >= 0) { |
|
|
|
|
|
|
|
ques.knowledges.splice(i, 1) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
ques.knowledges.length || this.checked.splice(index, 1) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.checked.push({ |
|
|
|
|
|
|
|
quesBank: checkQues, |
|
|
|
|
|
|
|
knowledges: [data] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 处理大纲列表 |
|
|
|
|
|
|
|
handleQuesList () { |
|
|
|
|
|
|
|
this.list = _.cloneDeep(this.$parent.form.paperOutline) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 清空已选 |
|
|
|
|
|
|
|
async clearChecked () { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$confirm(`确认要清空吗?`, '提示', { |
|
|
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.knowledges.map(e => e.check = false) |
|
|
|
|
|
|
|
this.checked = [] |
|
|
|
|
|
|
|
this.knowledgeCheck = false |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 删除题库 |
|
|
|
|
|
|
|
async delQuesBank (i) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$confirm(`确认要移除吗?`, '提示', { |
|
|
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
const k = this.knowledges |
|
|
|
|
|
|
|
this.checked[i].knowledges.map(e => { |
|
|
|
|
|
|
|
const cur = k.findIndex(n => n.id === e.id) |
|
|
|
|
|
|
|
if (cur !== -1) k[cur].check = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.checked.splice(i, 1) |
|
|
|
|
|
|
|
this.knowledgeCheck = false |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
} catch (e) { } |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除知识点 |
|
|
|
|
|
|
|
delKnowledge (i, j, item, k) { |
|
|
|
|
|
|
|
const cur = this.knowledges.findIndex(e => e.id === k.id) |
|
|
|
|
|
|
|
if (cur !== -1) this.knowledges[cur].check = false |
|
|
|
|
|
|
|
item.knowledges.splice(j, 1) |
|
|
|
|
|
|
|
item.knowledges.length || this.checked.splice(i, 1) // 知识点清空了则把该题库删除 |
|
|
|
|
|
|
|
this.knowledgeCheck = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 试卷难度选择回调 |
|
|
|
|
|
|
|
difficultChange (val) { |
|
|
|
|
|
|
|
const difficultyWeights = [0.2, 0.4, 0.6, 0.8] |
|
|
|
|
|
|
|
const names = ['basicDifficulty', 'normalDifficulty', 'hardDifficulty', 'veryHardDifficulty'] |
|
|
|
|
|
|
|
// 遍历题型数组 |
|
|
|
|
|
|
|
this.list.forEach(e => { |
|
|
|
|
|
|
|
const total = e.questionNum |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let already = 0 // 已经分配的数量 |
|
|
|
|
|
|
|
if (val === 1) { |
|
|
|
|
|
|
|
this.$set(e, 'basicDifficulty', Math.floor(total * 0.7)) |
|
|
|
|
|
|
|
this.$set(e, 'normalDifficulty', Math.floor(total * 0.3)) |
|
|
|
|
|
|
|
this.$set(e, 'hardDifficulty', 0) |
|
|
|
|
|
|
|
this.$set(e, 'veryHardDifficulty', 0) |
|
|
|
|
|
|
|
} else if (val === 2) { |
|
|
|
|
|
|
|
this.$set(e, 'basicDifficulty', Math.floor(total * 0.45)) |
|
|
|
|
|
|
|
this.$set(e, 'normalDifficulty', Math.floor(total * 0.55)) |
|
|
|
|
|
|
|
this.$set(e, 'hardDifficulty', 0) |
|
|
|
|
|
|
|
this.$set(e, 'veryHardDifficulty', 0) |
|
|
|
|
|
|
|
} else if (val === 3) { |
|
|
|
|
|
|
|
this.$set(e, 'basicDifficulty', Math.floor(total * 0.3)) |
|
|
|
|
|
|
|
this.$set(e, 'normalDifficulty', Math.floor(total * 0.3)) |
|
|
|
|
|
|
|
this.$set(e, 'hardDifficulty', Math.floor(total * 0.4)) |
|
|
|
|
|
|
|
this.$set(e, 'veryHardDifficulty', 0) |
|
|
|
|
|
|
|
} else if (val === 4) { |
|
|
|
|
|
|
|
this.$set(e, 'basicDifficulty', Math.floor(total * 0.1)) |
|
|
|
|
|
|
|
this.$set(e, 'normalDifficulty', Math.floor(total * 0.1)) |
|
|
|
|
|
|
|
this.$set(e, 'hardDifficulty', Math.floor(total * 0.3)) |
|
|
|
|
|
|
|
this.$set(e, 'veryHardDifficulty', Math.floor(total * 0.5)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
already = Decimal(already).add(e.basicDifficulty).add(e.normalDifficulty).add(e.hardDifficulty).add(e.veryHardDifficulty).toNumber() |
|
|
|
|
|
|
|
// 如果按比例分配还没分配完 |
|
|
|
|
|
|
|
while (total > already) { |
|
|
|
|
|
|
|
e[names[val - 1]]++ |
|
|
|
|
|
|
|
already++ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$set(e, 'randomDifficulty', 0) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 年份全选回调 |
|
|
|
|
|
|
|
yearAllChange (val) { |
|
|
|
|
|
|
|
this.yearCheck = val ? this.years : [] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 年份选择回调 |
|
|
|
|
|
|
|
yearChange (val) { |
|
|
|
|
|
|
|
this.yearAll = val.length === 11 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
async submit () { |
|
|
|
async submit () { |
|
|
|
if (this.submiting) return false |
|
|
|
if (this.submiting) return false |
|
|
|
const { list } = this |
|
|
|
const form = _.cloneDeep(this.form) |
|
|
|
let invalid = 0 |
|
|
|
const { row } = this |
|
|
|
let totalCount = 0 |
|
|
|
if (form.isTimed && !this.timed.length) return Util.warningMsg(`请选择时间限制`) |
|
|
|
for (const i in list) { |
|
|
|
if (this.timed.length) { |
|
|
|
const e = list[i] |
|
|
|
form.startTime = dayjs(this.timed[0]).format('YYYY-MM-DD HH:mm:ss') |
|
|
|
const name = `第${Util.arabicToChinese(+i + 1)}大题` |
|
|
|
form.endTime = dayjs(this.timed[1]).format('YYYY-MM-DD HH:mm:ss') |
|
|
|
if (!e.questionType) { |
|
|
|
|
|
|
|
Util.warningMsg(`${name}请先选择题型`) |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!e.questionNum || isNaN(e.questionNum) || e.questionNum <= 0) { |
|
|
|
|
|
|
|
Util.warningMsg(`${name}的目标题数请输入正整数`) |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let total = Decimal(e.basicDifficulty || 0).add(e.normalDifficulty || 0).add(e.hardDifficulty || 0).add(e.veryHardDifficulty || 0).toNumber() // 先算前4个难度的题数 |
|
|
|
|
|
|
|
if (total) { // 前面4个空有填1个,则清空随机 |
|
|
|
|
|
|
|
this.$set(e, 'randomDifficulty', 0) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
total = +e.randomDifficulty || 0 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (total > e.questionNum) { |
|
|
|
|
|
|
|
Util.warningMsg(`${name}的小题总数大于目标题数,请重新输入`) |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
e.count = total |
|
|
|
|
|
|
|
totalCount = Decimal(totalCount).add(total).toNumber() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (invalid) return false |
|
|
|
form.competitionId = row.id |
|
|
|
if (!totalCount) return Util.warningMsg(`请填写难度题数`) |
|
|
|
form.stageId = row.stageId |
|
|
|
this.submiting = true |
|
|
|
this.submiting = true |
|
|
|
const k = this.allKnowledges.map(e => e.id) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const years = [] |
|
|
|
|
|
|
|
this.yearCheck.map(e => { |
|
|
|
|
|
|
|
if (e === '暂无年份') { |
|
|
|
|
|
|
|
years.push('') |
|
|
|
|
|
|
|
} else if (e === '更早') { |
|
|
|
|
|
|
|
// 选的是更早则直接传1990~2005所有年份 |
|
|
|
|
|
|
|
for (let i = 1990; i < 2006; i++) { |
|
|
|
|
|
|
|
years.push(i) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
years.push(+e) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
e.givenYears = years |
|
|
|
|
|
|
|
e.knowledgePointsIds = k |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
const res = await this.$post(this.api.selectQuestionsByTypeAndDifficulty, list) |
|
|
|
await this.$post(this.api.evaluationSave, form) |
|
|
|
|
|
|
|
this.submiting = false |
|
|
|
let invalid = 0 |
|
|
|
|
|
|
|
let hasQues = 0 |
|
|
|
|
|
|
|
list.map((e, i) => { |
|
|
|
|
|
|
|
if (+e.count !== res.list[i].questions.length) invalid = 1 |
|
|
|
|
|
|
|
if (e.examQuestions.length) hasQues = 1 |
|
|
|
|
|
|
|
e.score = 0 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 3种情况提示不一样 |
|
|
|
|
|
|
|
const tips = invalid && hasQues ? |
|
|
|
|
|
|
|
'此操作会清空当前试卷已添加的试题,并且满足自动选题设置的试题数量不足,确定要继续自动选题吗?' : |
|
|
|
|
|
|
|
invalid && !hasQues ? |
|
|
|
|
|
|
|
'满足自动选题设置的试题数量不足,确认要继续自动选题吗?' : |
|
|
|
|
|
|
|
!invalid && hasQues ? '此操作会清空当前试卷已添加的试题,是否确定要继续自动选题吗?' : |
|
|
|
|
|
|
|
'' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tips) { |
|
|
|
try { |
|
|
|
await this.$confirm(tips, '提示', { |
|
|
|
await this.$confirm('保存成功!', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
confirmButtonText: '前往任务分配', |
|
|
|
cancelButtonText: '取消', |
|
|
|
cancelButtonText: '关闭', |
|
|
|
type: 'warning', |
|
|
|
type: 'warning', |
|
|
|
closeOnClickModal: false, |
|
|
|
closeOnClickModal: false, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.$router.push(`records`) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
this.$parent.initData() |
|
|
|
|
|
|
|
this.setupVisible = false |
|
|
|
} |
|
|
|
} |
|
|
|
list.map((e, i) => { |
|
|
|
|
|
|
|
res.list[i].questions.map((e, i) => { |
|
|
|
|
|
|
|
e.questionId = e.id |
|
|
|
|
|
|
|
e.serialNumber = i + 1 |
|
|
|
|
|
|
|
e.originSort = i + 1 |
|
|
|
|
|
|
|
this.$parent.handleQuesInfo(e) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.$parent.form.paperOutline[i].examQuestions = res.list[i].questions |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.setupVisible = false |
|
|
|
|
|
|
|
this.$parent.calcDifficult() |
|
|
|
|
|
|
|
this.submiting = false |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
this.submiting = false |
|
|
|
this.submiting = false |
|
|
|
} |
|
|
|
} |
|
|
@ -476,7 +225,7 @@ export default { |
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
/deep/.setup-dia { |
|
|
|
/deep/.setup-dia { |
|
|
|
.el-drawer__header { |
|
|
|
.el-drawer__header { |
|
|
|
margin-bottom: 0; |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.explain { |
|
|
|
.explain { |
|
|
|