|
|
@ -160,14 +160,18 @@ |
|
|
|
<p class="fill-title">每空分值</p> |
|
|
|
<p class="fill-title">每空分值</p> |
|
|
|
<div v-for="(score, k) in ques.fillScores" :key="k" class="input-wrap"> |
|
|
|
<div v-for="(score, k) in ques.fillScores" :key="k" class="input-wrap"> |
|
|
|
<el-input class="l-input" placeholder="请输入分值" v-model="score.val" |
|
|
|
<el-input class="l-input" placeholder="请输入分值" v-model="score.val" |
|
|
|
@change="fillScoreChange(ques)" />分 填空项{{ k + 1 }} |
|
|
|
@change="fillScoreChange(ques)" /> |
|
|
|
|
|
|
|
分 填空项{{ k + 1 }} |
|
|
|
|
|
|
|
<span |
|
|
|
|
|
|
|
v-if="ques.answerData && ques.answerData.length && ques.answerData[k]"> 建议分值占比:{{ |
|
|
|
|
|
|
|
ques.answerData[k].scoreProportion }}%</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div slot="reference" class="input-wrap"> |
|
|
|
<div slot="reference" class="input-wrap"> |
|
|
|
查看每空分值<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" readonly /> |
|
|
|
查看每空分值<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" readonly /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-popover> |
|
|
|
</el-popover> |
|
|
|
<el-button v-if="!ques.isDel" type="text" @click="toQues(item, j, ques)">编辑试题</el-button> |
|
|
|
<el-button v-if="!ques.isDel" type="text" @click="toQues(item, j, ques, 1)">编辑试题</el-button> |
|
|
|
<el-button type="text" @click="showManualDia(item, j, ques)">更换试题</el-button> |
|
|
|
<el-button type="text" @click="showManualDia(item, j, ques)">更换试题</el-button> |
|
|
|
<el-button type="text" @click="showManualDia(item, j)">添加试题</el-button> |
|
|
|
<el-button type="text" @click="showManualDia(item, j)">添加试题</el-button> |
|
|
|
<el-button type="text" @click="delQues(item, j)">移除试题</el-button> |
|
|
|
<el-button type="text" @click="delQues(item, j)">移除试题</el-button> |
|
|
@ -178,20 +182,20 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="stem" :id="'stem' + ques.questionVersionId" v-html="ques.stem"></div> |
|
|
|
<div class="stem html-parse" :id="'stem' + ques.questionVersionId" v-html="ques.stem"></div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 单选、多选、判断的选项 --> |
|
|
|
<!-- 单选、多选、判断的选项 --> |
|
|
|
<template |
|
|
|
<template |
|
|
|
v-if="item.questionType !== 'fill_blank' && item.questionType !== 'essay' && ques.questionAnswerVersionsList"> |
|
|
|
v-if="item.questionType !== 'fill_blank' && item.questionType !== 'essay' && ques.questionAnswerVersionsList"> |
|
|
|
<div v-for="(opt, j) in ques.questionAnswerVersionsList" :key="j" class="opt"> |
|
|
|
<div v-for="(opt, j) in ques.questionAnswerVersionsList" :key="j" class="opt"> |
|
|
|
<span>{{ numToLetter(j) }}. </span> |
|
|
|
<span>{{ numToLetter(j) }}. </span> |
|
|
|
<div class="text" v-html="opt.optionText"></div> |
|
|
|
<div class="text html-parse" v-html="opt.optionText"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<div class="bottom-line"> |
|
|
|
<div class="bottom-line"> |
|
|
|
【{{ item.questionType === 'essay' ? '参考答案' : '正确答案' }}】: |
|
|
|
【{{ item.questionType === 'essay' ? '参考答案' : '正确答案' }}】: |
|
|
|
<div v-html="getCorrectAnswer(ques)" class="ans"></div> |
|
|
|
<div v-html="getCorrectAnswer(ques)" class="ans html-parse"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="ques.knowledgePointList && ques.knowledgePointList.length" class="bottom-line"> |
|
|
|
<div v-if="ques.knowledgePointList && ques.knowledgePointList.length" class="bottom-line"> |
|
|
@ -200,6 +204,10 @@ |
|
|
|
effect="plain">{{ |
|
|
|
effect="plain">{{ |
|
|
|
kp.name }}</el-tag> |
|
|
|
kp.name }}</el-tag> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="ques.questionBankName" class="bottom-line"> |
|
|
|
|
|
|
|
<span>来自:</span> |
|
|
|
|
|
|
|
<div>{{ ques.questionBankName }}</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</draggable> |
|
|
|
</draggable> |
|
|
@ -215,7 +223,9 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="form.paperOutline && form.paperOutline.length" class="layer"> |
|
|
|
<draggable v-if="form.paperOutline && form.paperOutline.length"> |
|
|
|
|
|
|
|
<!-- <transition-group :key="1"> --> |
|
|
|
|
|
|
|
<div class="layer" id="layer" ref="layer"> |
|
|
|
<table class="table"> |
|
|
|
<table class="table"> |
|
|
|
<thead> |
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
@ -228,7 +238,7 @@ |
|
|
|
<tr v-for="(item, i) in form.paperOutline" :key="i"> |
|
|
|
<tr v-for="(item, i) in form.paperOutline" :key="i"> |
|
|
|
<td>第{{ arabicToChinese(i + 1) }}大题</td> |
|
|
|
<td>第{{ arabicToChinese(i + 1) }}大题</td> |
|
|
|
<td>{{ item.examQuestions.length }}/{{ item.questionNum }}</td> |
|
|
|
<td>{{ item.examQuestions.length }}/{{ item.questionNum }}</td> |
|
|
|
<td>{{ item.examQuestions.reduce((e, j) => (e += +j.score), 0) }}/{{ item.targetScore }}</td> |
|
|
|
<td>{{ item.examQuestions.reduce((e, j) => (e += +j.score), 0) || 0 }}/{{ item.targetScore }}</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<td>总计</td> |
|
|
|
<td>总计</td> |
|
|
@ -237,8 +247,9 @@ |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- </transition-group> --> |
|
|
|
|
|
|
|
</draggable> |
|
|
|
|
|
|
|
|
|
|
|
<Template :visible.sync="templateVisible" /> |
|
|
|
<Template :visible.sync="templateVisible" /> |
|
|
|
<Manual :visible.sync="manualVisible" :questionType.sync="curType.questionType" /> |
|
|
|
<Manual :visible.sync="manualVisible" :questionType.sync="curType.questionType" /> |
|
|
@ -247,13 +258,14 @@ |
|
|
|
|
|
|
|
|
|
|
|
<el-drawer title="编辑试题" :visible.sync="addQuesVisible" size="1200px" :close-on-click-modal="false" |
|
|
|
<el-drawer title="编辑试题" :visible.sync="addQuesVisible" size="1200px" :close-on-click-modal="false" |
|
|
|
custom-class="editques-dia"> |
|
|
|
custom-class="editques-dia"> |
|
|
|
<QuesDetail :paperType.sync="testPaperType" :curQues.sync="curRow" @closeAdd="closeAdd" |
|
|
|
<QuesDetail :key="quesKey" :paperType.sync="testPaperType" :curQues.sync="curRow" @closeAdd="closeAdd" |
|
|
|
@updateQues="updateQues" /> |
|
|
|
@updateQues="updateQues" /> |
|
|
|
</el-drawer> |
|
|
|
</el-drawer> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import Draggable from 'vuedraggable' |
|
|
|
import Draggable from 'vuedraggable' |
|
|
|
|
|
|
|
import Sortable from 'sortablejs' |
|
|
|
import UeditorPlus from '@/components/ueditorPlus' |
|
|
|
import UeditorPlus from '@/components/ueditorPlus' |
|
|
|
import Breadcrumb from '@/components/breadcrumb' |
|
|
|
import Breadcrumb from '@/components/breadcrumb' |
|
|
|
import Template from './template' |
|
|
|
import Template from './template' |
|
|
@ -394,6 +406,7 @@ export default { |
|
|
|
difficultSelected: false, |
|
|
|
difficultSelected: false, |
|
|
|
|
|
|
|
|
|
|
|
addQuesVisible: false, |
|
|
|
addQuesVisible: false, |
|
|
|
|
|
|
|
quesKey: 1, |
|
|
|
testPaperType: 2, |
|
|
|
testPaperType: 2, |
|
|
|
|
|
|
|
|
|
|
|
repeatVisible: false, |
|
|
|
repeatVisible: false, |
|
|
@ -403,14 +416,6 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
// 目标总题数 |
|
|
|
|
|
|
|
questionCount () { |
|
|
|
|
|
|
|
return this.form.paperOutline.reduce((e, j) => (e += +j.questionNum), 0) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 目标总分 |
|
|
|
|
|
|
|
score () { |
|
|
|
|
|
|
|
return this.form.paperOutline.reduce((e, j) => (e += +j.targetScore), 0) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 试题概览 |
|
|
|
// 试题概览 |
|
|
|
overview () { |
|
|
|
overview () { |
|
|
|
const paper = this.form.paperOutline |
|
|
|
const paper = this.form.paperOutline |
|
|
@ -449,6 +454,11 @@ export default { |
|
|
|
name: '创建试卷' |
|
|
|
name: '创建试卷' |
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
// console.log(44, Sortable, document.querySelector('#layer')) |
|
|
|
|
|
|
|
// new Sortable(document.querySelector('#layer'), { |
|
|
|
|
|
|
|
// group: "name", |
|
|
|
|
|
|
|
// sort: true, |
|
|
|
|
|
|
|
// }) |
|
|
|
this.getDetail() |
|
|
|
this.getDetail() |
|
|
|
this.getType() |
|
|
|
this.getType() |
|
|
|
this.getProfessional() |
|
|
|
this.getProfessional() |
|
|
@ -464,6 +474,8 @@ export default { |
|
|
|
id: paperId |
|
|
|
id: paperId |
|
|
|
}) |
|
|
|
}) |
|
|
|
const r = res.examPaper |
|
|
|
const r = res.examPaper |
|
|
|
|
|
|
|
delete r.createTime |
|
|
|
|
|
|
|
delete r.updateTime |
|
|
|
const paper = r.paperOutline |
|
|
|
const paper = r.paperOutline |
|
|
|
paper.map(e => { |
|
|
|
paper.map(e => { |
|
|
|
e.shrink = false |
|
|
|
e.shrink = false |
|
|
@ -553,6 +565,7 @@ export default { |
|
|
|
return { |
|
|
|
return { |
|
|
|
questionNum: e.examQuestions.length, |
|
|
|
questionNum: e.examQuestions.length, |
|
|
|
targetScore: e.targetScore, |
|
|
|
targetScore: e.targetScore, |
|
|
|
|
|
|
|
questionType: e.questionType, |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -573,7 +586,8 @@ export default { |
|
|
|
const { data } = await this.$post(this.api.avgValues, { |
|
|
|
const { data } = await this.$post(this.api.avgValues, { |
|
|
|
avgValueList: [{ |
|
|
|
avgValueList: [{ |
|
|
|
questionNum: item.examQuestions.length, |
|
|
|
questionNum: item.examQuestions.length, |
|
|
|
targetScore: +item.targetScore |
|
|
|
targetScore: +item.targetScore, |
|
|
|
|
|
|
|
questionType: item.questionType, |
|
|
|
}] |
|
|
|
}] |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (data && data.avgValueList && data.avgValueList.length) { |
|
|
|
if (data && data.avgValueList && data.avgValueList.length) { |
|
|
@ -587,10 +601,11 @@ export default { |
|
|
|
// 填空题一键分配 |
|
|
|
// 填空题一键分配 |
|
|
|
async fillBlankAllocation (list) { |
|
|
|
async fillBlankAllocation (list) { |
|
|
|
const param = list.map(e => { |
|
|
|
const param = list.map(e => { |
|
|
|
let { answerData } = e.questionAnswerVersionsList[0] |
|
|
|
let { answerData } = e |
|
|
|
if (answerData) { |
|
|
|
if (answerData) { |
|
|
|
answerData = JSON.parse(answerData) |
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
questionType: e.questionType, |
|
|
|
|
|
|
|
answerData: e.questionAnswerVersionsList[0].answerData, |
|
|
|
questionNum: answerData.length, |
|
|
|
questionNum: answerData.length, |
|
|
|
targetScore: e.score, |
|
|
|
targetScore: e.score, |
|
|
|
questionId: e.questionVersionId |
|
|
|
questionId: e.questionVersionId |
|
|
@ -606,7 +621,6 @@ export default { |
|
|
|
// scores里有-1则不用循环 |
|
|
|
// scores里有-1则不用循环 |
|
|
|
if (!e.scores.includes(-1)) { |
|
|
|
if (!e.scores.includes(-1)) { |
|
|
|
const { fillScores } = list[i] |
|
|
|
const { fillScores } = list[i] |
|
|
|
debugger |
|
|
|
|
|
|
|
if (fillScores) { |
|
|
|
if (fillScores) { |
|
|
|
for (const j in fillScores) { |
|
|
|
for (const j in fillScores) { |
|
|
|
fillScores[j].val = e.scores[j] |
|
|
|
fillScores[j].val = e.scores[j] |
|
|
@ -647,9 +661,8 @@ export default { |
|
|
|
getCorrectAnswer (e) { |
|
|
|
getCorrectAnswer (e) { |
|
|
|
if (e.questionType === 'fill_blank') { // 填空题 |
|
|
|
if (e.questionType === 'fill_blank') { // 填空题 |
|
|
|
// answerData里存了该填空题所有填空项的正确答案及分值占比,对象转化为字符串存起来了 |
|
|
|
// answerData里存了该填空题所有填空项的正确答案及分值占比,对象转化为字符串存起来了 |
|
|
|
let data = e.questionAnswerVersionsList[0].answerData |
|
|
|
let data = e.answerData |
|
|
|
if (data) { |
|
|
|
if (data) { |
|
|
|
data = JSON.parse(data) |
|
|
|
|
|
|
|
let result = '' |
|
|
|
let result = '' |
|
|
|
data.map((e, i) => { |
|
|
|
data.map((e, i) => { |
|
|
|
result += `填空项${i + 1}:${e.fills.map(n => n.val).join('|')};` |
|
|
|
result += `填空项${i + 1}:${e.fills.map(n => n.val).join('|')};` |
|
|
@ -687,7 +700,7 @@ export default { |
|
|
|
let { answerData } = opts[0] |
|
|
|
let { answerData } = opts[0] |
|
|
|
if (answerData) { |
|
|
|
if (answerData) { |
|
|
|
answerData = JSON.parse(answerData) |
|
|
|
answerData = JSON.parse(answerData) |
|
|
|
|
|
|
|
ques.answerData = answerData |
|
|
|
// 正确答案 |
|
|
|
// 正确答案 |
|
|
|
let { jsonText } = ques |
|
|
|
let { jsonText } = ques |
|
|
|
let scores |
|
|
|
let scores |
|
|
@ -716,7 +729,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 编辑试题 |
|
|
|
// 编辑试题 |
|
|
|
toQues (item, i, ques) { |
|
|
|
toQues (item, i, ques, type) { |
|
|
|
|
|
|
|
this.testPaperType = type |
|
|
|
|
|
|
|
this.quesKey++ |
|
|
|
this.curType = item |
|
|
|
this.curType = item |
|
|
|
this.curQuesIndex = i |
|
|
|
this.curQuesIndex = i |
|
|
|
this.curRow = ques |
|
|
|
this.curRow = ques |
|
|
@ -730,7 +745,6 @@ export default { |
|
|
|
updateQues (ques, id) { |
|
|
|
updateQues (ques, id) { |
|
|
|
ques.questionAnswerVersionsList = ques.questionAnswerVersions |
|
|
|
ques.questionAnswerVersionsList = ques.questionAnswerVersions |
|
|
|
delete ques.questionAnswerVersions |
|
|
|
delete ques.questionAnswerVersions |
|
|
|
ques.questionVersionId = id |
|
|
|
|
|
|
|
this.curType.examQuestions[this.curQuesIndex] = Object.assign(this.curRow, ques) |
|
|
|
this.curType.examQuestions[this.curQuesIndex] = Object.assign(this.curRow, ques) |
|
|
|
this.calcDifficult() |
|
|
|
this.calcDifficult() |
|
|
|
}, |
|
|
|
}, |
|
|
@ -783,14 +797,16 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 移除试题 |
|
|
|
// 移除试题 |
|
|
|
async delQues (item, i) { |
|
|
|
async delQues (item, i, noConfirm) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
if (!noConfirm) { |
|
|
|
await this.$confirm(`确认要移除吗?`, '提示', { |
|
|
|
await this.$confirm(`确认要移除吗?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
type: 'warning', |
|
|
|
closeOnClickModal: false, |
|
|
|
closeOnClickModal: false, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
item.examQuestions.splice(i, 1) |
|
|
|
item.examQuestions.splice(i, 1) |
|
|
|
item.checkAll = false |
|
|
|
item.checkAll = false |
|
|
|
this.calcDifficult() |
|
|
|
this.calcDifficult() |
|
|
@ -993,7 +1009,7 @@ export default { |
|
|
|
if (typeof form.classificationId === 'object') form.classificationId = form.classificationId[form.classificationId.length - 1] |
|
|
|
if (typeof form.classificationId === 'object') form.classificationId = form.classificationId[form.classificationId.length - 1] |
|
|
|
|
|
|
|
|
|
|
|
const { questionTypes } = QuesConst |
|
|
|
const { questionTypes } = QuesConst |
|
|
|
form.questionType = [...new Set(paper.map(e => questionTypes.find(n => n.id === e.questionType).name))].join('、') // 试题类型 |
|
|
|
form.questionType = [...new Set(paper.map(e => questionTypes.find(n => n.id === e.questionType).name))].join(',') // 试题类型 |
|
|
|
form.createSource = 1 |
|
|
|
form.createSource = 1 |
|
|
|
if (isCopy) form.paperId = '' |
|
|
|
if (isCopy) form.paperId = '' |
|
|
|
this.tempForm = form |
|
|
|
this.tempForm = form |
|
|
@ -1157,6 +1173,20 @@ export default { |
|
|
|
border-radius: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/deep/.html-parse { |
|
|
|
|
|
|
|
table { |
|
|
|
|
|
|
|
display: table; |
|
|
|
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
|
|
|
border-collapse: collapse; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
th, |
|
|
|
|
|
|
|
td { |
|
|
|
|
|
|
|
padding: 5px 10px; |
|
|
|
|
|
|
|
border: 1px solid #DDD; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.stem { |
|
|
|
.stem { |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|
} |
|
|
@ -1192,7 +1222,7 @@ export default { |
|
|
|
.bottom-line { |
|
|
|
.bottom-line { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
align-items: baseline; |
|
|
|
align-items: baseline; |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
font-size: 13px; |
|
|
|
font-size: 13px; |
|
|
|
color: #333; |
|
|
|
color: #333; |
|
|
|
} |
|
|
|
} |
|
|
|