|
|
|
@ -27,10 +27,10 @@ |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
|
<template slot-scope="scope">{{scope.$index + (page - 1) * pageSize + 1}}</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" min-width="200" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" width="300" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="试题类型" width="100" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="typeName" label="所属题库" min-width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column> |
|
|
|
@ -39,7 +39,7 @@ |
|
|
|
|
{{scope.row.myShare ? '已共享' : '未共享'}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" width="230"> |
|
|
|
|
<el-table-column label="操作" width="230" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="show(scope.row)" v-auth="'/quesBank/list:我上传的题库:查看'">查看</el-button> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)" v-auth="'/quesBank/list:我上传的题库:修改'">修改</el-button> |
|
|
|
@ -78,6 +78,16 @@ |
|
|
|
|
<div v-html="topicForm.questionStem"></div> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
<li v-if="topicForm.typeId == 1 || topicForm.typeId == 2"> |
|
|
|
|
<span class="name">选项:</span> |
|
|
|
|
<div class="val"> |
|
|
|
|
<p class="m-b-5" v-for="(option,i) in topicForm.options" :key="i">{{i}}.{{topicForm.options[i]}}</p> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
<li v-if="topicForm.typeId != 4" :class="{'a-center': topicForm.typeId == 1 || topicForm.typeId == 2}"> |
|
|
|
|
<span class="name">正确答案:</span> |
|
|
|
|
<span class="val">{{topicForm.answer}}</span> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<span class="name">答案解析:</span> |
|
|
|
|
<span class="val">{{topicForm.answerAnalysis}}</span> |
|
|
|
@ -85,7 +95,7 @@ |
|
|
|
|
</ul> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" :close-on-click-modal="false"> |
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport" :close-on-click-modal="false"> |
|
|
|
|
<div class="upload-wrap" :class="{lg: uploadFaild}"> |
|
|
|
|
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button> |
|
|
|
|
<el-upload ref="upload" accept=".xls,.xlsx" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.impExcel" :file-list="uploadList" :data="{userId: this.userId,schoolId: this.clientId}" name="file" :auto-upload="false"> |
|
|
|
@ -212,6 +222,29 @@ export default { |
|
|
|
|
getDetail(id) { |
|
|
|
|
this.$post(`${this.api.findById}?id=${id}`).then(res => { |
|
|
|
|
let list = res.data.list |
|
|
|
|
let typeName = res.data.typeName |
|
|
|
|
let options = {} |
|
|
|
|
|
|
|
|
|
if(typeName == '填空题'){ |
|
|
|
|
let answer = [] |
|
|
|
|
for(let i in list){ |
|
|
|
|
if(i.includes('option') && list[i]) answer.push(list[i]) |
|
|
|
|
} |
|
|
|
|
list.answer = answer.join(',') |
|
|
|
|
list.questionStem = list.questionStem.replace(/\(\)\(\)\(\)/g,`______`) |
|
|
|
|
}else if(typeName == '判断题'){ |
|
|
|
|
if(list.answer == 'A'){ |
|
|
|
|
list.answer = '正确' |
|
|
|
|
}else{ |
|
|
|
|
list.answer = '错误' |
|
|
|
|
} |
|
|
|
|
}else if(typeName != '简答题'){ |
|
|
|
|
for(let i in list){ |
|
|
|
|
if(i.includes('option') && list[i]){ |
|
|
|
|
options[i.replace('option','')] = list[i] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.topicForm = { |
|
|
|
|
id: list.id, |
|
|
|
|
userId: list.userId, |
|
|
|
@ -221,7 +254,7 @@ export default { |
|
|
|
|
courses: list.courses, |
|
|
|
|
knowledgePoints: list.knowledgePoints, |
|
|
|
|
answer: list.answer, |
|
|
|
|
questionType: '', |
|
|
|
|
questionType: typeName, |
|
|
|
|
questionStem: list.questionStem, |
|
|
|
|
optionA: list.optionA, |
|
|
|
|
optionB: list.optionB, |
|
|
|
@ -229,6 +262,7 @@ export default { |
|
|
|
|
optionD: list.optionD, |
|
|
|
|
optionE: list.optionE, |
|
|
|
|
optionF: list.optionF, |
|
|
|
|
options, |
|
|
|
|
aisTrue: false, |
|
|
|
|
bisTrue: false, |
|
|
|
|
cisTrue: false, |
|
|
|
@ -240,7 +274,6 @@ export default { |
|
|
|
|
answerAnalysis: list.answerAnalysis, |
|
|
|
|
videoAudio: list.videoAudio |
|
|
|
|
} |
|
|
|
|
console.log(this.topicForm,this.quesBankList) |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
show(row) { |
|
|
|
@ -268,7 +301,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
share(row) { |
|
|
|
|
this.$confirm('该题将共享至公共题库,是否确认共享?', '提示', { |
|
|
|
|
type: 'info' |
|
|
|
|
type: 'info', |
|
|
|
|
customClass: 'normal' |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
let data = { |
|
|
|
@ -293,7 +327,6 @@ export default { |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}, |
|
|
|
|
disabledSelection(row,index){ |
|
|
|
|
let list = this.listData |
|
|
|
|
if(row.myShare) return false |
|
|
|
|
return true |
|
|
|
|
}, |
|
|
|
@ -308,16 +341,15 @@ export default { |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.$confirm(`是否确认共享${util.ellipsisStr(newArr[0].questionStem)}等${newArr.length}个选中的题目?`, '提示', { |
|
|
|
|
type: 'info' |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
type: 'info', |
|
|
|
|
customClass: 'normal' |
|
|
|
|
}).then(() => { |
|
|
|
|
let data = { |
|
|
|
|
userId: this.userId, |
|
|
|
|
ids: shareList, |
|
|
|
|
source: 2 |
|
|
|
|
} |
|
|
|
|
this.$post(this.api.batchSave,data).then(res => { |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
util.successMsg('此题已成功共享至校企公共题库') |
|
|
|
|
this.getData() |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
@ -325,7 +357,7 @@ export default { |
|
|
|
|
this.getData() |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
.catch(() => {}) |
|
|
|
|
}else{ |
|
|
|
|
util.errorMsg('请先选择数据') |
|
|
|
|
} |
|
|
|
@ -342,7 +374,6 @@ export default { |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.$post(`${this.api.deleteByMeSubject}?ids=${delList.join()}`).then(res => { |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
util.successMsg('删除成功'); |
|
|
|
|
this.getData() |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|