yujialong 1 month ago
parent 7ba56e280b
commit f59f1ee522
  1. 2
      src/pages/ques/detail/index.vue
  2. 3
      src/pages/ques/list/index.vue
  3. 20
      src/pages/testPaper/list/index.vue
  4. 34
      src/pages/testPaper/preview/index.vue

@ -102,7 +102,7 @@
<!-- 填空题特有 --> <!-- 填空题特有 -->
<template v-if="form.questionType === 'fill_blank'"> <template v-if="form.questionType === 'fill_blank'">
<el-form-item label="正确答案" required> <el-form-item label="正确答案" class="is-required">
<div class="opts fill-blanks"> <div class="opts fill-blanks">
<div v-for="(item, i) in fillBlanks" :key="i" class="opt j-between"> <div v-for="(item, i) in fillBlanks" :key="i" class="opt j-between">
<div class="fills"> <div class="fills">

@ -103,8 +103,7 @@
@selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="45" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="45" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="50" label="序号" align="center"></el-table-column> <el-table-column type="index" width="50" label="序号" align="center"></el-table-column>
<el-table-column prop="stem" label="题干" align="center" min-width="120" <el-table-column prop="stem" label="题干" align="center" min-width="220"></el-table-column>
show-overflow-tooltip></el-table-column>
<el-table-column prop="questionType" label="题型" align="center" width="70" sortable="custom"> <el-table-column prop="questionType" label="题型" align="center" width="70" sortable="custom">
<template slot-scope="scope">{{ questionTypes.find(e => e.id === scope.row.questionType) ? <template slot-scope="scope">{{ questionTypes.find(e => e.id === scope.row.questionType) ?
questionTypes.find(e => e.id === scope.row.questionType).name : '' }}</template> questionTypes.find(e => e.id === scope.row.questionType).name : '' }}</template>

@ -118,12 +118,10 @@
@selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<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>
<el-table-column prop="name" label="试卷名称" align="center" min-width="100" <el-table-column prop="name" label="试卷名称" align="center" min-width="200"></el-table-column>
show-overflow-tooltip></el-table-column>
<el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column> <el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column>
<el-table-column prop="score" label="总分" align="center" width="60"></el-table-column> <el-table-column prop="score" label="总分" align="center" width="60"></el-table-column>
<el-table-column prop="questionType" label="题型" align="center" min-width="90" <el-table-column prop="questionType" label="题型" align="center" min-width="160"></el-table-column>
show-overflow-tooltip></el-table-column>
<el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom"> <el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom">
<template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e => <template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e =>
e.id === scope.row.difficult).name : '' }}</template> e.id === scope.row.difficult).name : '' }}</template>
@ -277,13 +275,13 @@ export default {
mounted () { mounted () {
const { referrer1 } = this.$store.state.user const { referrer1 } = this.$store.state.user
this.crumbs = [ this.crumbs = [
{ {
name: this.name || '中台试卷库', name: this.name || '中台试卷库',
route: referrer1 || '/testPaperLibrary' route: referrer1 || '/testPaperLibrary'
}, },
{ {
name: '试卷管理' name: '试卷管理'
}, },
] ]

@ -63,7 +63,7 @@
<div class="stem-wrap"> <div class="stem-wrap">
<span class="label">{{ j + 1 }} / {{ item.questionNum }}</span> <span class="label">{{ j + 1 }} / {{ item.questionNum }}</span>
<span class="label">{{ item.questionTypeName }}</span> <span class="label">{{ item.questionTypeName }}</span>
<div class="stem html-parse" :id="'stem' + ques.id" v-html="getQuesStem(ques)"></div> <div class="stem html-parse" :id="'stem' + ques.id" v-html="ques.stem"></div>
<p v-if="item.questionType !== 'fill_blank'">{{ ques.score }}</p> <p v-if="item.questionType !== 'fill_blank'">{{ ques.score }}</p>
<img class="tag" :src="require('@/assets/images/' + (ques.sign ? 'tag-active' : 'tag') + '.svg')" alt="" <img class="tag" :src="require('@/assets/images/' + (ques.sign ? 'tag-active' : 'tag') + '.svg')" alt=""
@click="ques.sign = ques.sign ? 0 : 1"> @click="ques.sign = ques.sign ? 0 : 1">
@ -94,13 +94,13 @@
<UeditorPlus v-if="ques.richTextStatus" :ref="'essayAnswer' + ques.id" v-model="ques.answer" <UeditorPlus v-if="ques.richTextStatus" :ref="'essayAnswer' + ques.id" v-model="ques.answer"
@ready="editor => essayAnswerReady(editor, ques)" /> @ready="editor => essayAnswerReady(editor, ques)" />
<div v-if="ques.allowAttachment" class="m-t-20"> <div v-if="ques.allowAttachment" class="m-t-20">
<div v-if="ques.uploadInstructions" class="flex m-b-10 fs-12">
<span>上传要求说明</span>
<div class="html-parse" v-html="ques.uploadInstructions"></div>
</div>
<el-upload action="#"> <el-upload action="#">
<el-button size="small" type="primary">上传文件</el-button> <el-button size="small" type="primary">上传文件</el-button>
</el-upload> </el-upload>
<div v-if="ques.uploadInstructions" class="flex m-t-10 fs-12">
<span>上传要求说明</span>
<div class="html-parse" v-html="ques.uploadInstructions"></div>
</div>
</div> </div>
</template> </template>
</div> </div>
@ -194,6 +194,8 @@ export default {
opts.map(m => { opts.map(m => {
m.answer = 0 m.answer = 0
}) })
} else if (type === 'fill_blank') { //
n.stem = this.getQuesStem(n)
} else { // } else { //
n.answer = '' n.answer = ''
// //
@ -313,7 +315,7 @@ export default {
let result = stem let result = stem
while ((match = regex.exec(stem)) !== null) { while ((match = regex.exec(stem)) !== null) {
const newInput = `<input type="text" class="fill-input" value="${fills && fills.length ? fills[index] : ''}">` const newInput = `<span contenteditable placeholder="(${index + 1})" class="fill-input">${fills && fills.length ? fills[index] : ''}</span>`
result = result.replace(match[0], newInput) result = result.replace(match[0], newInput)
index++ index++
} }
@ -663,18 +665,22 @@ export default {
} }
.fill-input { .fill-input {
width: 100px; position: relative;
display: inline;
min-width: 50px;
height: 28px; height: 28px;
padding: 0 15px; padding: 3px;
margin: 0 10px; margin: 0 10px;
font-size: 13px; font-size: 14px;
line-height: 28px; line-height: 28px;
color: #606266; color: #333;
border: 1px solid #DCDEE0; border: 0;
border-radius: 2px; border-bottom: 1px solid #DCDEE0;
outline: none;
&:focus { &:empty {
outline: none; display: inline-block;
width: 3em;
} }
} }

Loading…
Cancel
Save