|
|
@ -1,8 +1,8 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<Breadcrumb :data="crumbs" /> |
|
|
|
<Breadcrumb :data="crumbs" /> |
|
|
|
<p class="page-name mb">试卷</p> |
|
|
|
|
|
|
|
<el-form :model="form" :rules="rules" class="input-form model" ref="form" label-width="140px"> |
|
|
|
<el-form :model="form" :rules="rules" class="input-form model" ref="form" label-width="140px"> |
|
|
|
|
|
|
|
<p class="page-name mb">试卷基础信息</p> |
|
|
|
<el-form-item prop="name" label="试卷名称"> |
|
|
|
<el-form-item prop="name" label="试卷名称"> |
|
|
|
<el-input style="width: 940px" placeholder="请输入试卷名称" v-model="form.name" clearable maxlength="100" /> |
|
|
|
<el-input style="width: 940px" placeholder="请输入试卷名称" v-model="form.name" clearable maxlength="100" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -14,7 +14,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="classificationId" label="所属试卷分类"> |
|
|
|
<el-form-item prop="classificationId" label="所属试卷分类"> |
|
|
|
<el-cascader filterable placeholder="请选择所属试卷分类" :options="types" v-model="form.classificationId" |
|
|
|
<el-cascader filterable placeholder="请选择所属试卷分类" :options="types" v-model="form.classificationId" |
|
|
|
:props="cascaderProps" clearable style="width: 100%"> |
|
|
|
:props="cascaderProps" style="width: 100%"> |
|
|
|
</el-cascader> |
|
|
|
</el-cascader> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -38,7 +38,8 @@ |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="difficult" label="试卷难度"> |
|
|
|
<el-form-item prop="difficult" label="试卷难度"> |
|
|
|
<el-select v-model="form.difficult" placeholder="系统自动评估,也可手动选择" @change="difficultSelected = true"> |
|
|
|
<el-select v-model="form.difficult" clearable placeholder="系统自动评估,也可手动选择" |
|
|
|
|
|
|
|
@change="val => difficultSelected = !!val"> |
|
|
|
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
<el-tooltip placement="top"> |
|
|
|
<el-tooltip placement="top"> |
|
|
@ -67,9 +68,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
<div class="line"></div> |
|
|
|
<div class="line"></div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex j-between m-b-20"> |
|
|
|
<p class="page-name mb">试卷大纲</p> |
|
|
|
<p>默认模板</p> |
|
|
|
<div class="relative text-center m-b-40"> |
|
|
|
<el-button type="primary" size="small" @click="showTemplate">选择大纲模板</el-button> |
|
|
|
<p class="fs-16">{{ templateName }}</p> |
|
|
|
|
|
|
|
<el-button class="tem-btn" type="primary" size="small" @click="showTemplate">选择大纲模板</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="form.paperOutline" stripe header-align="center" row-key="id"> |
|
|
|
<el-table :data="form.paperOutline" stripe header-align="center" row-key="id"> |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
@ -105,7 +107,7 @@ |
|
|
|
<div class="line"></div> |
|
|
|
<div class="line"></div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex j-between a-center"> |
|
|
|
<div class="flex j-between a-center"> |
|
|
|
<h6 class="page-name" style="margin-bottom: 0">选择试题</h6> |
|
|
|
<h6 class="page-name" style="margin-bottom: 0">试卷试题</h6> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" @click="allocationAll">一键分配分值</el-button> |
|
|
|
<el-button type="primary" @click="allocationAll">一键分配分值</el-button> |
|
|
|
<el-button type="primary" @click="showAuto">自动选题</el-button> |
|
|
|
<el-button type="primary" @click="showAuto">自动选题</el-button> |
|
|
@ -144,7 +146,7 @@ |
|
|
|
<span class="label">{{ j + 1 }} / {{ item.examQuestions.length }}</span> |
|
|
|
<span class="label">{{ j + 1 }} / {{ item.examQuestions.length }}</span> |
|
|
|
<span class="label">{{ questionTypes.find(e => e.id === item.questionType).name }}</span> |
|
|
|
<span class="label">{{ questionTypes.find(e => e.id === item.questionType).name }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="stem" :id="'stem' + ques.questionVersionId" v-html="getQuesStem(ques)"></div> |
|
|
|
<div class="stem" :id="'stem' + ques.questionVersionId" v-html="ques.stem"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
@ -162,32 +164,32 @@ |
|
|
|
【{{ item.questionType === 'essay' ? '参考答案' : '正确答案' }}】: |
|
|
|
【{{ item.questionType === 'essay' ? '参考答案' : '正确答案' }}】: |
|
|
|
<div v-html="getCorrectAnswer(ques)"></div> |
|
|
|
<div v-html="getCorrectAnswer(ques)"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="actions"> |
|
|
|
</div> |
|
|
|
<p v-if="item.questionType !== 'fill_blank'" class="m-r-10 input-wrap"> |
|
|
|
<div class="actions"> |
|
|
|
(<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" />分)</p> |
|
|
|
<p v-if="item.questionType !== 'fill_blank'" class="m-r-10 input-wrap"> |
|
|
|
|
|
|
|
(<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" />分)</p> |
|
|
|
<el-popover v-else placement="bottom" width="400" trigger="click"> |
|
|
|
|
|
|
|
<div v-if="ques.fillScores" class="fill-scores"> |
|
|
|
<el-popover v-else placement="bottom" width="400" trigger="click"> |
|
|
|
<p class="fill-title">每空分值</p> |
|
|
|
<div v-if="ques.fillScores" class="fill-scores"> |
|
|
|
<div v-for="(score, k) in ques.fillScores" :key="k" class="input-wrap"> |
|
|
|
<p class="fill-title">每空分值</p> |
|
|
|
<el-input class="l-input" placeholder="请输入分值" v-model="score.val" |
|
|
|
<div v-for="(score, k) in ques.fillScores" :key="k" class="input-wrap"> |
|
|
|
@change="fillScoreChange(ques)" />分 填空项{{ k + 1 }} |
|
|
|
<el-input class="l-input" placeholder="请输入分值" v-model="score.val" |
|
|
|
</div> |
|
|
|
@change="fillScoreChange(ques)" />分 填空项{{ k + 1 }} |
|
|
|
</div> |
|
|
|
|
|
|
|
<div slot="reference" class="input-wrap"> |
|
|
|
|
|
|
|
查看每空分值<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-popover> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-button type="text" @click="toQues(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="delQues(item, j)">移除试题</el-button> |
|
|
|
|
|
|
|
<div class="input-wrap"> |
|
|
|
|
|
|
|
<span>排序</span> |
|
|
|
|
|
|
|
<el-input class="l-input sort-input" v-model="ques.serialNumber" |
|
|
|
|
|
|
|
@change="sortChange(item, ques)" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div slot="reference" class="input-wrap"> |
|
|
|
|
|
|
|
查看每空分值<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" readonly /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-popover> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-button type="text" @click="toQues(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="delQues(item, j)">移除试题</el-button> |
|
|
|
|
|
|
|
<div class="input-wrap"> |
|
|
|
|
|
|
|
<span>排序</span> |
|
|
|
|
|
|
|
<el-input class="l-input sort-input" v-model="ques.serialNumber" |
|
|
|
|
|
|
|
@change="sortChange(item, ques)" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -198,8 +200,8 @@ |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<div class="btns"> |
|
|
|
<div class="btns"> |
|
|
|
<el-button @click="submit(1)">保存草稿</el-button> |
|
|
|
<el-button @click="submit(0)">保存草稿</el-button> |
|
|
|
<el-button type="primary" @click="submit(0)">发布</el-button> |
|
|
|
<el-button type="primary" @click="submit(1)">发布</el-button> |
|
|
|
<el-button v-if="paperId" @click="preview">预览</el-button> |
|
|
|
<el-button v-if="paperId" @click="preview">预览</el-button> |
|
|
|
<el-button @click="back">取消</el-button> |
|
|
|
<el-button @click="back">取消</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -224,6 +226,7 @@ import dayjs from 'dayjs' |
|
|
|
import QuesConst from '@/const/ques' |
|
|
|
import QuesConst from '@/const/ques' |
|
|
|
import TestPaperConst from '@/const/testPaper' |
|
|
|
import TestPaperConst from '@/const/testPaper' |
|
|
|
import Decimal from 'decimal.js' |
|
|
|
import Decimal from 'decimal.js' |
|
|
|
|
|
|
|
import { template } from 'lodash' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
components: { UeditorPlus, Breadcrumb, Template, Manual, Auto, RepeatQues, Draggable }, |
|
|
|
components: { UeditorPlus, Breadcrumb, Template, Manual, Auto, RepeatQues, Draggable }, |
|
|
@ -333,6 +336,7 @@ export default { |
|
|
|
{ required: true, message: '请输入试卷名称', trigger: 'blur' } |
|
|
|
{ required: true, message: '请输入试卷名称', trigger: 'blur' } |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
templateName: '默认模板', |
|
|
|
templateVisible: false, |
|
|
|
templateVisible: false, |
|
|
|
manualVisible: false, |
|
|
|
manualVisible: false, |
|
|
|
curType: {}, |
|
|
|
curType: {}, |
|
|
@ -399,11 +403,12 @@ export default { |
|
|
|
e.examQuestions.map((n, j) => { |
|
|
|
e.examQuestions.map((n, j) => { |
|
|
|
n.originSort = j + 1 |
|
|
|
n.originSort = j + 1 |
|
|
|
Object.assign(n, n.question) |
|
|
|
Object.assign(n, n.question) |
|
|
|
|
|
|
|
this.handleFillScore(n) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
if (r.particularYear) r.particularYear = r.particularYear + '' |
|
|
|
if (r.particularYear) r.particularYear = r.particularYear + '' |
|
|
|
if (r.professionalId) r.professionalId = r.professionalId.split(',').map(e => +e) |
|
|
|
r.professionalId = r.professionalId ? r.professionalId.split(',').map(e => +e) : [] |
|
|
|
this.form = r |
|
|
|
this.form = r |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { } |
|
|
|
} catch (e) { } |
|
|
@ -530,14 +535,11 @@ export default { |
|
|
|
data.avgValueList.map((e, i) => { |
|
|
|
data.avgValueList.map((e, i) => { |
|
|
|
// scores里有-1则不用循环 |
|
|
|
// scores里有-1则不用循环 |
|
|
|
if (!e.scores.includes(-1)) { |
|
|
|
if (!e.scores.includes(-1)) { |
|
|
|
const stem = document.querySelector(`#stem` + e.questionVersionId) |
|
|
|
const { fillScores } = list[i] |
|
|
|
if (stem) { |
|
|
|
debugger |
|
|
|
const inputs = stem.querySelectorAll('.fill-input') |
|
|
|
if (fillScores) { |
|
|
|
if (inputs) { |
|
|
|
for (const j in fillScores) { |
|
|
|
for (const j in e.scores) { |
|
|
|
fillScores[j].val = e.scores[j] |
|
|
|
const item = inputs[j] |
|
|
|
|
|
|
|
inputs[j].value = e.scores[j] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -588,35 +590,45 @@ export default { |
|
|
|
} else if (e.questionType === 'essay') { // 问答题取参考答案 |
|
|
|
} else if (e.questionType === 'essay') { // 问答题取参考答案 |
|
|
|
return e.questionAnswerVersionsList[0].referenceAnswer || '暂无' |
|
|
|
return e.questionAnswerVersionsList[0].referenceAnswer || '暂无' |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const correct = e.questionAnswerVersionsList.filter(e => e.answerIsCorrect) |
|
|
|
if (e.questionAnswerVersionsList) { |
|
|
|
return correct ? (e.questionType === 'judgement' ? correct[0].optionText : correct.map(e => Util.numToLetter(e.optionNumber - 1)).join('')) : '' // 单选多选显示ABC选项,判断题显示选项内容 |
|
|
|
const correct = e.questionAnswerVersionsList.filter(e => e.answerIsCorrect) |
|
|
|
|
|
|
|
return correct ? (e.questionType === 'judgement' ? correct[0].optionText : correct.map(e => Util.numToLetter(e.optionNumber - 1)).join('')) : '' // 单选多选显示ABC选项,判断题显示选项内容 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 处理题干显示 |
|
|
|
|
|
|
|
getQuesStem (ques) { |
|
|
|
// 填空题的小空分数处理 |
|
|
|
let { stem } = ques |
|
|
|
handleFillScore (ques) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (ques.questionType === 'fill_blank') { // 填空题 |
|
|
|
const opts = ques.questionAnswerVersionsList |
|
|
|
let { jsonText } = ques |
|
|
|
if (ques.questionType === 'fill_blank' && opts && opts.length) { |
|
|
|
if (jsonText) { |
|
|
|
// 填空题小空json |
|
|
|
jsonText = JSON.parse(jsonText) |
|
|
|
let { answerData } = opts[0] |
|
|
|
const scores = jsonText.scores.map(e => { |
|
|
|
if (answerData) { |
|
|
|
|
|
|
|
answerData = JSON.parse(answerData) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 正确答案 |
|
|
|
|
|
|
|
let { jsonText } = ques |
|
|
|
|
|
|
|
let scores |
|
|
|
|
|
|
|
if (jsonText) { |
|
|
|
|
|
|
|
jsonText = JSON.parse(jsonText) |
|
|
|
|
|
|
|
scores = jsonText.scores |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const fillScores = answerData.map((e, i) => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
val: e |
|
|
|
val: scores ? scores[i] : '' |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log("🚀 ~ getQuesStem ~ ques.scores:", scores) |
|
|
|
ques.fillScores = fillScores |
|
|
|
// this.$set(ques, 'fillScores', scores) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { } |
|
|
|
} catch (e) { } |
|
|
|
return stem |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 填空题分数输入回调 |
|
|
|
// 填空题分数输入回调 |
|
|
|
fillScoreChange (ques) { |
|
|
|
fillScoreChange (ques) { |
|
|
|
let total = 0 |
|
|
|
let total = 0 |
|
|
|
ques.scores.map(e => { |
|
|
|
ques.fillScores.map(e => { |
|
|
|
if (e.val && !isNaN(e.val)) total = Decimal(total).add(e.val).toNumber() |
|
|
|
if (e.val && !isNaN(e.val)) total = Decimal(total).add(e.val).toNumber() |
|
|
|
}) |
|
|
|
}) |
|
|
|
ques.score = total |
|
|
|
ques.score = total |
|
|
@ -707,18 +719,20 @@ export default { |
|
|
|
if (e.questionType !== 'fill_blank' && e.questionType !== 'essay') { |
|
|
|
if (e.questionType !== 'fill_blank' && e.questionType !== 'essay') { |
|
|
|
// 判断每个选项的内容是否相同 |
|
|
|
// 判断每个选项的内容是否相同 |
|
|
|
const opts = e.questionAnswerVersionsList |
|
|
|
const opts = e.questionAnswerVersionsList |
|
|
|
let diff = 0 |
|
|
|
if (opts) { |
|
|
|
for (const j in opts) { |
|
|
|
let diff = 0 |
|
|
|
// debugger |
|
|
|
for (const j in opts) { |
|
|
|
if (!n.questionAnswerVersionsList[j] || n.questionAnswerVersionsList[j].optionText !== opts[j].optionText) { |
|
|
|
// debugger |
|
|
|
diff = 1 |
|
|
|
if (!n.questionAnswerVersionsList || !n.questionAnswerVersionsList[j] || n.questionAnswerVersionsList[j].optionText !== opts[j].optionText) { |
|
|
|
break |
|
|
|
diff = 1 |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (e.questionType === n.questionType && e.stem === n.stem && !diff) { |
|
|
|
if (e.questionType === n.questionType && e.stem === n.stem && !diff) { |
|
|
|
e.repeat = true |
|
|
|
e.repeat = true |
|
|
|
n.repeat = true |
|
|
|
n.repeat = true |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 填空/问答:题干+题型一样即重复 |
|
|
|
// 填空/问答:题干+题型一样即重复 |
|
|
@ -741,7 +755,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
submit (status) { |
|
|
|
submit (status) { |
|
|
|
if (status) { |
|
|
|
if (!status) { |
|
|
|
// 草稿只需判断名字有没有填 |
|
|
|
// 草稿只需判断名字有没有填 |
|
|
|
if (!this.form.name) return Util.warningMsg('请输入试卷名称') |
|
|
|
if (!this.form.name) return Util.warningMsg('请输入试卷名称') |
|
|
|
this.validForm(status) |
|
|
|
this.validForm(status) |
|
|
@ -750,7 +764,7 @@ export default { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
if (form.name === '') return Util.warningMsg('请输入试卷名称') |
|
|
|
if (form.name === '') return Util.warningMsg('请输入试卷名称') |
|
|
|
if (!form.particularYear) return Util.warningMsg('请选择年份') |
|
|
|
if (!form.particularYear) return Util.warningMsg('请选择年份') |
|
|
|
if (!form.classificationId.length) return Util.warningMsg('请选择所属试卷分类') |
|
|
|
if (!form.classificationId) return Util.warningMsg('请选择所属试卷分类') |
|
|
|
if (form.paperType === '') return Util.warningMsg('请选择建议用途') |
|
|
|
if (form.paperType === '') return Util.warningMsg('请选择建议用途') |
|
|
|
if (form.suggestTime === '') return Util.warningMsg('请输入估计用时') |
|
|
|
if (form.suggestTime === '') return Util.warningMsg('请输入估计用时') |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
@ -778,7 +792,7 @@ export default { |
|
|
|
const allQues = [] |
|
|
|
const allQues = [] |
|
|
|
|
|
|
|
|
|
|
|
// 发布才需要校验 |
|
|
|
// 发布才需要校验 |
|
|
|
if (!status) { |
|
|
|
if (status) { |
|
|
|
if (isNaN(form.suggestTime) || form.suggestTime < 1 || form.suggestTime % 1) return Util.warningMsg('估计用时请输入正整数') |
|
|
|
if (isNaN(form.suggestTime) || form.suggestTime < 1 || form.suggestTime % 1) return Util.warningMsg('估计用时请输入正整数') |
|
|
|
let invalid = 0 |
|
|
|
let invalid = 0 |
|
|
|
for (const i in paper) { |
|
|
|
for (const i in paper) { |
|
|
@ -816,13 +830,10 @@ export default { |
|
|
|
if (e.questionType === 'fill_blank') { |
|
|
|
if (e.questionType === 'fill_blank') { |
|
|
|
let totalScore = 0 |
|
|
|
let totalScore = 0 |
|
|
|
e.examQuestions.map(n => { |
|
|
|
e.examQuestions.map(n => { |
|
|
|
const stem = document.querySelector(`#stem` + n.questionVersionId) |
|
|
|
const { fillScores } = n |
|
|
|
if (stem) { |
|
|
|
if (fillScores) { |
|
|
|
const inputs = stem.querySelectorAll('.fill-input') |
|
|
|
for (const e of fillScores) { |
|
|
|
if (inputs) { |
|
|
|
totalScore = Decimal(totalScore).add(e.val || 0).toNumber() |
|
|
|
for (const e of inputs) { |
|
|
|
|
|
|
|
totalScore = Decimal(totalScore).add(e.value || 0).toNumber() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
@ -876,21 +887,13 @@ export default { |
|
|
|
e.examQuestions = e.examQuestions.map((n, j) => { |
|
|
|
e.examQuestions = e.examQuestions.map((n, j) => { |
|
|
|
// 填空题的各个填空分数处理 |
|
|
|
// 填空题的各个填空分数处理 |
|
|
|
if (n.questionType === 'fill_blank') { |
|
|
|
if (n.questionType === 'fill_blank') { |
|
|
|
const stem = document.querySelector(`#stem` + n.questionVersionId) |
|
|
|
const { fillScores } = n |
|
|
|
const scores = [] |
|
|
|
|
|
|
|
if (stem) { |
|
|
|
|
|
|
|
const inputs = stem.querySelectorAll('.fill-input') |
|
|
|
|
|
|
|
if (inputs) { |
|
|
|
|
|
|
|
for (const e of inputs) { |
|
|
|
|
|
|
|
scores.push(e.value) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
n.jsonText = JSON.stringify({ |
|
|
|
n.jsonText = JSON.stringify({ |
|
|
|
questionVersionId: n.questionVersionId, |
|
|
|
questionVersionId: n.questionVersionId, |
|
|
|
scores |
|
|
|
scores: fillScores ? fillScores.map(m => m.val) : [] |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
questionVersionId: n.questionVersionId, |
|
|
|
questionVersionId: n.questionVersionId, |
|
|
|
serialNumber: n.serialNumber, |
|
|
|
serialNumber: n.serialNumber, |
|
|
@ -925,8 +928,19 @@ export default { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
|
|
|
|
.input-form.model { |
|
|
|
|
|
|
|
height: calc(100vh - 130px); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.tem-btn { |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
top: 0; |
|
|
|
|
|
|
|
right: 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.ques { |
|
|
|
.ques { |
|
|
|
li { |
|
|
|
li { |
|
|
|
|
|
|
|
padding-bottom: 10px; |
|
|
|
margin: 20px 0 10px; |
|
|
|
margin: 20px 0 10px; |
|
|
|
border: 1px solid #dbdbdb; |
|
|
|
border: 1px solid #dbdbdb; |
|
|
|
} |
|
|
|
} |
|
|
@ -980,6 +994,10 @@ export default { |
|
|
|
padding: 15px; |
|
|
|
padding: 15px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/deep/img { |
|
|
|
|
|
|
|
max-width: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.ques-info { |
|
|
|
.ques-info { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
width: calc(100% - 40px); |
|
|
|
width: calc(100% - 40px); |
|
|
@ -1070,26 +1088,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/.fill-input { |
|
|
|
|
|
|
|
width: 100px; |
|
|
|
|
|
|
|
height: 28px; |
|
|
|
|
|
|
|
padding: 0 15px; |
|
|
|
|
|
|
|
margin: 0 10px; |
|
|
|
|
|
|
|
font-size: 13px; |
|
|
|
|
|
|
|
line-height: 28px; |
|
|
|
|
|
|
|
color: #606266; |
|
|
|
|
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
|
|
|
|
border-radius: 2px; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&::placeholder { |
|
|
|
|
|
|
|
color: #cfd1db; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:focus { |
|
|
|
|
|
|
|
outline: none; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.opt { |
|
|
|
.opt { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
|
flex-wrap: wrap; |
|
|
@ -1117,8 +1115,10 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.actions { |
|
|
|
.actions { |
|
|
|
display: inline-flex; |
|
|
|
display: flex; |
|
|
|
|
|
|
|
justify-content: flex-end; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
margin-top: 10px; |
|
|
|
|
|
|
|
|
|
|
|
.el-button { |
|
|
|
.el-button { |
|
|
|
margin: 0 20px 0 0; |
|
|
|
margin: 0 20px 0 0; |
|
|
|