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