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Me609sQ+YVIxa9fK0MXBiq7DG6nSLGvnLfVEYo4nGe6EvL9nQ7IFZywJjTb
/Fw4rTMwT59VSWJdv8BPznV7Gk7p17fcXM55iJxxu65r3ZuOXjQSGA==
-----END RSA PRIVATE KEY-----
\ No newline at end of file
差异被折叠。
......@@ -5,13 +5,13 @@ export default class ExamAPI extends BaseAPI {
* 获取考试信息
* @param {[string]} examId resource_id
*/
getTopic = (examId) => this.get(`/xexam/v1/exam/sheet/${examId}`, {})
getTopic = examId => this.get(`/xexam/v1/exam/sheet/${examId}`, {})
/* 缓存考试 */
setCache = (examId = {}, obj = {}) => this.post(`/xexam/v1/exam/cache/${examId}`, obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
setCache = (examId = '', obj = {}) => this.post(`/xexam/v1/exam/cache/${examId}`, obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/* 获取缓存 */
getCache = (examId) => this.get(`/xexam/v1/exam/cache/${examId}`, {})
getCache = examId => this.get(`/xexam/v1/exam/cache/${examId}`, {})
/* 缓存考试 */
endExam = (examId = {}, obj = {}) => this.post(`/xexam/v1/exam/sheet/${examId}`, obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
endExam = (examId = '', obj = {}) => this.post(`/xexam/v1/exam/sheet/${examId}`, obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
* 进入考试
*/
......
......@@ -5,7 +5,7 @@ export default class TestAPI extends BaseAPI {
* 获取考试信息
* @param {[string]} examId resource_id
*/
getExamInfo = (examId) => this.get(`/xexam/v1/exam/view/${examId}`, {})
getExamInfo = examId => this.get(`/xexam/v1/exam/view/${examId}`, {})
/**
* 进入考试
*/
......
......@@ -5,14 +5,14 @@ export default class TestAPI extends BaseAPI {
* get传输方式
* @param {[string]} id resource_id
*/
getTest = (id) => this.get(`/vue-client/get/${id}`, {})
getTest = id => this.get(`/vue-client/get/${id}`, {})
/**
* post传输方式
* @param {[object]} obj
*/
postTest = (obj = {}) => this.post('/passport/rest/login', obj, { headers: { 'Content-Type': 'multipart/form-data' } })
/**
* 当前登录用户,检测是否该系统有权限
*/
getInfo = () => this.post('/user_center/get_user_info', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
* 当前登录用户,检测是否该系统有权限
*/
getInfo = () => this.post('/user_center/get_user_info', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
}
......@@ -3,14 +3,7 @@
<div ref="wrapper">
<div class="info">
<div class="shape">
<img
:src="
info.id_photo
? info.id_photo
: 'https://zws-imgs-pub.ezijing.com/static/public/e0c63e4d4554f0852e1558426aad20d1.png'
"
alt=""
/>
<img :src="info.id_photo ? info.id_photo : 'https://zws-imgs-pub.ezijing.com/static/public/e0c63e4d4554f0852e1558426aad20d1.png'" />
</div>
<div class="right">
<div class="name">{{ info.name }}</div>
......@@ -132,8 +125,7 @@ export default {
info: { type: Object, default: () => {} }
},
data() {
return {
}
return {}
},
mounted() {
if (!this.isMobile()) {
......@@ -196,7 +188,7 @@ export default {
}
}
}
.order-scroll{
.order-scroll {
// max-height: 100px;
// overflow-y: scroll;
}
......
......@@ -11,7 +11,7 @@
<!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> -->
<!-- <meta http-equiv="Pragma" content="no-cache" /> -->
<!-- <meta http-equiv="Expires" content="0" /> -->
<title>标题</title>
<title></title>
<meta name="viewport" id="viewport" content="initial-scale=-1,maximum-scale=1,shrink-to-fit=no,user-scalable=no" />
</head>
<body>
......
......@@ -25,12 +25,7 @@
</div>
</div>
<div :class="isMobile() ? 'right scroll' : 'right hidden'" ref="wrapper">
<answer-card
:questionParams="questionParams"
:changeTime="changeTime"
:info="sInfo.info"
@switchQuestion="switchQuestion"
></answer-card>
<answer-card :questionParams="questionParams" :changeTime="changeTime" :info="studentInfo" @switchQuestion="switchQuestion"></answer-card>
</div>
<ul class="flag-tips">
<li>
......@@ -56,10 +51,7 @@
<div @click="changeIndex('prev')" :class="this.questionParams.questionIndex !== 0 ? 'active' : ''">
上一题
</div>
<div
:class="questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''"
@click="changeIndex('next')"
>
<div :class="questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''" @click="changeIndex('next')">
下一题
</div>
</div>
......@@ -91,7 +83,7 @@ import BScroll from 'better-scroll'
export default {
metaInfo() {
return {
title: JSON.parse(window.localStorage.getItem('examInfo')).name || ''
title: this.examInfo.name || ''
}
},
components: {
......@@ -100,14 +92,23 @@ export default {
'my-dia': dialogComponent
},
data() {
let studentInfo = {}
let examInfo = {}
try {
studentInfo = JSON.parse(window.localStorage.getItem('studentInfo'))
examInfo = JSON.parse(window.localStorage.getItem('examInfo'))
} catch (error) {
console.log(error)
}
return {
isExamEnd: false,
isExamTimeDate: true,
itemSign: false,
examTime: '00:00:00 倒计时',
clearTime: null,
sInfo: JSON.parse(window.localStorage.getItem('studentInfo')),
examInfo: JSON.parse(window.localStorage.getItem('examInfo')),
studentInfo,
examInfo,
title: '提示',
prompt: '确定后要结束本次考试?还有作答时间,结束考试后,将不能返回本次考试!',
isPopup: false,
......@@ -125,6 +126,20 @@ export default {
}
}
},
computed: {
examId() {
return this.$route.params.examId || this.examInfo.exam_id
},
changeQuestionIndex() {
return this.questionParams.questionIndex
}
},
watch: {
changeQuestionIndex(newV, oldV) {
this.refreshBscroll()
}
},
mounted() {
// this.sendExamInfo(3)
this.setTick()
......@@ -149,8 +164,8 @@ export default {
},
sendExamInfo(status) {
const param = {
student_id: this.sInfo.info.student_id,
exam_id: this.examInfo.exam_id,
student_id: this.studentInfo.student_id,
exam_id: this.examId,
status: status
}
action.Login.sendExamInfo(param)
......@@ -160,9 +175,7 @@ export default {
})
},
countHeight() {
this.contentHeight = parseInt(
document.body.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight)
)
this.contentHeight = parseInt(document.body.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight))
},
// 标记
signHandle() {
......@@ -178,12 +191,7 @@ export default {
this.$alert('考试时间到', {
confirmButtonText: '确定',
callback: action => {
this.$router.replace({
path: '/examEnd',
query: {
id: JSON.parse(window.localStorage.getItem('examInfo')).exam_id
}
})
this.$router.replace({ path: '/examEnd', query: { id: this.examId } })
}
})
} else {
......@@ -229,7 +237,7 @@ export default {
const param = {
answer: JSON.stringify(this.questionParams.answerRecord)
}
action.Exam.endExam(this.$route.params.examId, param).then(res => {
action.Exam.endExam(this.examId, param).then(res => {
if (!n) {
clearInterval(this.clearTime)
this.$router.replace({
......@@ -249,7 +257,7 @@ export default {
// })
// .then(() => {
// this.$router.replace({
// path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}`
// path: `/login/${this.examId}`
// })
// })
// .catch(action => {
......@@ -263,18 +271,18 @@ export default {
// })
},
countDown(time) {
const lefttime = parseInt(time / 1000)
const h = this.addZero(parseInt((lefttime / (60 * 60)) % 24))
const m = this.addZero(parseInt((lefttime / 60) % 60))
const s = this.addZero(parseInt(lefttime % 60))
const leftTime = parseInt(time / 1000)
const h = this.addZero(parseInt((leftTime / (60 * 60)) % 24))
const m = this.addZero(parseInt((leftTime / 60) % 60))
const s = this.addZero(parseInt(leftTime % 60))
this.examTime = `${h} : ${m} : ${s} 倒计时`
},
setTick() {
let flag = true
this.clearTime = setInterval(() => {
const nowtime = new Date()
const endtime = new Date(this.examInfo.end_time.replace(/-/g, '/'))
const countTime = endtime.getTime() - nowtime.getTime()
const nowTime = new Date()
const endTime = new Date(this.examInfo.end_time.replace(/-/g, '/'))
const countTime = endTime.getTime() - nowTime.getTime()
if (countTime <= 0) {
this.isExamTimeDate = false
clearInterval(this.clearTime)
......@@ -305,8 +313,7 @@ export default {
if (type === 'prev') {
this.questionParams.questionIndex > 0 && this.questionParams.questionIndex--
} else {
this.questionParams.questionIndex + 1 !== this.questionParams.question.total_question_count &&
this.questionParams.questionIndex++
this.questionParams.questionIndex + 1 !== this.questionParams.question.total_question_count && this.questionParams.questionIndex++
}
this.refreshBscroll()
},
......@@ -322,7 +329,7 @@ export default {
this.refreshBscroll()
},
getTopic() {
action.Exam.getTopic(this.$route.params.examId)
action.Exam.getTopic(this.examId)
.then(res => {
this.questionParams.question = res
this.getCache()
......@@ -333,8 +340,8 @@ export default {
})
},
getCache() {
if (this.$route.params.examId) {
action.Exam.getCache(this.$route.params.examId)
if (this.examId) {
action.Exam.getCache(this.examId)
.then(res => {
const data = JSON.parse(res.answer)
if (data !== null && data !== 'null') {
......@@ -371,16 +378,6 @@ export default {
const isPc = !isPhone && !isAndroid && !isSymbian
return isPc
}
},
computed: {
changeQuestionIndex() {
return this.questionParams.questionIndex
}
},
watch: {
changeQuestionIndex(newV, oldV) {
this.refreshBscroll()
}
}
}
</script>
......
......@@ -13,20 +13,8 @@
<div :class="loginParam.is ? 'form prohibit' : 'form'">
<div class="tips">{{ tips }}</div>
<!-- 您登录的次数已超过最大限制 -->
<input
type="text"
v-model="examineeNumber"
placeholder="请输入准考证号"
v-show="!loginParam.is"
@keydown="keydown($event)"
/>
<input
type="text"
placeholder="请输入准考证号"
readonly="readonly"
class="prohibit"
v-show="loginParam.is"
/>
<input type="text" v-model="examineeNumber" placeholder="请输入准考证号" v-show="!loginParam.is" @keydown="keydown($event)" />
<input type="text" placeholder="请输入准考证号" readonly="readonly" class="prohibit" v-show="loginParam.is" />
<div class="btn" @click="login">登录</div>
<!-- <div class="btn prohibit">登录</div> -->
<div class="time-tips" v-show="loginParam.is">{{ loginParam.countTimeText }}</div>
......@@ -34,7 +22,7 @@
</div>
</div>
</div>
<div class="welcome-msg mian-cont900" v-if="data" v-html="data.config.welcome_message"></div>
<div class="welcome-msg mian-cont900" v-if="data && data.config" v-html="data.config.welcome_message"></div>
</div>
</template>
<script>
......@@ -46,16 +34,16 @@ export default {
},
metaInfo() {
return {
title: JSON.parse(window.localStorage.getItem('examInfo')).name || ''
title: this.data.name
}
},
data() {
return {
tips: '',
claerExamTime: null,
clearExamTime: null,
title: '提示',
prompt: '不能退出全屏',
data: '',
data: {},
examineeNumber: '',
isPopup: false,
loginParam: {
......@@ -65,6 +53,11 @@ export default {
}
}
},
computed: {
examId() {
return this.$route.params.examId
}
},
mounted() {
this.getExamInfo()
this.tipsMobileAngle()
......@@ -78,10 +71,7 @@ export default {
const winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0
const winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0
if (winHeight > winWidth) {
this.$message({
message: '请横屏预览',
type: 'warning'
})
this.$message({ message: '请横屏预览', type: 'warning' })
}
}
},
......@@ -89,19 +79,19 @@ export default {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
},
getExamInfo() {
action.Login.getExamInfo(this.$route.params.examId).then(res => {
action.Login.getExamInfo(this.examId).then(res => {
window.localStorage.setItem('examInfo', JSON.stringify(res))
this.data = res
if (this.getEnabledTime() < 0) {
this.examTimeInit()
} else {
let claearTimes = null
claearTimes = setInterval(() => {
let clearTimes = null
clearTimes = setInterval(() => {
// console.log(this.getAfterTime())
if (this.getAfterTime() <= 0) {
this.tips = '超过登录时间'
this.loginParam.is = true
clearInterval(claearTimes)
clearInterval(clearTimes)
}
}, 1000)
this.loginParam.is = false
......@@ -109,11 +99,7 @@ export default {
})
},
sendExamInfo(studentId) {
const param = {
student_id: studentId,
exam_id: this.data.exam_id,
status: 2
}
const param = { student_id: studentId, exam_id: this.examId, status: 2 }
action.Login.sendExamInfo(param)
.then(res => {})
.catch(err => {
......@@ -126,25 +112,23 @@ export default {
},
getAfterTime() {
const curTime = new Date()
const endtTime = new Date(this.data.end_time)
const countTime = endtTime.getTime() - curTime.getTime()
const endTime = new Date(this.data.end_time)
const countTime = endTime.getTime() - curTime.getTime()
return countTime
},
getEnabledTime() {
const curTime = new Date()
const setCurTime = this.data.config.enabled_before
? new Date(curTime.setMinutes(curTime.getMinutes() + this.data.config.before_login))
: curTime
const setCurTime = this.data.config.enabled_before ? new Date(curTime.setMinutes(curTime.getMinutes() + this.data.config.before_login)) : curTime
const startTime = new Date(this.data.start_time)
const countTime = setCurTime.getTime() - startTime.getTime()
return countTime
},
examTimeInit() {
this.loginParam.is = true
this.claerExamTime = setInterval(() => {
this.clearExamTime = setInterval(() => {
const date = this.getEnabledTime()
if (date >= 0) {
clearInterval(this.claerExamTime)
clearInterval(this.clearExamTime)
this.loginParam.is = false
} else {
this.countDown(Math.abs(date))
......@@ -156,21 +140,23 @@ export default {
},
// 倒计时
countDown(time) {
const lefttime = parseInt(time / 1000)
const leftTime = parseInt(time / 1000)
const datSec = 24 * 60 * 60
const hourSer = 60 * 60
const minuteSec = 60
const dd = Math.floor(lefttime / datSec)
const hh = Math.floor((lefttime % datSec) / hourSer)
const mm = Math.floor((lefttime % hourSer) / minuteSec)
const ss = lefttime % minuteSec
this.loginParam.countTimeText = dd > 0 ? `距离开考还有: ${dd}${this.addZero(hh)}${this.addZero(mm)}${this.addZero(ss)}秒` : `距离开考还有: ${this.addZero(hh)}${this.addZero(mm)}${this.addZero(ss)}秒`
const dd = Math.floor(leftTime / datSec)
const hh = Math.floor((leftTime % datSec) / hourSer)
const mm = Math.floor((leftTime % hourSer) / minuteSec)
const ss = leftTime % minuteSec
this.loginParam.countTimeText =
dd > 0
? `距离开考还有: ${dd}${this.addZero(hh)}${this.addZero(mm)}${this.addZero(ss)}秒`
: `距离开考还有: ${this.addZero(hh)}${this.addZero(mm)}${this.addZero(ss)}秒`
},
// 开启全屏
fullScreen() {
const el = document.documentElement
const rfs =
el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen
const rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen
if (typeof rfs !== 'undefined' && rfs) {
rfs.call(el)
}
......@@ -189,17 +175,16 @@ export default {
this.$alert('请输入准考证号')
return false
}
action.Login.userLogin(this.data.exam_id, { examinee_number: this.examineeNumber })
action.Login.userLogin(this.examId, { examinee_number: this.examineeNumber })
.then(res => {
window.localStorage.setItem('studentInfo', JSON.stringify(res))
window.localStorage.setItem('studentInfo', JSON.stringify(res.info))
const status = parseInt(res.sheet_status)
// this.sendExamInfo(res.info.student_id)
if (status === 0) {
this.$router.replace({
name: 'confirmInfo'
})
this.$router.push({ name: 'confirmInfo', params: { examId: this.examId } })
} else if (status === 1) {
this.$alert('已提交考卷')
}
status === 1 && this.$alert('已提交考卷')
})
.catch(err => {
if (err.message.indexOf('error') !== -1) {
......@@ -232,7 +217,7 @@ export default {
position: absolute;
bottom: 0;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
margin-bottom: -115px;
}
}
......@@ -335,6 +320,7 @@ export default {
line-height: 40px;
text-align: center;
font-style: normal;
cursor: pointer;
&.prohibit {
color: #ccc;
background: #eee;
......
export default [
{ path: '/', redirect: '*' },
/* 测试页面 */
......@@ -6,7 +5,7 @@ export default [
/* 登录页面 */
{ path: '/login/:examId', component: () => import('../pages/login/index.vue') },
/* 确认信息 */
{ path: '/confirmInfo', name: 'confirmInfo', component: () => import('../pages/login/confirmInfo.vue') },
{ path: '/confirmInfo/:examId', name: 'confirmInfo', component: () => import('../pages/login/confirmInfo.vue') },
/* 考试倒计时 */
{ path: '/examTime', name: 'examTime', component: () => import('../pages/exam/examTime.vue') },
/* 答题 */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论