Commit 94f9df25 authored by 黄自鹏's avatar 黄自鹏

Merge branch 'master' of gitlab.gavelinfo.com:lisu/sgaqgl-vue

parents 53fd758e f831a779
......@@ -89,7 +89,7 @@ export function doInitXtms(query) {
})
}
/* 新查询细节 */
/* 新查询试卷子表试题 */
export function donDtlQuery(query) {
return request({
url: '/aqgl/pxgl/pxsj/query/detail',
......@@ -97,7 +97,7 @@ method: 'post',
data: query||{}
})
}
/* 新报存 */
/* 导入试卷试题 */
export function donDtlSave(query) {
return request({
url: '/aqgl/pxgl/pxsj/save',
......@@ -105,7 +105,7 @@ method: 'post',
data: query||{}
})
}
/* 发布试题 */
export function doBegin(query) {
return request({
url: 'aqgl/pxgl/pxsj/doBegin',
......@@ -129,5 +129,12 @@ method: 'post',
data: query||{}
})
}
/* 考试保存 */
export function commit(query) {
return request({
url: 'aqgl/pxgl/pxsj/commit',
method: 'post',
data: query||{}
})
}
......@@ -223,7 +223,8 @@
this.$refs.cycle.queryParams=JSON.parse(JSON.stringify(this.queryParams))
this.$refs.cycle.queryParams.grouptype='BZ'
/* 判断查询条件*/
this.$refs.cycle.queryParams.rwlx=='D'&&(this.$refs.cycle.queryParams.ksrq=this.$refs.cycle.queryParams.jsrq)
this.$refs.cycle.queryParams.rwlx=='D'&&(this.$refs.cycle.queryParams.ksrq=this.rowItem.tjrq)&&(this.$refs.cycle.queryParams.jsrq=this.rowItem.tjrq)
if(this.$refs.cycle.queryParams.rwlx=='W'){
// KSRQ
this.$refs.cycle.queryParams.ksrq=(this.singleItem.weekBegin>this.queryParams.ksrq)?(this.singleItem.weekBegin):(this.queryParams.ksrq);
......
......@@ -59,13 +59,14 @@
doUpdate,
doDelete,
pxxmQuery,
excelimport
excelimport,
} from '@/api/train/questionManage';
import {
/* 测试*/
donDtlQuery,
queryKsnr
queryKsnr,
commit
} from '@/api/train/examination';
import Subject from './subject'
export default {
......@@ -104,6 +105,26 @@
Subject
},
methods: {
commitAll(){
let datas=this.subjectList.map((item=>{
item.userAns=item.value||''
return item
}))
let params={
id:this.singleItem.id,
datas:datas
}
commit(params).then(res=>{
if(res.success){
this.$success('提交成功,您可以在考试记录中查看分数')
this.gobac()
this.exitFullscreen()
}else{
this.gobac()
this.exitFullscreen()
}
})
},
apiTranswf() {
/* 构建试卷*/
let type = {
......@@ -187,13 +208,20 @@
},
getRemain() {
let setNum = setTimeout(() => {
if(!this.kssc){
this.$warning('考试异常退出,请重新考试!')
clearTimeout(setNum)
/* */
this.gobac()
return
}
this.kssc = this.kssc - 1000
if (this.kssc > 0) {
this.getRemain()
} else {
this.$warning('本场考试结束,试题已自动提交!')
this.gobac()
this.exitFullscreen()
/* */
this.commitAll()
}
}, 1000)
},
......@@ -248,13 +276,11 @@
type: 'warning'
}).then(() => {
/* 练习时*/
console.log(this.subjectList)
if (this.paperType == 'T' && this.paperState == 'B') {
this.paperState = 'E'
} else {
this.$success('提交成功,您可以在考试记录中查看分数')
this.gobac()
this.exitFullscreen()
this.commitAll()
}
}).catch(() => {
......@@ -266,7 +292,7 @@
return {
username:'',
userid:'',
kssc: 100,
kssc: 1000*60*60,
singleItem: '',
loading: false,
/* 考试or测试*/
......
......@@ -31,7 +31,7 @@
<!-- 判断题 -->
<div v-if="type=='PDT'" class="options">
<div class="item" :key="index" v-for="(item,index) in pDoptions">
<el-radio :disabled='allItem.result' v-model="value" :label="index"> {{`${index}`}}</el-radio>
<el-radio :disabled='allItem.result' v-model="value" :label="index"> {{`${item}`}}</el-radio>
</div>
</div>
<!-- 答案显示-->
......@@ -123,8 +123,8 @@
data() {
return {
pDoptions:{
'正确':'Y',
'错误':'N'
'A':'正确',
'B':'错误'
},
value: '',
valueList: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment