Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-exam-show
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-exam-show
Commits
81f1098d
提交
81f1098d
authored
11月 12, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updata
上级
8f215059
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
107 行增加
和
39 行删除
+107
-39
base_api.js
src/api/base_api.js
+1
-1
sign2.png
src/assets/images/sign2.png
+0
-0
question.vue
src/components/exam/question.vue
+7
-6
examAnswer.vue
src/pages/exam/examAnswer.vue
+68
-19
examEnd.vue
src/pages/exam/examEnd.vue
+9
-4
examTime.vue
src/pages/exam/examTime.vue
+4
-4
confirmInfo.vue
src/pages/login/confirmInfo.vue
+15
-2
index.vue
src/pages/login/index.vue
+2
-2
routes.js
src/router/routes.js
+1
-1
没有找到文件。
src/api/base_api.js
浏览文件 @
81f1098d
...
...
@@ -90,7 +90,7 @@ export default class API {
if
(
res
.
response
.
data
)
{
res
.
response
.
data
.
code
===
0
?
err
=
res
.
response
.
data
:
new
Error
(
JSON
.
stringify
(
res
.
response
))
}
else
if
(
res
.
response
.
status
===
500
)
{
err
=
new
Error
(
'网络超时,请稍后重试'
)
err
=
new
Error
(
'
error:
网络超时,请稍后重试'
)
}
else
{
new
Error
(
JSON
.
stringify
(
res
.
response
))
}
...
...
src/assets/images/sign2.png
0 → 100644
浏览文件 @
81f1098d
728 Bytes
src/components/exam/question.vue
浏览文件 @
81f1098d
...
...
@@ -174,6 +174,7 @@ export default {
}
}
}
console
.
log
(
this
.
countQuetion
)
Bus
.
$emit
(
'monitoringChanges'
)
this
.
$forceUpdate
()
},
...
...
@@ -183,17 +184,17 @@ export default {
}
action
.
Exam
.
setCache
(
this
.
$route
.
params
.
examId
,
param
).
then
(
res
=>
{
}).
catch
(
err
=>
{
if
(
err
.
message
===
'网络超时,请稍后重试'
)
{
if
(
err
.
message
.
indexOf
(
'error'
)
!==
-
1
)
{
this
.
$confirm
(
'网络异常,请保持网络通畅'
,
'提示'
,
{
confirmButtonText
:
'
重新提交
'
,
cancelButtonText
:
'
退出考试
'
,
confirmButtonText
:
'
退出考试
'
,
cancelButtonText
:
'
重新提交
'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
setCache
()
}).
catch
(()
=>
{
this
.
$router
.
replace
({
path
:
`/login/
${
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'examInfo'
)).
exam_id
}
`
path
:
`/login/
${
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'examInfo'
)).
exam_id
}
`
})
}).
catch
(()
=>
{
this
.
endExamRequest
()
})
}
else
{
this
.
$alert
(
err
.
message
,
{
...
...
src/pages/exam/examAnswer.vue
浏览文件 @
81f1098d
...
...
@@ -38,11 +38,11 @@
</div>
<div
class=
"rigth-btn"
>
<div
class=
"sign"
@
click=
"signHandle"
>
<div
class=
"icon
"
></div>
<div
:class=
"itemSign ? 'icon active' : 'icon'
"
></div>
<div
class=
"txt"
>
{{
itemSign
?
'取消标记'
:
'标记'
}}
</div>
</div>
<div
class=
"end-exam-btn"
>
<div
class=
"btn"
@
click=
"endExam"
>
结束考试
</div>
<div
class=
"btn"
@
click=
"endExam
(2)
"
>
结束考试
</div>
</div>
</div>
</div>
...
...
@@ -72,8 +72,8 @@ export default {
itemSign
:
false
,
examTime
:
'00:00:00 倒计时'
,
clearTime
:
null
,
sInfo
:
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'studentInfo'
)),
examInfo
:
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'examInfo'
)),
sInfo
:
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'studentInfo'
)),
examInfo
:
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'examInfo'
)),
title
:
'提示'
,
prompt
:
'确定后要结束本次考试?还有作答时间,结束考试后,将不能返回本次考试!'
,
isPopup
:
false
,
...
...
@@ -105,10 +105,42 @@ export default {
console
.
log
(
value
)
},
// 提交考试
endExam
()
{
this
.
isExamTimeDate
?
this
.
isPopup
=
true
:
this
.
endExamRequest
()
endExam
(
n
)
{
if
(
n
===
1
)
{
this
.
$alert
(
'考试时间到'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
this
.
endExamRequest
()
}
})
}
else
{
const
count
=
parseInt
(
this
.
questionParams
.
question
.
total_question_count
)
-
parseInt
(
this
.
countAnswer
())
if
(
count
===
0
)
{
this
.
endExamRequest
()
}
else
{
this
.
$confirm
(
`确定要结束本次考试?还有
${
count
}
题未答,结束考试后,将不能反悔本次考试`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
endExamRequest
()
}).
catch
(()
=>
{
})
}
}
},
countAnswer
()
{
let
countNum
=
0
const
data
=
this
.
questionParams
.
answerRecord
for
(
const
item
in
data
)
{
const
list
=
Object
.
values
(
data
[
item
])
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
list
[
i
].
answer
.
length
)
{
countNum
++
}
}
}
return
countNum
},
endExamRequest
()
{
const
param
=
{
...
...
@@ -116,25 +148,22 @@ export default {
}
action
.
Exam
.
endExam
(
this
.
$route
.
params
.
examId
,
param
).
then
(
res
=>
{
clearInterval
(
this
.
clearTime
)
// this.$router.push({
// path: '/examEnd'
// })
this
.
$router
.
replace
({
path
:
'/examEnd'
})
window
.
session
Storage
.
setItem
(
'showflag'
,
'true'
)
window
.
local
Storage
.
setItem
(
'showflag'
,
'true'
)
}).
catch
(
err
=>
{
if
(
err
.
message
===
'网络超时,请稍后重试'
)
{
if
(
err
.
message
.
indexOf
(
'error'
)
!==
-
1
)
{
this
.
$confirm
(
'网络异常,请保持网络通畅'
,
'提示'
,
{
confirmButtonText
:
'
重新提交
'
,
cancelButtonText
:
'
退出考试
'
,
confirmButtonText
:
'
退出考试
'
,
cancelButtonText
:
'
重新提交
'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
endExamRequest
()
}).
catch
(()
=>
{
this
.
$router
.
replace
({
path
:
`/login/
${
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'examInfo'
)).
exam_id
}
`
path
:
`/login/
${
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'examInfo'
)).
exam_id
}
`
})
}).
catch
(()
=>
{
this
.
endExamRequest
()
})
}
else
{
this
.
$alert
(
err
.
message
,
{
...
...
@@ -159,7 +188,7 @@ export default {
this
.
isExamTimeDate
=
false
clearInterval
(
this
.
clearTime
)
this
.
examTime
=
'00:00:00 倒计时'
this
.
endExam
()
this
.
endExam
(
1
)
}
else
{
this
.
countDown
(
countTime
)
}
...
...
@@ -196,12 +225,28 @@ export default {
const
data
=
JSON
.
parse
(
res
.
answer
)
if
(
data
!==
null
&&
data
!==
'null'
)
{
this
.
questionParams
.
answerRecord
=
data
this
.
getSignStu
()
}
}).
catch
(
err
=>
{
this
.
$alert
(
err
.
message
,
{
callback
:
action
=>
{}
})
})
},
getSignStu
()
{
this
.
questionParams
.
question
.
question_items
.
map
((
item
,
index
)
=>
{
const
currentItem
=
item
.
question_list
.
find
(
items
=>
{
return
items
.
q_order
===
this
.
questionParams
.
questionIndex
+
1
})
if
(
currentItem
)
{
const
data
=
this
.
questionParams
.
answerRecord
if
(
data
[
currentItem
.
question_item_id
])
{
if
(
data
[
currentItem
.
question_item_id
][
currentItem
.
id
])
{
this
.
itemSign
=
data
[
currentItem
.
question_item_id
][
currentItem
.
id
].
sign
}
}
}
})
}
}
}
...
...
@@ -336,6 +381,10 @@ export default {
height
:
24px
;
background
:
url(../../assets/images/sign.png)
;
background-size
:
100%
100%
;
&
.active
{
background
:
url(../../assets/images/sign2.png)
;
background-size
:
100%
100%
;
}
}
.txt
{
font-size
:
14px
;
...
...
src/pages/exam/examEnd.vue
浏览文件 @
81f1098d
...
...
@@ -20,7 +20,7 @@ export default {
return
{
width
:
''
,
ispop
:
''
,
examInfo
:
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'examInfo'
))
examInfo
:
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'examInfo'
))
}
},
created
()
{
...
...
@@ -28,7 +28,7 @@ export default {
},
methods
:
{
getsess
()
{
this
.
ispop
=
Boolean
(
window
.
session
Storage
.
getItem
(
'showflag'
))
this
.
ispop
=
Boolean
(
window
.
local
Storage
.
getItem
(
'showflag'
))
console
.
log
(
111
+
this
.
ispop
)
}
},
...
...
@@ -38,8 +38,13 @@ export default {
// this.ispop = 'true'
},
1000
)
setTimeout
(()
=>
{
this
.
ispop
=
false
window
.
sessionStorage
.
removeItem
(
'showflag'
)
// this.ispop = false
window
.
localStorage
.
removeItem
(
'showflag'
)
setTimeout
(()
=>
{
this
.
$router
.
replace
({
path
:
'/'
})
},
2000
)
},
4000
)
}
}
...
...
src/pages/exam/examTime.vue
浏览文件 @
81f1098d
...
...
@@ -35,8 +35,8 @@ export default {
},
methods
:
{
countDown
()
{
// const date = JSON.parse(window.
session
Storage.getItem('examInfo')).start_time
const
date
=
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'examInfo'
)).
start_time
// const date = JSON.parse(window.
local
Storage.getItem('examInfo')).start_time
const
date
=
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'examInfo'
)).
start_time
const
nowtime
=
new
Date
()
const
endtime
=
new
Date
(
date
)
const
lefttime
=
parseInt
((
endtime
.
getTime
()
-
nowtime
.
getTime
())
/
1000
)
...
...
@@ -49,11 +49,11 @@ export default {
num4
:
'0'
}
// this.$router.push({
// path: `/examAnswer/${JSON.parse(window.
session
Storage.getItem('examInfo')).exam_id}`,
// path: `/examAnswer/${JSON.parse(window.
local
Storage.getItem('examInfo')).exam_id}`,
// replace: true
// })
this
.
$router
.
replace
({
path
:
`/examAnswer/
${
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'examInfo'
)).
exam_id
}
`
path
:
`/examAnswer/
${
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'examInfo'
)).
exam_id
}
`
})
}
const
td
=
`
${
this
.
addZero
(
parseInt
(
lefttime
/
60
%
60
))}${
this
.
addZero
(
parseInt
(
lefttime
%
60
))}
`
...
...
src/pages/login/confirmInfo.vue
浏览文件 @
81f1098d
...
...
@@ -68,8 +68,8 @@ import action from '@action'
export
default
{
data
()
{
return
{
sInfo
:
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'studentInfo'
)),
examInfo
:
JSON
.
parse
(
window
.
session
Storage
.
getItem
(
'examInfo'
)),
sInfo
:
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'studentInfo'
)),
examInfo
:
JSON
.
parse
(
window
.
local
Storage
.
getItem
(
'examInfo'
)),
form
:
{
educational_background
:
''
},
...
...
@@ -212,6 +212,19 @@ export default {
if
(
this
.
form
[
this
.
allForm
[
i
].
key
]
===
''
)
{
this
.
$alert
(
'请完善信息'
)
return
false
}
else
{
if
(
this
.
allForm
[
i
].
key
===
'mobile'
)
{
if
(
!
(
/^1
[
3456789
]\d{9}
$/
.
test
(
this
.
form
.
mobile
)))
{
this
.
$alert
(
'手机号不正确'
)
return
false
}
}
if
(
this
.
allForm
[
i
].
key
===
'email'
)
{
if
(
!
(
/^
([
a-zA-Z
\d])(\w)
+@
[
a-zA-Z
\d]
+
\.[
a-zA-Z
]{2,4}
$/
.
test
(
this
.
form
.
email
)))
{
this
.
$alert
(
'邮箱不正确'
)
return
false
}
}
}
}
}
...
...
src/pages/login/index.vue
浏览文件 @
81f1098d
...
...
@@ -52,7 +52,7 @@ export default {
},
mounted
()
{
action
.
Login
.
getExamInfo
(
this
.
$route
.
params
.
examId
).
then
(
res
=>
{
window
.
session
Storage
.
setItem
(
'examInfo'
,
JSON
.
stringify
(
res
))
window
.
local
Storage
.
setItem
(
'examInfo'
,
JSON
.
stringify
(
res
))
this
.
data
=
res
if
(
this
.
getEnabledTime
()
<
0
)
{
this
.
examTimeInit
()
...
...
@@ -138,7 +138,7 @@ export default {
return
false
}
action
.
Login
.
userLogin
(
this
.
data
.
exam_id
,
{
examinee_number
:
this
.
examineeNumber
}).
then
(
res
=>
{
window
.
session
Storage
.
setItem
(
'studentInfo'
,
JSON
.
stringify
(
res
))
window
.
local
Storage
.
setItem
(
'studentInfo'
,
JSON
.
stringify
(
res
))
const
status
=
parseInt
(
res
.
sheet_status
)
if
(
status
===
0
)
{
this
.
$router
.
replace
({
...
...
src/router/routes.js
浏览文件 @
81f1098d
export
default
[
{
path
:
'/'
,
redirect
:
'/login/1'
},
{
path
:
'/'
,
redirect
:
`/login/
${
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'examInfo'
))
?
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'examInfo'
)).
exam_id
:
'*'
}
`
},
/* 测试页面 */
{
path
:
'/test'
,
name
:
'test'
,
component
:
()
=>
import
(
'../pages/test.vue'
)
},
/* 登录页面 */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论