Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
0f981e81
提交
0f981e81
authored
10月 19, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates
上级
368f6440
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
43 行增加
和
11 行删除
+43
-11
MyQuestionListItem.vue
src/components/MyQuestionListItem.vue
+1
-1
examCard.vue
src/components/exam/examCard.vue
+41
-9
questionNumbers.vue
src/components/exam/questionNumbers.vue
+1
-1
questionDetails.vue
src/pages/exam/myExam/questionDetails.vue
+0
-0
没有找到文件。
src/components/MyQuestionListItem.vue
浏览文件 @
0f981e81
...
...
@@ -28,7 +28,7 @@ export default {
},
computed
:
{
questionTypeName
()
{
const
map
=
{
1
:
'单选题'
,
2
:
'多选题'
,
5
:
'案例题'
,
6
:
'判断
题'
}
const
map
=
{
1
:
'单选题'
,
2
:
'多选题'
,
3
:
'问答题'
,
5
:
'案例题'
,
6
:
'判断题'
,
7
:
'实操题'
,
8
:
'情景
题'
}
return
map
[
this
.
data
.
question_type
]
}
},
...
...
src/components/exam/examCard.vue
浏览文件 @
0f981e81
...
...
@@ -19,12 +19,13 @@
:index=
"index"
:list=
"questionList"
:data=
"currentExam"
@
change=
"handlePageChange"
@
page-
change=
"handlePageChange"
></question-numbers>
</div>
</div>
<div
class=
"foot"
id=
"foot-h"
>
<div
class=
"exam-btn"
>
<div
class=
"confirm"
@
click=
"showResult"
>
确认答案
</div>
<div
@
click=
"prevQuestion"
>
上一题
</div>
<div
@
click=
"nextQuestion"
>
下一题
</div>
</div>
...
...
@@ -37,8 +38,9 @@
<div
:class=
"currentItem.sign ? 'icon active' : 'icon'"
></div>
<div
class=
"txt"
>
{{ currentItem.sign ? '已标记' : '标记' }}
</div>
</div>
<div
class=
"del-btn"
v-if=
"hasDeleteBtn"
>
删除
</div>
<div
class=
"end-exam-btn"
>
<div
class=
"btn"
v-if=
"hasSubmitBtn && !disabled"
@
click=
"submitExam"
>
交卷
</div>
<div
class=
"btn"
v-if=
"hasSubmitBtn && !disabled"
@
click=
"submitExam"
>
{{ submitButtonText }}
</div>
</div>
</div>
</div>
...
...
@@ -54,11 +56,14 @@ export default {
components
:
{
questionList
,
questionNumbers
},
props
:
{
title
:
{
type
:
String
},
hasMark
:
{
type
:
Boolean
,
default
:
true
},
hasCollect
:
{
type
:
Boolean
,
default
:
true
},
hasSubmitBtn
:
{
type
:
Boolean
,
default
:
true
},
hasCountDown
:
{
type
:
Boolean
,
default
:
true
},
data
:
{
type
:
Object
,
default
:
()
=>
{}
}
hasMark
:
{
type
:
Boolean
,
default
:
true
},
// 标记
hasCollect
:
{
type
:
Boolean
,
default
:
true
},
// 收藏
hasSubmitBtn
:
{
type
:
Boolean
,
default
:
true
},
// 提交按钮
hasDeleteBtn
:
{
type
:
Boolean
,
default
:
false
},
// 删除按钮
hasCountDown
:
{
type
:
Boolean
,
default
:
true
},
// 计时
data
:
{
type
:
Object
,
default
:
()
=>
{}
},
questionItems
:
{
type
:
Array
,
default
:
()
=>
[]
},
submitButtonText
:
{
type
:
String
,
default
:
'交卷'
}
// 提交按钮显示的文字
},
data
()
{
return
{
...
...
@@ -87,6 +92,10 @@ export default {
deep
:
true
,
immediate
:
true
,
handler
(
value
)
{
if
(
this
.
questionItems
.
length
)
{
this
.
questionList
=
this
.
questionItems
return
}
if
(
value
)
{
const
{
status
}
=
value
this
.
disabled
=
[
'1'
,
'2'
].
includes
(
status
)
...
...
@@ -94,6 +103,9 @@ export default {
this
.
genQuestions
(
value
)
}
}
},
index
(
value
)
{
this
.
hasResult
=
this
.
currentExam
.
hasResult
}
},
beforeDestroy
()
{
...
...
@@ -134,14 +146,21 @@ export default {
}
return
result
},
// 确认答案
showResult
()
{
this
.
hasResult
=
true
this
.
questionList
[
this
.
index
].
hasResult
=
true
},
// 下一题
nextQuestion
()
{
const
totalNumber
=
this
.
questionList
.
length
if
(
this
.
index
+
1
<
totalNumber
)
this
.
index
++
this
.
$emit
(
'page-change'
,
this
.
currentExam
)
},
// 上一题
prevQuestion
()
{
if
(
this
.
index
!==
0
)
this
.
index
--
this
.
$emit
(
'page-change'
,
this
.
currentExam
)
},
handlePageChange
(
index
)
{
this
.
index
=
index
...
...
@@ -171,11 +190,10 @@ export default {
},
// 组装试题数据
genQuestions
(
data
)
{
const
{
questions
=
[]
,
answers
=
{}
}
=
data
const
{
questions
,
answers
=
{}
}
=
data
if
(
!
questions
)
return
[]
this
.
questionList
=
questions
.
question_items
.
reduce
((
result
,
question
)
=>
{
question
.
question_list
.
forEach
(
list
=>
{
console
.
log
(
list
)
list
=
list
.
map
(
item
=>
{
let
userAnswers
=
[]
let
sign
=
false
...
...
@@ -314,6 +332,19 @@ export default {
.rigth-btn
{
display
:
flex
;
margin-left
:
auto
;
.del-btn
{
margin-top
:
10px
;
width
:
100px
;
height
:
40px
;
border-radius
:
4px
;
border
:
1px
solid
#cccccc
;
line-height
:
40px
;
font-size
:
14px
;
font-weight
:
bold
;
color
:
#999999
;
text-align
:
center
;
margin-right
:
30px
;
}
.end-exam-btn
{
background
:
#fff
;
height
:
62px
;
...
...
@@ -323,6 +354,7 @@ export default {
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.btn
{
cursor
:
pointer
;
width
:
200px
;
...
...
src/components/exam/questionNumbers.vue
浏览文件 @
0f981e81
...
...
@@ -88,7 +88,7 @@ export default {
}
},
handleClick
(
data
)
{
this
.
$emit
(
'change'
,
data
.
index
,
data
)
this
.
$emit
(
'
page-
change'
,
data
.
index
,
data
)
}
}
}
...
...
src/pages/exam/myExam/questionDetails.vue
浏览文件 @
0f981e81
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论