|
|
|
@ -122,10 +122,10 @@ |
|
|
|
|
<UeditorPlus v-if="ques.richTextStatus" :ref="'essayAnswer' + ques.id" v-model="ques.answer" |
|
|
|
|
@ready="editor => essayAnswerReady(editor, ques)" /> |
|
|
|
|
<div v-if="ques.allowAttachment" class="m-t-20"> |
|
|
|
|
<el-upload style="max-width: 700px;" accept=".csv,.xlsx,.xls,.docx,.doc,.pdf,.jpg,.png,.zip,.rar,.7z" |
|
|
|
|
:before-upload="beforeUpload" :on-remove="e => handleRemove(ques)" :on-error="uploadError" |
|
|
|
|
:before-remove="beforeRemove" :on-preview="handlePreview" :limit="1" action="#" |
|
|
|
|
:on-exceed="handleExceed" :file-list="ques.fileList" :http-request="e => handleRequest(e, ques)"> |
|
|
|
|
<el-upload style="max-width: 700px;" :before-upload="beforeUpload" |
|
|
|
|
:on-remove="e => handleRemove(ques)" :on-error="uploadError" :before-remove="beforeRemove" |
|
|
|
|
:on-preview="handlePreview" :limit="1" action="#" :on-exceed="handleExceed" |
|
|
|
|
:file-list="ques.fileList" :http-request="e => handleRequest(e, ques)"> |
|
|
|
|
<el-button type="primary" plain>上传文件</el-button> |
|
|
|
|
</el-upload> |
|
|
|
|
<div v-if="ques.uploadInstructions" class="flex m-t-10 fs-12"> |
|
|
|
@ -253,7 +253,7 @@ export default { |
|
|
|
|
this.initOss() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
per && sessionStorage.removeItem('theorySubmit') |
|
|
|
|
this.per && sessionStorage.removeItem('theorySubmit') |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取竞赛信息 |
|
|
|
@ -295,7 +295,7 @@ export default { |
|
|
|
|
paperId, |
|
|
|
|
stageId |
|
|
|
|
}) |
|
|
|
|
let cacheQues = [] |
|
|
|
|
let cacheQues |
|
|
|
|
if (cache) { |
|
|
|
|
this.entryTime = new Date(cache.startTime) |
|
|
|
|
this.timeSumVal = (now - new Date(cache.startTime)) / 1000 |
|
|
|
@ -347,6 +347,7 @@ export default { |
|
|
|
|
// 处理试卷数据 |
|
|
|
|
async handlePaper (r, cacheQues) { |
|
|
|
|
try { |
|
|
|
|
console.log("🚀 ~ handlePaper ~ this.form:", r, this.form) |
|
|
|
|
const paper = r.paperOutline |
|
|
|
|
const types = this.questionTypes |
|
|
|
|
paper.map(e => { |
|
|
|
@ -357,7 +358,7 @@ export default { |
|
|
|
|
Object.assign(n, n.question) |
|
|
|
|
const curQues = cacheQues ? cacheQues.find(m => m.outlineId === e.outlineId && m.questionVersionId === n.questionVersionId) : {} // 缓存里的试题 |
|
|
|
|
n.sign = curQues ? curQues.sign : 0 |
|
|
|
|
const opts = n.questionAnswerVersionsList |
|
|
|
|
const opts = n.questionAnswerVersionsList || [] |
|
|
|
|
if (type !== 'fill_blank' && type !== 'essay' && opts) { // 选择题 |
|
|
|
|
opts.map(m => { |
|
|
|
|
m.answer = curQues && curQues.answer && curQues.answer.length && curQues.answer.some(n => n == m.optionNumber) ? 1 : 0 |
|
|
|
@ -365,10 +366,12 @@ export default { |
|
|
|
|
if (opts.some(m => m.answer)) n.answered = 1 |
|
|
|
|
} else if (type === 'fill_blank') { // 填空题 |
|
|
|
|
n.fills = curQues && curQues.answer && curQues.answer.length && curQues.answer.some(m => m) ? curQues.answer : '' |
|
|
|
|
let { answerData } = opts[0] |
|
|
|
|
if (answerData) answerData = JSON.parse(answerData) |
|
|
|
|
n.answered = n.fills && answerData && answerData.length === n.fills.filter(m => m).length ? 1 : 0 |
|
|
|
|
n.partAnswer = n.fills && answerData && answerData.length !== n.fills.filter(m => m).length ? 1 : 0 |
|
|
|
|
if (opts.length) { |
|
|
|
|
let { answerData } = opts[0] |
|
|
|
|
if (answerData) answerData = JSON.parse(answerData) |
|
|
|
|
n.answered = n.fills && answerData && answerData.length === n.fills.filter(m => m).length ? 1 : 0 |
|
|
|
|
n.partAnswer = n.fills && answerData && answerData.length !== n.fills.filter(m => m).length ? 1 : 0 |
|
|
|
|
} |
|
|
|
|
n.stem = this.getQuesStem(n) |
|
|
|
|
} else if (type === 'essay') { // 简答题 |
|
|
|
|
n.answer = type === 'essay' && curQues ? curQues.answerContent : '' |
|
|
|
@ -394,7 +397,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.form = r |
|
|
|
|
console.log("🚀 ~ handlePaper ~ this.form:", this.form) |
|
|
|
|
console.log("🚀 ~ h222:", this.form) |
|
|
|
|
this.loading = false |
|
|
|
|
|
|
|
|
|
// 给填空题的每个空监听input事件,用以显示已作答状态 |
|
|
|
@ -619,8 +622,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 附件上传前 |
|
|
|
|
beforeUpload (file) { |
|
|
|
|
const oversize = file.size / 1024 / 1024 < 50 |
|
|
|
|
if (!oversize) Util.warningMsg('请上传小于50M的文件!') |
|
|
|
|
const oversize = file.size / 1024 / 1024 < 100 |
|
|
|
|
if (!oversize) Util.warningMsg('请上传小于100M的文件!') |
|
|
|
|
if (oversize) { |
|
|
|
|
return true |
|
|
|
|
} else { |
|
|
|
@ -717,6 +720,7 @@ export default { |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this.per) msg += `提交后将无法再次修改或重新提交,请确认信息无误后再进行操作。` |
|
|
|
|
try { |
|
|
|
|
await this.$confirm(msg, '提示', { |
|
|
|
|
// confirmButtonText: '确定', |
|
|
|
|