提交 b5214761 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 01bcb2cb
...@@ -261,6 +261,13 @@ export default { ...@@ -261,6 +261,13 @@ export default {
this.questionList.forEach(question => { this.questionList.forEach(question => {
rules.push(Object.assign({}, question)) rules.push(Object.assign({}, question))
}) })
for (let i = 0; i < rules.length; i++) {
const item = rules[i]
if (!item.question_score || !item.question_num) {
this.$message.error(`第${i + 1}行规则配置错误,请检查后重试`)
return
}
}
const parmas = { id: this.data.id, permission: this.form.permission, rules } const parmas = { id: this.data.id, permission: this.form.permission, rules }
updatePaperRules(parmas).then(res => { updatePaperRules(parmas).then(res => {
this.$message.success('保存成功') this.$message.success('保存成功')
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
> >
</template> </template>
<template v-if="data.paper_type === 2"> <template v-if="data.paper_type === 2">
<el-button type="primary" @click="showSelectQuestion">自动组卷</el-button> <el-button type="primary" @click="handleAutoPaper">自动组卷</el-button>
</template> </template>
</template> </template>
<question-list <question-list
...@@ -115,6 +115,18 @@ export default { ...@@ -115,6 +115,18 @@ export default {
} }
}, },
methods: { methods: {
// 自动组卷添加试题
handleAutoPaper() {
if (this.questions.length) {
this.$confirm('该试卷已自动组卷完成,再次自动组卷将会清空现有试题,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(this.showSelectQuestion)
} else {
this.showSelectQuestion()
}
},
// 增加试题 // 增加试题
showSelectQuestion() { showSelectQuestion() {
this.visible = true this.visible = true
......
...@@ -81,8 +81,8 @@ export default { ...@@ -81,8 +81,8 @@ export default {
} }
], ],
columns: [ columns: [
{ type: 'selection', width: '50px', fixed: 'left' }, { type: 'selection', fixed: 'left' },
{ type: 'index', label: '序号', minWidth: '50px', fixed: 'left' }, { type: 'index', label: '序号', fixed: 'left' },
{ {
label: '组卷模式', label: '组卷模式',
prop: 'paper_type', prop: 'paper_type',
...@@ -91,8 +91,16 @@ export default { ...@@ -91,8 +91,16 @@ export default {
return map[row.paper_type] || row.paper_type return map[row.paper_type] || row.paper_type
} }
}, },
{ label: '试卷分类', prop: 'paper_category.category_name' }, {
{ label: '试卷名称', prop: 'paper_title' }, label: '试卷用途',
prop: 'paper_uses',
computed: ({ row }) => {
const map = { 1: '考试', 2: '课后作业', 3: '课程测试' }
return map[row.paper_type] || row.paper_type
}
},
{ label: '试卷分类', prop: 'paper_category.category_name', minWidth: 200 },
{ label: '试卷名称', prop: 'paper_title', minWidth: 200 },
{ label: '总分', prop: 'paper_total_score' }, { label: '总分', prop: 'paper_total_score' },
{ label: '及格分数', prop: 'pass_score' }, { label: '及格分数', prop: 'pass_score' },
{ label: '更新人', prop: 'operator.realname' }, { label: '更新人', prop: 'operator.realname' },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论