Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
cf194517
提交
cf194517
authored
10月 20, 2021
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修改错题页面
上级
7b5fff92
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
41 行增加
和
23 行删除
+41
-23
questionDetails.vue
src/pages/exam/myExam/questionDetails.vue
+41
-23
没有找到文件。
src/pages/exam/myExam/questionDetails.vue
浏览文件 @
cf194517
...
...
@@ -8,6 +8,8 @@
submitButtonText=
"清空记录,重新答题"
@
submitExam=
"handleSubmit"
@
page-change=
"handlePageChange"
@
deleteQuestion=
"deleteQuestion"
ref=
"exam"
v-if=
"Object.keys(data).length"
></exam-card>
</
template
>
...
...
@@ -38,6 +40,22 @@ export default {
this
.
getTopic
()
},
methods
:
{
// 删除题目
deleteQuestion
(
data
)
{
const
param
=
{
question_id
:
data
.
question_list
[
0
].
question_id
,
type
:
this
.
$route
.
query
.
type
}
api
.
deleteQuestion
(
param
)
.
then
(
response
=>
{
// this.getTopic()
this
.
$router
.
go
(
0
)
})
.
finally
(()
=>
{
})
console
.
log
(
data
)
},
// 获取考卷
getTopic
()
{
const
query
=
this
.
$route
.
query
...
...
@@ -51,44 +69,44 @@ export default {
this
.
data
=
response
})
},
// 缓存答案
handleCache
(
data
)
{
const
params
=
this
.
genSubmitData
(
data
)
api
.
setCourseCache
(
Object
.
assign
(
params
,
{
status
:
0
}))
},
// 清空
handleSubmit
(
data
)
{
const
params
=
this
.
genSubmitData
(
data
)
api
.
setCourseCache
(
Object
.
assign
(
params
,
{
status
:
1
})).
then
(
res
=>
{
this
.
$router
.
replace
({
path
:
'/course/chapter/result'
,
query
:
Object
.
assign
({},
this
.
$route
.
query
,
{
type
:
2
})
})
const
param
=
{
type
:
this
.
$route
.
query
.
type
,
question_type
:
this
.
$route
.
query
.
qType
,
clear
:
1
}
this
.
cacheQuestion
(
param
,
()
=>
{
this
.
$router
.
go
(
0
)
})
},
// 缓存答案
handlePageChange
(
data
)
{
console
.
log
(
data
)
this
.
cacheQuestion
(
this
.
genSubmitData
(
this
.
$refs
.
exam
.
questionItems
))
},
cacheQuestion
(
param
,
call
)
{
api
.
setMyCache
(
param
)
.
then
(
response
=>
{
call
()
})
.
finally
(()
=>
{
})
},
// 组装提交数据
genSubmitData
(
questionList
)
{
const
answers
=
{}
questionList
.
forEach
(
item
=>
{
if
(
!
answers
[
item
.
question_item_id
])
{
answers
[
item
.
question_item_id
]
=
{}
}
item
.
question_list
.
forEach
(
cItem
=>
{
answers
[
item
.
question_item_id
][
cItem
.
id
]
=
{
sign
:
cItem
.
sign
?
cItem
.
sign
:
false
,
answers
:
cItem
.
user_answer
if
(
cItem
.
user_answer
.
length
)
{
answers
[
cItem
.
question_id
]
=
cItem
.
user_answer
}
})
})
return
{
type
:
1
,
sheet_id
:
this
.
data
.
id
,
status
:
0
,
answers
:
JSON
.
stringify
(
answers
),
duration
:
0
type
:
this
.
$route
.
query
.
type
,
question_type
:
this
.
$route
.
query
.
qType
,
answer
:
JSON
.
stringify
(
answers
)
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论