|
|
|
@ -4,8 +4,8 @@ |
|
|
|
|
<div class="testpaper" id="pdfDom"> |
|
|
|
|
<h1 class="title">{{paperName}}</h1> |
|
|
|
|
<ul class="types"> |
|
|
|
|
<li> |
|
|
|
|
<h6 class="type">一、单选题</h6> |
|
|
|
|
<li v-if="paperList.list1.length"> |
|
|
|
|
<h6 class="type">{{paperList.list1[0].serial}}、单选题</h6> |
|
|
|
|
<ul class="ques"> |
|
|
|
|
<li v-for="(item,index) in paperList.list1" :key="index"> |
|
|
|
|
<div class="stem"> |
|
|
|
@ -18,8 +18,8 @@ |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<h6 class="type">二、多选题</h6> |
|
|
|
|
<li v-if="paperList.list2.length"> |
|
|
|
|
<h6 class="type">{{paperList.list2[0].serial}}、多选题</h6> |
|
|
|
|
<ul class="ques"> |
|
|
|
|
<li v-for="(item,index) in paperList.list2" :key="index"> |
|
|
|
|
<div class="stem"> |
|
|
|
@ -32,8 +32,8 @@ |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<h6 class="type">三、填空题</h6> |
|
|
|
|
<li v-if="paperList.list3.length"> |
|
|
|
|
<h6 class="type">{{paperList.list3[0].serial}}、填空题</h6> |
|
|
|
|
<ul class="ques"> |
|
|
|
|
<li v-for="(item,index) in paperList.list3" :key="index"> |
|
|
|
|
<div class="stem"> |
|
|
|
@ -46,8 +46,8 @@ |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<h6 class="type">四、判断题</h6> |
|
|
|
|
<li v-if="paperList.list4.length"> |
|
|
|
|
<h6 class="type">{{paperList.list4[0].serial}}、判断题</h6> |
|
|
|
|
<ul class="ques"> |
|
|
|
|
<li v-for="(item,index) in paperList.list4" :key="index"> |
|
|
|
|
<div class="stem"> |
|
|
|
@ -60,8 +60,8 @@ |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<h6 class="type">五、简答题</h6> |
|
|
|
|
<li v-if="paperList.list5.length"> |
|
|
|
|
<h6 class="type">{{paperList.list5[0].serial}}、简答题</h6> |
|
|
|
|
<ul class="ques"> |
|
|
|
|
<li v-for="(item,index) in paperList.list5" :key="index"> |
|
|
|
|
<div class="stem"> |
|
|
|
@ -82,21 +82,21 @@ |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<label>所属课程:</label> |
|
|
|
|
<el-select v-model="cid" clearable placeholder="请选择所属课程" size="small" @change="getData"> |
|
|
|
|
<el-select v-model="cid" clearable placeholder="请选择所属课程" size="small" @change="initData"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-option v-for="(item,index) in courseList" :key="index" :label="item.courses" :value="item.courses"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>试卷状态:</label> |
|
|
|
|
<el-select v-model="state" clearable placeholder="请选择试卷状态" size="small" @change="getData"> |
|
|
|
|
<el-select v-model="state" clearable placeholder="请选择试卷状态" size="small" @change="initData"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>试卷用途:</label> |
|
|
|
|
<el-select v-model="effect" clearable placeholder="请选择试卷用途" size="small" @change="getData"> |
|
|
|
|
<el-select v-model="effect" clearable placeholder="请选择试卷用途" size="small" @change="initData"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-option v-for="(item,index) in effectList" :key="index" :label="item.label" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
@ -116,7 +116,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelecteChange"> |
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" @selection-change="handleSelecteChange"> |
|
|
|
|
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="试卷名称" align="center"></el-table-column> |
|
|
|
@ -233,7 +233,7 @@ export default { |
|
|
|
|
keyword: function(val) { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.getData() |
|
|
|
|
this.initData() |
|
|
|
|
},500) |
|
|
|
|
}, |
|
|
|
|
date: function(val){ |
|
|
|
@ -244,7 +244,7 @@ export default { |
|
|
|
|
this.startTime = '' |
|
|
|
|
this.endTime = '' |
|
|
|
|
} |
|
|
|
|
this.getData() |
|
|
|
|
this.initData() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
@ -265,12 +265,19 @@ export default { |
|
|
|
|
this.endTime && (data.endTime = this.endTime) |
|
|
|
|
this.state !== '' && (data.state = this.state) |
|
|
|
|
|
|
|
|
|
this.$post(this.api.pageBygetMeTestPaper,data) |
|
|
|
|
.then(res => { |
|
|
|
|
this.$post(this.api.pageBygetMeTestPaper,data).then(res => { |
|
|
|
|
this.listData = res.data.list.list |
|
|
|
|
this.total = res.data.list.totalCount |
|
|
|
|
if(!this.listData.length && this.total){ |
|
|
|
|
this.page-- |
|
|
|
|
this.getData() |
|
|
|
|
} |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
initData(){ |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
handleSelecteChange(val){ |
|
|
|
|
this.multipleSelection = val |
|
|
|
|
}, |
|
|
|
@ -283,6 +290,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
this.page = val |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
delData(row) { |
|
|
|
@ -323,10 +331,16 @@ export default { |
|
|
|
|
.then(res => { |
|
|
|
|
let list = res.data |
|
|
|
|
let reg = /<img src=".*?">/gi |
|
|
|
|
for(let i in list){ |
|
|
|
|
let index = 0 |
|
|
|
|
let serialList = ['一','二','三','四','五'] |
|
|
|
|
let listIndex = ['list1','list2','list3','list4','list5'] |
|
|
|
|
listIndex.map(i => { |
|
|
|
|
if(list[i].length){ |
|
|
|
|
list[i][0].serial = serialList[index] |
|
|
|
|
index++ |
|
|
|
|
} |
|
|
|
|
list[i].map(n => { |
|
|
|
|
let src = reg.exec(n.questionStem) |
|
|
|
|
// n.questionStem = n.questionStem.replace(/<img.*?(?:>|\/>)/gi,'') |
|
|
|
|
if(src){ |
|
|
|
|
src = src[0].replace('<img src="','').replace('">','') |
|
|
|
|
getUrlBase64(src, 'jpg', function (base64) { |
|
|
|
@ -334,7 +348,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.paperList = list |
|
|
|
|
this.handleOptions() |
|
|
|
|
var title = row.name |
|
|
|
@ -387,7 +401,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.$post(`${this.api.delByMyTestPaper}?ids=${delList.join()}`).then(res => { |
|
|
|
|
this.multipleSelection = [] |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
util.successMsg('删除成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
@ -397,8 +411,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
publish(row){ |
|
|
|
|
this.$post(`${this.api.detailtestPaper}?id=${row.id}`) |
|
|
|
|
.then(res => { |
|
|
|
|
this.$post(`${this.api.detailtestPaper}?id=${row.id}`).then(res => { |
|
|
|
|
let qid = res.data.list.qid |
|
|
|
|
if(qid){ |
|
|
|
|
let data = { |
|
|
|
@ -427,9 +440,9 @@ export default { |
|
|
|
|
data.briefAnswerNum = briefCount |
|
|
|
|
this.$post(this.api.modifyState,data).then(res => { |
|
|
|
|
if(row.effect){ |
|
|
|
|
util.successMsg(`练习“${row.name}”已成功发布,请于练习管理列表中查看`) |
|
|
|
|
util.successMsg(`“${row.name}”已发布,您可在“ 练习管理>创建练习” 菜单中用此练习卷创建新的练习`) |
|
|
|
|
}else{ |
|
|
|
|
util.successMsg(`考试“${row.name}”已成功发布,请于考试管理列表中查看`) |
|
|
|
|
util.successMsg(`“${row.name}”已发布,您可在 “考试管理>创建考试” 菜单中用此考试卷创建新的考试`) |
|
|
|
|
} |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
@ -440,16 +453,38 @@ export default { |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
preview(row){ |
|
|
|
|
let totalScore = 100 |
|
|
|
|
this.$post(`${this.api.detailtestPaper}?id=${row.id}`).then(res => { |
|
|
|
|
let qid = res.data.list.qid |
|
|
|
|
if(qid){ |
|
|
|
|
let data = { |
|
|
|
|
ids: qid.split(','), |
|
|
|
|
schoolId: this.clientId, |
|
|
|
|
userId: this.userId |
|
|
|
|
} |
|
|
|
|
this.$post(this.api.getModifyByList, data).then(res => { |
|
|
|
|
let selected = res.data.list |
|
|
|
|
let singleCount = selected.filter(n => n.name == '单项选择').length |
|
|
|
|
let multipleCount = selected.filter(n => n.name == '多项选择').length |
|
|
|
|
let fillBlankCount = selected.filter(n => n.name == '填空题').length |
|
|
|
|
let judgeCount = selected.filter(n => n.name == '判断题').length |
|
|
|
|
let briefCount = selected.filter(n => n.name == '简答题').length |
|
|
|
|
totalScore = singleCount * row.singleChoiceScore + multipleCount * row.multipleChoiceScore + fillBlankCount * row.fillBlanksScore + judgeCount * row.judgeScore + briefCount * row.briefAnswerScore |
|
|
|
|
|
|
|
|
|
this.setInfo({ |
|
|
|
|
id: row.id, |
|
|
|
|
paperName: row.name, |
|
|
|
|
totalDuration: row.duration |
|
|
|
|
totalDuration: row.duration, |
|
|
|
|
score: totalScore |
|
|
|
|
}) |
|
|
|
|
this.$router.push('show') |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
} |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
copy(row){ |
|
|
|
|
this.$post(`${this.api.copyPaper}?id=${row.id}`).then(res => { |
|
|
|
|
util.successMsg('复制成功'); |
|
|
|
|
util.successMsg('复制成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|