Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
78b10b2d
提交
78b10b2d
authored
10月 19, 2021
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:修改考试
上级
15e9912f
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
63 行增加
和
9 行删除
+63
-9
examCard.vue
src/components/exam/examCard.vue
+63
-9
没有找到文件。
src/components/exam/examCard.vue
浏览文件 @
78b10b2d
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<div
class=
"exam-main"
:style=
"
{ height: this.contentHeight + 'px' }">
<div
class=
"exam-main"
:style=
"
{ height: this.contentHeight + 'px' }">
<div
class=
"left"
>
<div
class=
"left"
>
<question-list
:data=
"currentExam"
></question-list>
<question-list
:data=
"currentExam"
></question-list>
{{
(
index
+
1
)
+
'/'
+
data
.
questions
.
total_question_count
}}
</div>
</div>
<div
class=
"right"
>
<div
class=
"right"
>
<answer-card></answer-card>
<answer-card></answer-card>
...
@@ -18,20 +19,20 @@
...
@@ -18,20 +19,20 @@
</div>
</div>
<div
class=
"foot"
id=
"foot-h"
>
<div
class=
"foot"
id=
"foot-h"
>
<div
class=
"exam-btn"
>
<div
class=
"exam-btn"
>
<div>
上一题
</div>
<div
@
click=
"prevQuestion"
>
上一题
</div>
<div>
下一题
</div>
<div
@
click=
"nextQuestion"
>
下一题
</div>
</div>
</div>
<div
class=
"rigth-btn"
>
<div
class=
"rigth-btn"
>
<div
class=
"sign"
v-if=
"hasCollect"
>
<div
class=
"sign"
v-if=
"hasCollect"
@
click=
"collectQuestion"
>
<div
class=
"icon
"
></div>
<div
:class=
"currentItem.is_collection ? 'icon active' : 'icon'
"
></div>
<div
class=
"txt"
>
收藏
</div>
<div
class=
"txt"
>
{{
currentItem
.
is_collection
?
'已收藏'
:
'收藏'
}}
</div>
</div>
</div>
<div
class=
"sign2"
v-if=
"hasMark"
>
<div
class=
"sign2"
v-if=
"hasMark"
@
click=
"markQuestion"
>
<div
class=
"icon
"
></div>
<div
:class=
"currentItem.sign ? 'icon active' : 'icon'
"
></div>
<div
class=
"txt"
>
标记
</div>
<div
class=
"txt"
>
{{
currentItem
.
sign
?
'已标记'
:
'标记'
}}
</div>
</div>
</div>
<div
class=
"end-exam-btn"
>
<div
class=
"end-exam-btn"
>
<div
class=
"btn"
v-if=
"hasSubmitBtn"
>
交卷
</div>
<div
class=
"btn"
v-if=
"hasSubmitBtn"
@
click=
"submitExam"
>
交卷
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -40,6 +41,7 @@
...
@@ -40,6 +41,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
*
as
api
from
'@/api/exam.js'
import
questionList
from
'@/components/exam/questionList'
import
questionList
from
'@/components/exam/questionList'
import
answerCard
from
'@/components/exam/examNumbers'
import
answerCard
from
'@/components/exam/examNumbers'
export
default
{
export
default
{
...
@@ -73,6 +75,10 @@ export default {
...
@@ -73,6 +75,10 @@ export default {
// 当前页面的大题数据
// 当前页面的大题数据
currentExam
()
{
currentExam
()
{
return
this
.
questionList
[
this
.
index
]
return
this
.
questionList
[
this
.
index
]
},
// 当前题第一个小题
currentItem
()
{
return
this
.
currentExam
.
question_list
[
0
]
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -85,6 +91,54 @@ export default {
...
@@ -85,6 +91,54 @@ export default {
// 获取dom高
// 获取dom高
getDom
(
id
)
{
getDom
(
id
)
{
return
document
.
getElementById
(
id
)
return
document
.
getElementById
(
id
)
},
// 下一题
nextQuestion
()
{
console
.
log
(
this
.
currentExam
.
question_list
[
0
])
const
totalNumber
=
this
.
data
.
questions
.
total_question_count
if
(
this
.
index
+
1
<
totalNumber
)
this
.
index
++
},
// 上一题
prevQuestion
()
{
if
(
this
.
index
!==
0
)
this
.
index
--
},
// 收藏试题
collectQuestion
()
{
const
item
=
this
.
currentItem
if
(
item
.
is_collection
)
{
api
.
deleteCollection
({
type
:
2
,
question_id
:
item
.
id
}).
then
(
response
=>
{
item
.
is_collection
=
false
})
return
false
}
api
.
addCollection
({
question_id
:
item
.
id
}).
then
(
response
=>
{
item
.
is_collection
=
true
})
},
// 标记
markQuestion
()
{
const
item
=
this
.
currentItem
item
.
sign
?
(
item
.
sign
=
false
)
:
(
item
.
sign
=
true
)
this
.
$forceUpdate
()
console
.
log
(
item
)
},
// 提交考试
submitExam
()
{
const
id
=
this
.
data
.
id
console
.
log
(
this
.
questionList
,
id
)
// const param = {
// sheet_id: id,
// status: 1, // 0缓存,1提交
// answers: JSON.stringify(this.questionParams.answerRecord),
// duration: this.time.duration
// }
// api.setCache(param).then(response => {
// if (n) {
// this.$router.replace({
// path: '/testExam/result'
// })
// }
// })
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论