Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
472d07f6
提交
472d07f6
authored
3月 08, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixes
上级
066e845c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
51 行增加
和
9 行删除
+51
-9
examCard.vue
src/components/exam/examCard.vue
+8
-0
Index.vue
src/modules/exam/exam/views/Index.vue
+43
-9
没有找到文件。
src/components/exam/examCard.vue
浏览文件 @
472d07f6
...
...
@@ -253,6 +253,14 @@ export default {
},
// 提交
submit
()
{
// 最短交卷时长/分钟
const
min
=
this
.
data
.
questions
.
minimum_paper_handing_time
||
0
if
(
this
.
duration
<
min
*
60
)
{
this
.
$alert
(
'考试时间不足'
+
min
+
'分钟,不能提交'
,
''
,
{
confirmButtonText
:
'确定'
})
return
}
this
.
$emit
(
'submit'
,
this
.
questionGroups
)
},
// 数据初始化
...
...
src/modules/exam/exam/views/Index.vue
浏览文件 @
472d07f6
...
...
@@ -11,19 +11,26 @@
<h3>
{{
item
.
paper_title
}}
</h3>
<!--
<p>
{{
item
.
start_time
}}
~
{{
item
.
end_time
}}
</p>
-->
<p>
{{
getExamStatusName
(
item
.
status
)
}}
</p>
<p
v-if=
"canRepeateExam(item)"
style=
"padding: 10px 0"
@
click
.
stop=
"repeateStartExam(item)"
>
重新考试
</p>
</el-card>
</
template
>
</div>
<el-dialog
center
:visible
.
sync=
"dialogVisible"
>
<div
class=
"info"
v-if=
"acitveItem && acitveItem.config"
>
<div
style=
"font-size:20px; text-align: center;"
>
{{ acitveItem.paper_title }}
</div>
<div
style=
"font-size:18px; text-align: center;margin: 10px 0 20px;"
>
考试时间:{{ acitveItem.start_time }} ~ {{ acitveItem.end_time }}
</div>
<div
style=
"font-size: 20px; text-align: center"
>
{{ acitveItem.paper_title }}
</div>
<div
style=
"font-size: 18px; text-align: center; margin: 10px 0 20px"
>
考试时间:{{ acitveItem.start_time }} ~ {{ acitveItem.end_time }}
</div>
<div
v-html=
"acitveItem.config.welcome_message"
></div>
</div>
<div
v-if=
"acitveItem && acitveItem.config"
>
<div
v-if=
"acitveItem.config.enabled_promise"
>
<el-dialog
title=
"考前须知"
:visible
.
sync=
"innerVisible"
width=
"70%"
append-to-body
center
>
<div
v-if=
"acitveItem && acitveItem.config"
style=
"font-size: 18px"
v-html=
"acitveItem.config.promise_message"
></div>
<div
v-if=
"acitveItem && acitveItem.config"
style=
"font-size: 18px"
v-html=
"acitveItem.config.promise_message"
></div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
:disabled=
"!isRead"
type=
"primary"
@
click=
"enterExam"
>
{{ noticeText }}
</el-button>
</span>
...
...
@@ -67,13 +74,18 @@ export default {
this
.
getExamList
()
},
methods
:
{
// 是否可以重复考试
canRepeateExam
(
item
)
{
// 状态已完成,并且设置了多次考试
return
[
1
,
2
].
includes
(
item
.
status
)
&&
item
.
paper_info
&&
item
.
paper_info
.
is_multiple_exams
},
getExamStatusName
(
status
)
{
const
map
=
{
0
:
'待完成'
,
// 已缓存
1
:
'已完成'
,
// 已提交
2
:
'已完成'
,
// 已评阅
3
:
'待完成'
,
// 已缓存
100
:
'未
做
'
,
100
:
'未
作答
'
,
101
:
'未开始'
,
102
:
'已结束'
}
...
...
@@ -81,7 +93,7 @@ export default {
},
getExamList
()
{
api
.
getExamList
({
course_id
:
this
.
courseId
}).
then
(
response
=>
{
// 考试状态(0,3:已缓存,1:已提交,2:已评阅,100:未
做
101:未开始 102:已结束)
// 考试状态(0,3:已缓存,1:已提交,2:已评阅,100:未
作答
101:未开始 102:已结束)
this
.
examList
=
response
.
papers
.
map
(
item
=>
{
const
nowTime
=
new
Date
().
getTime
()
item
.
config
=
item
.
config
?
JSON
.
parse
(
item
.
config
)
:
{}
...
...
@@ -107,7 +119,7 @@ export default {
this
.
$message
.
error
(
`考试
${
this
.
getExamStatusName
(
item
.
status
)}
(
${
item
.
start_time
}
~
${
item
.
end_time
}
)`
)
return
}
// 未
做
的新试卷
// 未
作答
的新试卷
if
(
item
.
paper_type
===
3
&&
item
.
status
===
100
)
{
// 考前须知
if
(
item
.
config
.
welcome_message
)
{
...
...
@@ -121,18 +133,40 @@ export default {
// 已完成
this
.
$router
.
push
({
path
:
'/exam/exam/result'
,
query
:
{
exam_id
:
item
.
id
,
type
:
item
.
paper_type
}
})
}
else
{
// 未
做
// 未
作答
this
.
$router
.
push
({
path
:
'/exam/exam/exam'
,
query
:
{
exam_id
:
item
.
id
,
type
:
item
.
paper_type
,
is_create
:
0
}
})
}
},
// 重新考试
repeateStartExam
(
item
)
{
this
.
acitveItem
=
item
// 考试未开始或者已结束
if
([
101
,
102
].
includes
(
item
.
status
))
{
this
.
$message
.
error
(
`考试
${
this
.
getExamStatusName
(
item
.
status
)}
(
${
item
.
start_time
}
~
${
item
.
end_time
}
)`
)
return
}
// 未作答的新试卷
if
(
item
.
paper_type
===
3
&&
item
.
status
===
100
)
{
// 考前须知
if
(
item
.
config
.
welcome_message
)
{
this
.
dialogVisible
=
true
return
}
}
// 未作答
this
.
$router
.
push
({
path
:
'/exam/exam/exam'
,
query
:
{
exam_id
:
item
.
id
,
type
:
item
.
paper_type
,
is_create
:
1
}
})
},
open
(
item
)
{
this
.
$msgbox
({
title
:
'提示'
,
message
:
'您上次未
做
完试题'
,
showCancelButton
:
tru
e
,
message
:
'您上次未
作答
完试题'
,
showCancelButton
:
fals
e
,
confirmButtonText
:
'继续答题'
,
cancelButtonText
:
'重新答题'
,
distinguishCancelAndClose
:
true
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论