Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
4448187d
提交
4448187d
authored
10月 18, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改模拟考试
上级
d1cf15c2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
91 行增加
和
79 行删除
+91
-79
exam.js
src/api/exam.js
+6
-0
index.vue
src/pages/exam/testExam/exam/index.vue
+33
-20
index.vue
src/pages/exam/testExam/index.vue
+52
-59
没有找到文件。
src/api/exam.js
浏览文件 @
4448187d
import
httpRequest
from
'@/utils/axios'
import
httpRequest
from
'@/utils/axios'
/**
* 获取模拟考试试题
*/
export
function
getExamList
(
params
)
{
return
httpRequest
.
get
(
'/api/zy/v2/examination/examination-papers-list'
,
{
params
})
}
/**
/**
* 获取模拟考试试题
* 获取模拟考试试题
*/
*/
...
...
src/pages/exam/testExam/exam/index.vue
浏览文件 @
4448187d
...
@@ -54,10 +54,7 @@ import * as api from '@/api/exam.js'
...
@@ -54,10 +54,7 @@ import * as api from '@/api/exam.js'
import
answerCard
from
'../../components/answerCard.vue'
import
answerCard
from
'../../components/answerCard.vue'
import
question
from
'../../components/question.vue'
import
question
from
'../../components/question.vue'
export
default
{
export
default
{
components
:
{
components
:
{
question
,
answerCard
},
question
,
answerCard
},
data
()
{
data
()
{
return
{
return
{
time
:
{
time
:
{
...
@@ -90,6 +87,20 @@ export default {
...
@@ -90,6 +87,20 @@ export default {
handleTime
:
null
handleTime
:
null
}
}
},
},
computed
:
{
examId
()
{
return
this
.
$route
.
query
.
exam_id
},
changeQuestionIndex
()
{
return
this
.
questionParams
.
questionIndex
}
},
watch
:
{
// 监听题的变化
changeQuestionIndex
(
newV
,
oldV
)
{
this
.
changeData
()
}
},
beforeDestroy
()
{
beforeDestroy
()
{
// this.handlePapers()
// this.handlePapers()
clearInterval
(
this
.
handleTime
)
clearInterval
(
this
.
handleTime
)
...
@@ -130,8 +141,15 @@ export default {
...
@@ -130,8 +141,15 @@ export default {
// 收藏试题
// 收藏试题
collectQuestion
()
{
collectQuestion
()
{
const
data
=
this
.
questionParams
.
question
const
data
=
this
.
questionParams
.
question
data
.
isCollection
if
(
data
.
isCollection
)
{
?
this
.
removeCall
(
data
.
id
,
()
=>
{
data
.
isCollection
=
false
})
:
this
.
addCall
(
data
.
id
,
()
=>
{
data
.
isCollection
=
true
})
this
.
removeCall
(
data
.
id
,
()
=>
{
data
.
isCollection
=
false
})
}
else
{
this
.
addCall
(
data
.
id
,
()
=>
{
data
.
isCollection
=
true
})
}
},
},
addCall
(
id
,
call
)
{
addCall
(
id
,
call
)
{
api
.
addCollection
({
question_id
:
id
}).
then
(
response
=>
{
api
.
addCollection
({
question_id
:
id
}).
then
(
response
=>
{
...
@@ -203,6 +221,7 @@ export default {
...
@@ -203,6 +221,7 @@ export default {
getTopic
()
{
getTopic
()
{
const
param
=
{
const
param
=
{
type
:
2
,
type
:
2
,
paper_id
:
this
.
examId
,
is_create
:
this
.
$route
.
query
.
id
||
this
.
$route
.
query
.
is_create
===
undefined
?
0
:
this
.
$route
.
query
.
is_create
is_create
:
this
.
$route
.
query
.
id
||
this
.
$route
.
query
.
is_create
===
undefined
?
0
:
this
.
$route
.
query
.
is_create
}
}
api
.
getExamQuestion
(
param
).
then
(
response
=>
{
api
.
getExamQuestion
(
param
).
then
(
response
=>
{
...
@@ -274,7 +293,10 @@ export default {
...
@@ -274,7 +293,10 @@ export default {
return
this
.
A_Z
()[
findIndex
]
return
this
.
A_Z
()[
findIndex
]
})
})
data
.
question_analysis
=
cItem
.
question_analysis
data
.
question_analysis
=
cItem
.
question_analysis
optGroup
=
findAB
.
sort
().
toString
().
replace
(
new
RegExp
(
','
,
'g'
),
''
)
optGroup
=
findAB
.
sort
()
.
toString
()
.
replace
(
new
RegExp
(
','
,
'g'
),
''
)
data
.
question_answer
=
optGroup
data
.
question_answer
=
optGroup
}
}
}
}
...
@@ -314,11 +336,13 @@ export default {
...
@@ -314,11 +336,13 @@ export default {
let
_tmp
=
null
let
_tmp
=
null
arr
.
length
&&
(
_tmp
=
arr
[
0
][
str
])
arr
.
length
&&
(
_tmp
=
arr
[
0
][
str
])
for
(
const
i
in
arr
)
{
for
(
const
i
in
arr
)
{
arr
[
i
][
str
]
===
_tmp
?
_t
.
push
(
arr
[
i
])
:
(()
=>
{
if
(
arr
[
i
][
str
]
===
_tmp
)
{
_t
.
push
(
arr
[
i
])
}
else
{
_tmp
=
arr
[
i
][
str
]
_tmp
=
arr
[
i
][
str
]
_arr
.
push
(
_t
)
_arr
.
push
(
_t
)
_t
=
[
arr
[
i
]]
_t
=
[
arr
[
i
]]
}
)()
}
}
}
_arr
.
push
(
_t
)
_arr
.
push
(
_t
)
return
_arr
return
_arr
...
@@ -367,17 +391,6 @@ export default {
...
@@ -367,17 +391,6 @@ export default {
return
item
.
filter
(
is
=>
is
)
return
item
.
filter
(
is
=>
is
)
})
})
}
}
},
computed
:
{
changeQuestionIndex
()
{
return
this
.
questionParams
.
questionIndex
}
},
watch
:
{
// 监听题的变化
changeQuestionIndex
(
newV
,
oldV
)
{
this
.
changeData
()
}
}
}
}
}
</
script
>
</
script
>
...
...
src/pages/exam/testExam/index.vue
浏览文件 @
4448187d
<
template
>
<
template
>
<app-container
title=
"模拟考试介绍"
>
<app-container
title=
"模拟考试"
>
<div
class=
"desc-exam"
>
<ul
class=
"exam-list"
>
<p>
考试时间20分钟。
</p>
<li
v-for=
"item in examList"
:key=
"item.id"
class=
"exam-item"
@
click=
"startExam(item)"
>
<p>
演示考试题目共10题,全部为单选题。
</p>
<el-card
shadow=
"hover"
>
</div>
<h3>
{{
item
.
paper_title
}}
</h3>
<template
#
footer
>
<p
v-if=
"[1, 2].includes(item.status)"
>
已完成
</p>
<p
v-if=
"[0, 3].includes(item.status)"
>
待完成
</p>
<!--
<p>
重新考试
</p>
-->
</el-card>
</li>
</ul>
<!--
<template
#
footer
>
<div
class=
"app-container-ft"
><el-button
type=
"primary"
@
click=
"getExamStatus"
>
开始考试
</el-button></div>
<div
class=
"app-container-ft"
><el-button
type=
"primary"
@
click=
"getExamStatus"
>
开始考试
</el-button></div>
</
template
>
</
template
>
-->
</app-container>
</app-container>
</template>
</template>
...
@@ -16,73 +22,60 @@ import AppContainer from '@/components/AppContainer'
...
@@ -16,73 +22,60 @@ import AppContainer from '@/components/AppContainer'
export
default
{
export
default
{
components
:
{
AppContainer
},
components
:
{
AppContainer
},
data
()
{
data
()
{
return
{}
return
{
examList
:
[]
}
},
},
mounted
()
{
mounted
()
{
// this.open
()
this
.
getExamList
()
},
},
methods
:
{
methods
:
{
getExamStatus
()
{
getExamList
()
{
api
api
.
getExamList
().
then
(
response
=>
{
.
getExamStatus
({
type
:
2
})
// 考试状态(0,3:已缓存,1:已提交,2:已评阅,100:未做)
.
then
(
response
=>
{
this
.
examList
=
response
.
papers
if
(
response
.
status
===
0
||
response
.
status
===
3
)
{
})
this
.
open
()
},
}
else
{
startExam
(
item
)
{
this
.
$router
.
push
({
if
(
item
.
status
===
0
||
item
.
status
===
3
)
{
path
:
'/testExam/exam'
,
this
.
open
(
item
)
query
:
{
}
else
{
is_create
:
1
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
exam_id
:
item
.
id
,
is_create
:
1
}
})
}
}
})
}
})
.
finally
(()
=>
{
// this.loaded = true
})
},
},
open
()
{
open
(
item
)
{
const
h
=
this
.
$createElement
this
.
$msgbox
({
this
.
$msgbox
({
title
:
'
消息
'
,
title
:
'
提示
'
,
message
:
h
(
'p'
,
null
,
[
h
(
'span'
,
null
,
'您上次未做完试题 '
)])
,
message
:
'您上次未做完试题'
,
showCancelButton
:
true
,
showCancelButton
:
true
,
confirmButtonText
:
'继续答题'
,
confirmButtonText
:
'继续答题'
,
cancelButtonText
:
'重新答题'
,
cancelButtonText
:
'重新答题'
beforeClose
:
(
action
,
instance
,
done
)
=>
{
done
()
if
(
action
===
'confirm'
)
{
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
is_create
:
0
}
})
}
else
{
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
is_create
:
1
}
})
}
}
}).
then
(
action
=>
{
// this.$message({
// type: 'info',
// message: 'action: ' + action
// })
})
})
.
then
(()
=>
{
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
exam_id
:
item
.
id
,
is_create
:
0
}
})
})
.
catch
(()
=>
{
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
exam_id
:
item
.
id
,
is_create
:
1
}
})
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.desc-exam
{
.exam-list
{
}
.exam-item
{
display
:
inline-block
;
width
:
300px
;
margin
:
0
20px
20px
0
;
text-align
:
center
;
cursor
:
pointer
;
h3
{
line-height
:
30px
;
}
p
{
p
{
margin-bottom
:
20px
;
height
:
24px
;
line-height
:
20px
;
line-height
:
24px
;
color
:
#333
;
}
}
}
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论