Commit eb880199 authored by 李苏's avatar 李苏 💬

考试

parent 82d4af61
......@@ -106,10 +106,28 @@ data: query||{}
})
}
export function doBegin(query) {
return request({
url: 'aqgl/pxgl/pxsj/doBegin',
method: 'post',
data: query||{}
})
}
/* 考试查询 */
export function queryKssj(query) {
return request({
url: 'aqgl/pxgl/pxsj/queryKssj',
method: 'post',
data: query||{}
})
}
/* 考试内容 */
export function queryKsnr(query) {
return request({
url: 'aqgl/pxgl/pxsj/queryKsnr',
method: 'post',
data: query||{}
})
}
......@@ -860,44 +860,57 @@ export const powerRoutes=[
name:'questionManage',
path:"questionManage"
},
// {
// component:'train/testPaper/index',
// hidden:false,
// meta:{
// "title": "考试试卷",
// "icon": "",
// "noCache": false,
// "link": null,
// "mkid":'test',
// },
// name:'testPaper',
// path:"testPaper"
// },
// {
// component:'train/onlinExamination/index',
// hidden:false,
// meta:{
// "title": "在线考试管理",
// "icon": "",
// "noCache": false,
// "link": null,
// "mkid":'test',
// },
// name:'onlinExamination',
// path:"onlinExamination"
// },
{
component:'train/testPaper/index',
component:'train/paperManagement/index',
hidden:false,
meta:{
"title": "考试试卷",
"title": "试卷管理",
"icon": "",
"noCache": false,
"link": null,
"mkid":'test',
"mkid":906001000,
},
name:'testPaper',
path:"testPaper"
name:'paperManagement',
path:"paperManagement"
},
{
component:'train/onlinExamination/index',
component:'train/ks/index',
hidden:false,
meta:{
"title": "在线考试管理",
"title": "考试管理",
"icon": "",
"noCache": false,
"link": null,
"mkid":'test',
},
name:'onlinExamination',
path:"onlinExamination"
},
{
component:'train/paperManagement/index',
hidden:false,
meta:{
"title": "试卷管理",
"icon": "",
"noCache": false,
"link": null,
"mkid":906001000,
},
name:'paperManagement',
path:"paperManagement"
name:'ks',
path:"ks"
},
/*,
......
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="考试主题" ref="name" prop="name">
<el-input :readonly="readonly" v-model="form.name" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="培训ID" ref="pxid" prop="pxid">
<el-input :readonly="readonly" v-model="form.pxid" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="题库ID" ref="xmid" prop="xmid">
<el-input :readonly="readonly" v-model="form.xmid" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="总分" ref="score" prop="score">
<el-input :readonly="readonly" v-model="form.score" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="单选题量" ref="scount" prop="scount">
<el-input :readonly="readonly" v-model="form.scount" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单选题分值" ref="sscore" prop="sscore">
<el-input :readonly="readonly" v-model="form.sscore" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="多选题量" ref="mcount" prop="mcount">
<el-input :readonly="readonly" v-model="form.mcount" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="多选题分值" ref="mscore" prop="mscore">
<el-input :readonly="readonly" v-model="form.mscore" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="判断题量" ref="jcount" prop="jcount">
<el-input :readonly="readonly" v-model="form.jcount" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="判断题分值" ref="jscore" prop="jscore">
<el-input :readonly="readonly" v-model="form.jscore" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="填空题量" ref="fcount" prop="fcount">
<el-input :readonly="readonly" v-model="form.fcount" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="填空题分值" ref="fscore" prop="fscore">
<el-input :readonly="readonly" v-model="form.fscore" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="考试时长" ref="kssc" prop="kssc">
<el-input :readonly="readonly" v-model="form.kssc" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="选题模式" ref="xtms" prop="xtms">
<el-input :readonly="readonly" v-model="form.xtms" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="备注" ref="bz" prop="bz">
<el-input :readonly="readonly" v-model="form.bz" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="系统版本" ref="sysversion" prop="sysversion">
<el-input :readonly="readonly" v-model="form.sysversion" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="开始时间" ref="kssj" prop="kssj">
<el-date-picker style="width: 100%;" :readonly="readonly" type="date"
v-model="form.kssj" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结束时间" ref="jssj" prop="jssj">
<el-date-picker style="width: 100%;" :readonly="readonly" type="date"
v-model="form.jssj" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
</RelDialog>
</template>
<script>
import {editMixin} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
},
/* 组件名称*/
name: "aqgl.pxglPxsjEdit",
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 额外初始化,根据需求*/
systemType: [],
bmList: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
//ID
id:'',
//考试主题
name:'',
//培训ID
pxid:'',
//题库ID
xmid:'',
//总分
score:'',
//单选题量
scount:'',
//单选题分值
sscore:'',
//多选题量
mcount:'',
//多选题分值
mscore:'',
//判断题量
jcount:'',
//判断题分值
jscore:'',
//填空题量
fcount:'',
//填空题分值
fscore:'',
//考试时长
kssc:'',
//选题模式
xtms:'',
//备注
bz:'',
//维护人编码
whrid:'',
//维护人
whr:'',
//维护时间
whsj:new Date().getTime(),
//创建人编码
cjrid:'',
//创建人
cjr:'',
//创建时间
cjsj:new Date().getTime(),
//系统版本
sysversion:'',
//状态
zt:'',
//开始时间
kssj:new Date().getTime(),
//结束时间
jssj:new Date().getTime(),
},
/* form提交时的规则,具体规则参考官网*/
rules: {
}
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div class="min_full">
<!-- 查询条件-->
<!-- <div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="12" class="search-col">
<div class="search-item">
<span class="search-span">试卷状态:</span>
<RelSelect style="width: 100%;" src='aqgl/pxgl/pxsj/init/zt' filterable clearable :match="{value:'id',label:'name'}" v-model='queryParams.zt' ></RelSelect>
</div>
</el-col>
</el-row>
</div> -->
<div class="tablePagers">
<TablePager :delButton='false' @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
<!-- 插槽 -->
<template slot="tabCustom">
<el-table-column style="border-right: 0px;" fixed="right" label="操作" header-align="center">
<template slot-scope="scope">
<el-button v-if="true" style="text-align: center;color: #1A94E6;width: 100%;"
@click.native.prevent="ksks(scope.row)" type="text" size="small">
<i class="el-icon-edit"></i>开始考试
</el-button>
<el-button v-if="false" style="text-align: center;color: #E6BD1A;width: 100%;"
@click.native.prevent="apiDel(scope.row)" type="text" size="small">
<i class="el-icon-warning-outline"></i>已过期
</el-button>
<el-button v-if="false" style="text-align: center;color: #11EE96;width: 100%;"
@click.native.prevent="apiDel(scope.row)" type="text" size="small">
<i class="el-icon-circle-check"></i>考试结束
</el-button>
</template>
</el-table-column>
</template>>
</TablePager>
</div>
</div>
</template>
<script>
/* 引入需要的接口*/
import {
queryKssj,
// doAdd,
// doUpdate,
// doDelete
} from '@/api/train/examination.js';
/* edit页面*/
import Edit from './edit'
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'aqgl.pxglPxsj',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: '/aqgl/pxgl/pxsj/queryKssj',
/* 查询参数*/
queryParams: {
zt: 'F'
},
/* 表格标题对应参数*/
tableTitle: [
{label: "考试主题", prop: "name", fieldType: "ftString",width:300},
// {label: "培训ID", prop: "pxid", fieldType: "ftString",width:192},
// {label: "题库ID", prop: "xmid", fieldType: "ftString",width:192},
{label: "总分", prop: "score", fieldType: "float"},
{label: "单选题量", prop: "scount", fieldType: "int"},
{label: "单选题分值", prop: "sscore", fieldType: "float"},
{label: "多选题量", prop: "mcount", fieldType: "int"},
{label: "多选题分值", prop: "mscore", fieldType: "float"},
{label: "判断题量", prop: "jcount", fieldType: "int"},
{label: "判断题分值", prop: "jscore", fieldType: "float"},
{label: "填空题量", prop: "fcount", fieldType: "int"},
{label: "填空题分值", prop: "fscore", fieldType: "float"},
{label: "考试时长", prop: "kssc", fieldType: "float"},
// {label: "选题模式", prop: "xtms", fieldType: "ftString",width:60},
{label: "备注", prop: "bz", fieldType: "ftString",width:300},
{label: "维护人", prop: "whr", fieldType: "ftString"},
{label: "维护时间", prop: "whsj", fieldType: "ftDateTime"},
{label: "创建人", prop: "cjr", fieldType: "ftString"},
{label: "创建时间", prop: "cjsj", fieldType: "ftDateTime"},
{label: "状态", prop: "zt", fieldType: "ftString",width:60,transform:{
url:'/aqgl/pxgl/pxsj/init/zt',label:'name',value:'id'
}},
{label: "开始时间", prop: "kssj", fieldType: "ftDateTime"},
{label: "结束时间", prop: "jssj", fieldType: "ftDateTime"},
]
}
},
activated(){
this.$refs.TablePager.pageQuery()
},
deactivated(){
console.log('deactivated')
},
methods: {
/* 考试按钮*/
ksks(row){
this.$confirm('确定进行考试吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let id=row.id
this.$router.push({path: '/paper/'+id,query: { singleItem: row}})
})
},
/* 基础查询*/
query: queryKssj,
/* 基础增*/
// apiAdd: doAdd,
// /* 基础更新*/
// apiUpdate: doUpdate,
// /* 删除操作*/
// apiDelete: doDelete,
/* 初始化赋值操作*/
init() {
}
},
components: {
Edit,
}
}
</script>
<style scoped>
</style>
......@@ -81,7 +81,7 @@
/* 表格标题对应参数*/
tableTitle: [
// {label: "试卷ID", prop: "mid", fieldType: "ftString",width:192},
{label: "序号", prop: "xh", fieldType: "int",width:60},
// {label: "序号", prop: "xh", fieldType: "int",width:60},
{label: "试题", prop: "cont", fieldType: "ftString",width:850},
{label: "类型", prop: "type", formatter:(a,b,c)=>{
let val=this.typeObj[c]
......
......@@ -44,7 +44,7 @@
@current-change="currentPageChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30]"
layout="total, sizes, prev, pager, next, jumper"
layout="total, sizes, prev, pager, next"
>
</el-pagination>
</el-row>
......
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-form slot="form" ref="form" :model="form" label-width="120px" :rules="rules" style="padding-right: 50px;">
<el-row :gutter="40">
<el-col :span="24">
<el-form-item label="考试主题" ref="name" prop="name">
......@@ -23,44 +23,44 @@
</el-row>
<el-row :gutter="40">
<el-col :span="12">
<el-form-item :rules="[{pattern: /^[0-9]\d*$/,message: '请输入整数!'}]" label="单选题量" ref="scount" prop="scount">
<el-form-item :rules="[{ required: true,pattern: /^[0-9]\d*$/,message: '请输入整数!'}]" label="单选题量" ref="scount" prop="scount">
<el-input type="number" :readonly="readonly" v-model="form.scount" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :rules="[{pattern: /^[1-9]\d*$/,message: '请输入大于0的整数!'}]" label="单选题分值" ref="sscore" prop="sscore">
<el-form-item :rules="[{ required: true,pattern: /^[1-9]\d*$/,message: '请输入大于0的整数!'}]" label="单选题分值" ref="sscore" prop="sscore">
<el-input type="number" :readonly="readonly" v-model="form.sscore" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :rules="[{pattern: /^[0-9]\d*$/,message: '请输入整数!'}]" label="多选题量" ref="mcount" prop="mcount">
<el-form-item :rules="[{ required: true,pattern: /^[0-9]\d*$/,message: '请输入整数!'}]" label="多选题量" ref="mcount" prop="mcount">
<el-input type="number" :readonly="readonly" v-model="form.mcount" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :rules="[{pattern: /^[1-9]\d*$/,message: '请输入大于0的整数!'}]" label="多选题分值" ref="mscore" prop="mscore">
<el-form-item :rules="[{ required: true,pattern: /^[1-9]\d*$/,message: '请输入大于0的整数!'}]" label="多选题分值" ref="mscore" prop="mscore">
<el-input type="number" :readonly="readonly" v-model="form.mscore" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="40">
<el-col :span="12">
<el-form-item :rules="[{pattern: /^[0-9]\d*$/,message: '请输入整数!'}]" label="判断题量" ref="jcount" prop="jcount">
<el-form-item :rules="[{ required: true,pattern: /^[0-9]\d*$/,message: '请输入整数!'}]" label="判断题量" ref="jcount" prop="jcount">
<el-input type="number" :readonly="readonly" v-model="form.jcount" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="判断题分值" ref="jscore" prop="jscore">
<el-form-item :rules="[{ required: true,pattern: /^[1-9]\d*$/,message: '请输入大于0的整数!'}]" label="判断题分值" ref="jscore" prop="jscore">
<el-input type="number" :readonly="readonly" v-model="form.jscore" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :rules="[{pattern: /^[0-9]\d*$/,message: '请输入整数!'}]" label="填空题量" ref="fcount" prop="fcount">
<el-form-item :rules="[{ required: true,pattern: /^[0-9]\d*$/,message: '请输入整数!'}]" label="填空题量" ref="fcount" prop="fcount">
<el-input type="number" :readonly="readonly" v-model="form.fcount" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :rules="[{pattern: /^[1-9]\d*$/,message: '请输入大于0的整数!'}]" label="填空题分值" ref="fscore" prop="fscore">
<el-form-item :rules="[{ required: true,pattern: /^[1-9]\d*$/,message: '请输入大于0的整数!'}]" label="填空题分值" ref="fscore" prop="fscore">
<el-input type="number" :readonly="readonly" v-model="form.fscore" ></el-input>
</el-form-item>
</el-col>
......@@ -91,7 +91,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="40">
<!-- <el-row :gutter="40">
<el-col :span="12">
<el-form-item label="开始时间" ref="kssj" prop="kssj">
<el-date-picker value-format="timestamp" style="width: 100%;" :readonly="readonly" type="date"
......@@ -106,7 +106,7 @@
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
</el-form>
</RelDialog>
</template>
......@@ -250,7 +250,7 @@
},
/* form提交时的规则,具体规则参考官网*/
rules: {
xtms:[
{
required: true,
......@@ -265,16 +265,16 @@
required: true,
trigger: 'blur'
}, ],
jssj: [{
required: true,
trigger: 'blur'
}, ],
kssc:[
{
required: true,
trigger: 'blur'
}
],
// jssj: [{
// required: true,
// trigger: 'blur'
// }, ],
// kssc:[
// {
// required: true,
// trigger: 'blur'
// }
// ],
}
}
},
......
......@@ -22,7 +22,9 @@
<EditButton ref="edit" :app='app'></EditButton>
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<el-button @click="zdst" size='mini' style="margin-left: 0px;" type="primary">指定试题</el-button>
<el-button @click="zdst" size='mini' type="primary">指定试题</el-button>
<!-- <el-button @click="mnks" size='mini' type="primary">模拟考试</el-button> -->
<el-button @click="fbsj" size='mini' type="primary">发布试卷</el-button>
<!-- 额外按钮-->
<!-- 表头设置 -->
......@@ -45,7 +47,8 @@
doQuery,
doAdd,
doUpdate,
doDelete
doDelete,
doBegin
} from '@/api/train/examination.js';
/* edit页面*/
import Edit from './edit'
......@@ -104,8 +107,8 @@
url:'/aqgl/pxgl/pxsj/init/zt',label:'name',value:'id'
}},
{label: "开始时间", prop: "kssj", fieldType: "ftDateTime"},
{label: "结束时间", prop: "jssj", fieldType: "ftDateTime"},
// {label: "开始时间", prop: "kssj", fieldType: "ftDateTime"},
// {label: "结束时间", prop: "jssj", fieldType: "ftDateTime"},
]
}
},
......@@ -115,13 +118,52 @@
if(this.singleItem.xtms=='F'){
this.DialogTitle=this.singleItem.name
this.showDialog=true
}else{
this.$warning('只能选择固定卷进行修改');
}
} else {
this.$warning('请选中一行操作');
}
},
fbsj(){
if (this.app.selectOne || this.app.clickOne) {
this.$confirm('确定发布该试卷吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
doBegin({id:this.singleItem.id}).then(res=>{
if(res.success){
this.$success('该试卷发布成功!')
this.$refs.TablePager.pageQuery()
}
})
// let id=this.singleItem.id
// this.$router.push({path: '/paper/'+id,query: { singleItem: this.singleItem}})
})
} else {
this.$warning('请选中一行操作');
}
},
mnks(){
if (this.app.selectOne || this.app.clickOne) {
this.$confirm('确定进行考试吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let id=this.singleItem.id
this.$router.push({path: '/paper/'+id,query: { singleItem: this.singleItem}})
})
} else {
this.$warning('请选中一行操作');
}
},
/* 基础查询*/
query: doQuery,
......
<template>
<div class="testpaper">
<div class="testpaper" v-loading="loading" element-loading-text="正则加载试卷请稍等!" element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)">
<!-- 批阅水印 -->
<div class="readover" v-if='paperType!="T"&&paperState=="E"' >
<div class="readover" v-if='paperType!="T"&&paperState=="E"'>
<div class="yyj">
已阅卷
</div>
......@@ -9,7 +10,7 @@
100分
</div>
</div>
<div class="readover" style="color:red;" v-if='paperType=="T"&&paperState=="E"' >
<div class="readover" style="color:red;" v-if='paperType=="T"&&paperState=="E"'>
<div class="yyj">
训练题测试
</div>
......@@ -17,29 +18,34 @@
训练结果:{{rightNum}}/{{subjectList.length}}
</div>
</div>
<div ref="title" class="title">{{title+id}}
<span v-if='paperState=="B"&&paperType!="T"' style="position: absolute;right: 36px;;font-size: 13px;font-weight: 300;">{{`剩余时间:${parseInt(remaining/(60*1000))}分钟${parseInt((remaining%(60*1000))/1000)}秒`}}</span>
<div ref="title" class="title">{{title}}
<span v-if='paperState=="B"&&paperType!="T"'
style="position: absolute;right: 36px;;font-size: 13px;font-weight: 300;">{{`剩余时间:${parseInt(kssc/(60*1000))}分钟${parseInt((kssc%(60*1000))/1000)}秒`}}</span>
</div>
<div class="info">
<div class="infoItem">
<span>姓名:{{'周楠楠'}}</span>
<span>姓名:{{username}}</span>
</div>
<div class="infoItem">
<span>证件号:{{'221718301528'}}</span>
<span>编码:{{userid}}</span>
</div>
<div class="infoItem">
<span>开始时间:{{$moment(startTime).format('YYYY-MM-DD HH:mm:ss ') }}</span>
<!-- <div class="infoItem">
<span>开始时间:{{$moment(startTime).format('YYYY-MM-DD') }}</span>
</div>
<div class="infoItem">
<span>结束时间:{{$moment(endTime).format('YYYY-MM-DD HH:mm:ss ') }}</span>
</div>
<span>结束时间:{{$moment(endTime).format('YYYY-MM-DD') }}</span>
</div> -->
</div>
<Subject :app='that' v-for='(item,index) in subjectList' :allItem='item' :key="index" :index='index+1' :subject='item.subject' :score='item.score' :type='item.type' :options='item.options' ></Subject>
<Subject :app='that' v-for='(item,index) in subjectList' :allItem='item' :key="index" :index='index+1'
:subject='item.subject' :score='item.score' :type='item.type' :options='item.options'></Subject>
<div style="height: 200px;padding-top: 120px;">
<el-button v-if="paperState=='B'" @click="submit" size="mini" type="primary" style="float: right;width: 100px;">提交</el-button>
<el-button v-if="paperState=='B'" @click="submit" size="mini" type="primary" style="float: right;width: 100px;">提交
</el-button>
<!-- 练习模式按钮-->
<el-button v-if="paperType=='T'&&paperState=='E'" @click="contlx" size="mini" type="primary" style="float: right;width: 100px;margin-left: 60px;">继续练习</el-button>
<el-button v-if="paperType=='T'&&paperState=='E'" @click="gobac" size="mini" type="primary" style="float: right;width: 100px;">返回</el-button>
<el-button v-if="paperType=='T'&&paperState=='E'" @click="contlx" size="mini" type="primary"
style="float: right;width: 100px;margin-left: 60px;">继续练习</el-button>
<el-button v-if="paperType=='T'&&paperState=='E'" @click="gobac" size="mini" type="primary"
style="float: right;width: 100px;">返回</el-button>
</div>
......@@ -48,162 +54,240 @@
<script>
import {
/* 测试*/
doQuery,
doAdd,
doUpdate,
doDelete,
doQuery,
doAdd,
doUpdate,
doDelete,
pxxmQuery,
excelimport
} from '@/api/train/questionManage';
import Subject from './subject'
export default{
created(){
this.id=this.$route.params.id
this.apiTranswf()
} from '@/api/train/questionManage';
import {
/* 测试*/
donDtlQuery,
queryKsnr
} from '@/api/train/examination';
import Subject from './subject'
export default {
created() {
/* 获取本场考试参数*/
this.id = this.$route.params.id
this.singleItem = this.$route.query.singleItem
/* */
if (!this.id || !this.singleItem) {
this.$error('参数加载失败,请重新选择试卷')
this.gobac()
return
}
/* 显示考试人员信息*/
const {username,userid} = JSON.parse(sessionStorage.getItem('allUserInfo'))
this.username=username
this.userid=userid
/* 配置考试时间*/
this.title = this.singleItem.name || '未知试卷'
this.startTime = this.singleItem.kssj
this.endTime = this.singleItem.jssj
this.kssc = this.singleItem.kssc * 60 * 1000
/* 配置考试类型*/
this.paperType = 'K'
this.paperState = 'B'
/* 获取试题*/
this.fullScreen()
this.apiTranswf()
},
mounted() {
this.getRemain()
/* 获取*/
},
components:{
components: {
Subject
},
methods:{
apiTranswf(){
let type={
'S':'DXT',
'F':'TKT',
'J':'PDT',
'M':'DXTS'
methods: {
apiTranswf() {
/* 构建试卷*/
let type = {
'S': 'DXT',
'F': 'TKT',
'J': 'PDT',
'M': 'DXTS'
}
doQuery().then(res=>{
this.subjectList=[]
let oList=res.data.records||[]
/* 构建subjectList*/
queryKsnr({
mid: this.singleItem.id
}).then(res => {
if(res.success){
this.subjectList = []
let oList = res.data.records || []
/* 构建subjectList*/
console.log(this.singleItem,'singleItem')
this.subjectList = oList.map(item => {
let newobj = Object.create({})
newobj.desc = item.desc || '该题没有答案解析!'
newobj.id = item.id
newobj.ans = item.ans
// newobj.score = item.score || 2
item.type=='S'&&(newobj.score =this.singleItem.sscore )
item.type=='M'&&(newobj.score =this.singleItem.mscore )
item.type=='J'&&(newobj.score =this.singleItem.jscore )
item.type=='F'&&(newobj.score =this.singleItem.fscore )
newobj.type = type[item.type]
newobj.subject = item.cont || '未设置问题'
newobj.options = Object.create({})
item['opta'] && (newobj.options.A = item.opta)
item['optb'] && (newobj.options.B = item.optb)
item['optc'] && (newobj.options.C = item.optc)
item['optd'] && (newobj.options.D = item.optd)
item['opte'] && (newobj.options.E = item.opte)
item['optf'] && (newobj.options.F = item.optf)
return newobj
})
this.subjectList=oList.map(item=>{
let newobj=Object.create({})
newobj.desc=item.desc||'该题没有答案解析!'
newobj.id=item.id
newobj.ans=item.ans
newobj.score=item.score||2
newobj.type=type[item.type]
newobj.subject=item.cont||'未设置问题'
newobj.options=Object.create({})
item['opta']&&(newobj.options.A=item.opta)
item['optb']&&(newobj.options.B=item.optb)
item['optc']&&(newobj.options.C=item.optc)
item['optd']&&(newobj.options.D=item.optd)
item['opte']&&(newobj.options.E=item.opte)
item['optf']&&(newobj.options.F=item.optf)
return newobj
})
}else{
this.gobac()
}
})
},
contlx(){
fullScreen(element) {
const elem = element || document.documentElement;
if (elem.webkitRequestFullScreen) {
elem.webkitRequestFullScreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.requestFullScreen) {
elem.requestFullscreen();
} else if (elem.msExitFullscreen) {
elem.msExitFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (typeof window.ActiveXObject !== "undefined") { //for Internet Explorer
var wscript = new ActiveXObject("WScript.Shell");
if (wscript !== null) {
wscript.SendKeys("{F11}");
}
}
},
exitFullscreen() {
var de = document;
if (de.exitFullscreen) {
de.exitFullscreen();
} else if (de.mozCancelFullScreen) {
de.mozCancelFullScreen();
} else if (de.webkitCancelFullScreen) {
de.webkitCancelFullScreen();
}
},
contlx() {
/* 当前为练习状态*/
/* 当前为开始状态*/
this.paperType='T'
this.paperState='B'
this.paperType = 'T'
this.paperState = 'B'
this.apiTranswf()
},
getRemain(){
let setNum=setTimeout(()=>{
let time=new Date().getTime()
let remindTime=this.endTime-time
this.remaining=remindTime
if(this.remaining>0){
getRemain() {
let setNum = setTimeout(() => {
this.kssc = this.kssc - 1000
if (this.kssc > 0) {
this.getRemain()
} else {
this.$warning('本场考试结束,试题已自动提交!')
this.gobac()
this.exitFullscreen()
}
},1000)
}, 1000)
},
gobac(){
this.$router.replace({path:'/train/onlinExamination'})
gobac() {
this.$router.replace({
path: '/train/ks'
})
},
submit(){
/* 前端判断是否填写*/
this.subjectList.forEach((item,index)=>{
if(item.value&&item.value.length>0){
submit() {
/* 前端判断是否填写*/
this.subjectList.forEach((item, index) => {
if (item.value && item.value.length > 0) {
}else{
this.$warning(`第${index+1}题未作答`)
throw new Error(`第${index+1}题未作答`)
}
})
/* 前端判断答案对错*/
console.log( this.subjectList)
this.rightNum=0
this.subjectList.forEach((item,index)=>{
} else {
this.$warning(`第${index+1}题未作答`)
throw new Error(`第${index+1}题未作答`)
}
})
/* 前端判断答案对错*/
console.log(this.subjectList)
this.rightNum = 0
this.subjectList.forEach((item, index) => {
/* 其他*/
if(item.type!='TKT'){
if(item.ans==item.value){
item.result='right'
item.resultName='正确'
this.rightNum++
}else{
item.result='error'
item.resultName='错误'
}
}else{
let nans=item.ans.replace(/\s*/g,"")
let nvalue=item.value.replace(/\s*/g,"")
if(nans==nvalue){
item.result='right'
item.resultName='正确'
this.rightNum++
}else{
item.result='error'
item.resultName='错误'
}
/* 填空题*/
/* 其他*/
if (item.type != 'TKT') {
if (item.ans == item.value) {
item.result = 'right'
item.resultName = '正确'
this.rightNum++
} else {
item.result = 'error'
item.resultName = '错误'
}
} else {
let nans = item.ans.replace(/\s*/g, "")
let nvalue = item.value.replace(/\s*/g, "")
if (nans == nvalue) {
item.result = 'right'
item.resultName = '正确'
this.rightNum++
} else {
item.result = 'error'
item.resultName = '错误'
}
})
/* 提交试卷*/
this.$confirm('是否提交试卷, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
/* 练习时*/
console.log(this.subjectList)
if(this.paperType=='T'&&this.paperState=='B'){
this.paperState='E'
}
/* 填空题*/
}
})
/* 提交试卷*/
this.$confirm('是否提交试卷, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
/* 练习时*/
console.log(this.subjectList)
if (this.paperType == 'T' && this.paperState == 'B') {
this.paperState = 'E'
} else {
this.$success('提交成功,您可以在考试记录中查看分数')
this.gobac()
this.exitFullscreen()
}
return
this.$success('提交成功,您可以在考试记录中查看分数')
this.$router.replace({path:'/train/onlinExamination'})
}).catch(() => {
}).catch(() => {
});
});
}
},
data(){
return{
data() {
return {
username:'',
userid:'',
kssc: 100,
singleItem: '',
loading: false,
/* 考试or测试*/
paperType:'T',
paperState:'B',
id:'',
startTime:new Date().getTime(),
endTime:new Date().getTime()+1000*120*60,
remaining:'',
title:'专八仪表考试测试ID:',
that:this,
subjectList:[]
paperType: 'T',
paperState: 'B',
id: '',
startTime: new Date().getTime(),
endTime: new Date().getTime() + 1000 * 120 * 60,
remaining: '',
title: 'LOADING...',
that: this,
subjectList: []
}
}
}
</script>
<style lang="scss">
.readover{
.readover {
opacity: .5;
transform:rotate(30deg);
transform: rotate(30deg);
border: 3.2px solid;
color: chartreuse;
height: 170px;
......@@ -211,7 +295,8 @@
position: absolute;
right: 50px;
border-radius: 50%;
.yyj{
.yyj {
height: 85px;
font-weight: 800;
font-size: 26px;
......@@ -219,7 +304,8 @@
width: 100%;
text-align: center;
}
.df{
.df {
height: 85px;
font-weight: 800;
font-size: 20px;
......@@ -228,58 +314,70 @@
text-align: center;
}
}
$f:flex;
$mini:800px;
%normarflex{
%normarflex {
display: $f;
}
%normal{
%normal {
padding-left: 11rem;
padding-right: 11rem;
}
%mini{
%mini {
padding-left: 2rem;
padding-right: 2rem;
}
@mixin normaltext($lintheight,$textalign,$fontweight:500,$fontsize:12px){
line-height:$lintheight;
@mixin normaltext($lintheight, $textalign, $fontweight:500, $fontsize:12px) {
line-height: $lintheight;
text-align: $textalign;
font-weight: $fontweight;
font-size:$fontsize
font-size: $fontsize
}
.testpaper{
.testpaper {
padding-top: 30px;
.info{
.info {
@extend %normarflex;
@include normaltext(80px,center,700,13px);
.infoItem{
width: 25%
@include normaltext(80px, center, 700, 13px);
.infoItem {
width: 50%
}
}
.title{
@include normaltext(30px,center,800,18px);
.title {
@include normaltext(30px, center, 800, 18px);
width: 100%
}
@media screen and (min-width: $mini) {
& {
@extent %normal;
--mode:'normal';
padding-left: 11rem;
padding-right: 11rem;
@extent %normal;
--mode: 'normal';
padding-left: 11rem;
padding-right: 11rem;
}
}
@media screen and (max-width: $mini) {
& {
@extent %mini;
--mode:'mini';
@extent %mini;
--mode: 'mini';
padding-left: 2rem;
padding-right: 2rem;
.info{
.info {
display: none;
}
.title{
.title {
display: none;
}
}
......
......@@ -30,8 +30,8 @@
</div>
<!-- 判断题 -->
<div v-if="type=='PDT'" class="options">
<div class="item" :key="index" v-for="(item,index) in options">
<el-radio :disabled='allItem.result' v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio>
<div class="item" :key="index" v-for="(item,index) in pDoptions">
<el-radio :disabled='allItem.result' v-model="value" :label="index"> {{`${index}`}}</el-radio>
</div>
</div>
<!-- 答案显示-->
......@@ -122,6 +122,10 @@
},
data() {
return {
pDoptions:{
'正确':'Y',
'错误':'N'
},
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