Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
1740cd8f
提交
1740cd8f
authored
10月 19, 2021
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修改错题
上级
f4442d0f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
674 行增加
和
109 行删除
+674
-109
question.vue
src/pages/exam/myExam/components/question.vue
+76
-73
questionDetails copy.vue
src/pages/exam/myExam/questionDetails copy.vue
+554
-0
questionDetails.vue
src/pages/exam/myExam/questionDetails.vue
+43
-35
index.vue
src/pages/exam/testExam/exam/index.vue
+1
-1
没有找到文件。
src/pages/exam/myExam/components/question.vue
浏览文件 @
1740cd8f
<
template
>
<
template
>
<div>
<div>
<!-- 单选多选判断题(题目描述dom结构一样,只那选项区分) -->
<div
v-for=
"(questionData, index) in questionData"
:key=
"index"
>
<template
v-if=
"questionData.question_item_type == 1 || questionData.question_item_type == 2 || questionData.question_item_type == 6"
>
<!-- 单选多选判断题(题目描述dom结构一样,只那选项区分) -->
<div
class=
"title-type"
>
<template
v-if=
"questionData.question_item_type == 1 || questionData.question_item_type == 2 || questionData.question_item_type == 6"
>
<div
class=
"type"
>
{{
questionData
.
question_item_title
}}
</div>
<div
class=
"title-type"
>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
/
{{
questionData
.
total_question_count
}}
</div>
<div
class=
"type"
>
{{
questionData
.
question_item_title
}}
</div>
</div>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
/
{{
questionData
.
total_question_count
}}
</div>
<div
class=
"title"
>
</div>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
.
</div><div
class=
"des"
v-html=
"questionData.content"
></div>
<div
class=
"title"
>
</div>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
.
</div><div
class=
"des"
v-html=
"questionData.content"
></div>
<ul
:class=
"questionData.question_item_type == 2 ? 'check-option' : 'radio-option'"
>
</div>
<template
v-for=
"(item, index) in questionData.options"
>
<ul
:class=
"questionData.question_item_type == 2 ? 'check-option' : 'radio-option'"
>
<li
<template
v-for=
"(item, index) in questionData.options"
>
:key=
"index"
<li
@
click=
"changeOptions(questionData.question_item_type, questionData.id, item.id)"
:key=
"index"
:class=
"$route.query.type == 3 ? allIsClass(item.id) : isClass(questionData.id, item.id)"
@
click=
"changeOptions(questionData.question_item_type, questionData.id, item.id)"
>
:class=
"$route.query.type == 3 ? allIsClass(item.id) : isClass(questionData.id, item.id)"
<div
class=
"icon"
></div>
>
<div
class=
"txt"
>
{{
A_Z
()[
index
]
}}
.
{{
item
.
option
}}
</div>
<div
class=
"icon"
></div>
</li>
<div
class=
"txt"
>
{{
A_Z
()[
index
]
}}
.
{{
item
.
option
}}
</div>
</
template
>
</li>
</ul>
</
template
>
</template>
</ul>
<!-- 解析 -->
</template>
<div
class=
"analysis"
v-if=
"!isAnswer && questionData.question_item_type != 5"
>
<!-- 解析 -->
<div
class=
"title"
>
答案解析
</div>
<div
class=
"analysis"
v-if=
"!isAnswer && (questionData.question_item_type != 5 || questionData.question_item_type != 7)"
>
<div
class=
"analy-mian"
>
<div
class=
"title"
>
答案解析
</div>
<div
class=
"txt1"
>
正确答案:{{ questionData.question_answer }}
</div>
<div
class=
"analy-mian"
>
<div
class=
"txt1"
>
您的答案:{{ myAnswer() }}
</div>
<div
class=
"txt1"
>
正确答案:{{ questionData.question_answer }}
</div>
<div
class=
"explain-box"
>
<div
class=
"txt1"
>
您的答案:{{ myAnswer() }}
</div>
<div>
解析:
</div>
<div
class=
"explain-box"
>
<div
class=
"w"
v-html=
"questionData.question_analysis"
></div>
<div>
解析:
</div>
<div
class=
"w"
v-html=
"questionData.question_analysis"
></div>
</div>
</div>
</div>
</div>
</div>
</div
>
<!-- 复合题 --
>
<!-- 复合题 --
>
<
template
v-if=
"questionData.question_item_type == 5 || questionData.question_item_type == 7"
>
<
template
v-if=
"questionData.question_item_type == 5
"
>
<div
class=
"title-type
"
>
<div
class=
"title-type"
>
<div
class=
"type"
>
{{
questionData
.
question_item_title
}}
</div
>
<div
class=
"type"
>
{{
questionData
.
question_item_title
}}
</div>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
/
{{
questionData
.
total_question_count
}}
</div>
<
div
class=
"num"
>
{{
questionData
.
q_order
}}
/
{{
questionData
.
total_question_count
}}
<
/div>
</div>
</div
>
<div
class=
"case-que"
>
<div
class=
"case-que
"
>
<div
class=
"flex
"
>
<div
class=
"flex"
>
<div
class=
"stem"
v-html=
"questionData.common_content"
></div
>
<div
class=
"stem"
v-html=
"questionData.common_content"
></div
>
<!-- 解析 --
>
<!-- 解析 --
>
<div
class=
"analysis"
v-if=
"!isAnswer"
>
<div
class=
"analysis"
v-if=
"!isAnswer"
>
<div
class=
"title"
>
答案解析
</div
>
<div
class=
"title"
>
答案解析
</div
>
<div
class=
"analy-mian"
>
<div
class=
"analy-mian"
>
<div
class=
"txt1"
>
正确答案:
{{
questionData
.
question_answer
}}
</div
>
<div
class=
"txt1"
>
正确答案:
{{
questionData
.
question_answer
}}
</div>
<div
class=
"txt1"
>
您的答案:
{{
myAnswer
()
}}
</div>
<div
class=
"txt1"
>
您的答案:
{{
myAnswer
()
}}
</div
>
<div
class=
"explain-box"
>
<div
class=
"explain-box"
>
<div>
解析:
</div
>
<div>
解析:
</div>
<div
class=
"w"
v-html=
"questionData.question_analysis"
>
</div>
<
div
class=
"w"
v-html=
"questionData.question_analysis"
><
/div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<ul
class=
"topics"
:style=
"
{height: contentHeight - 60 + 'px'}">
<li>
<div
class=
"title"
>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
.
</div><div
class=
"des"
v-html=
"questionData.content"
></div>
</div>
<ul
:class=
"questionData.answer_count > 1 ? 'check-option' : 'radio-option'"
>
<!-- radio-option check-option -->
<template
v-for=
"(opt, oIndex) in questionData.options"
>
<li
:id=
"opt.id"
:key=
"'c' + oIndex"
@
click=
"changeOptions(questionData.answer_count > 1 ? 2 : 1, questionData.id, opt.id)"
:class=
"isClass(questionData.id, opt.id)"
>
<div
class=
"icon"
></div>
<div
class=
"txt"
>
{{
A_Z
()[
oIndex
]
}}
.
{{
opt
.
option
}}
</div>
</li>
</
template
>
</ul>
</li>
</ul>
</div>
</div>
<ul
class=
"topics"
:style=
"
{height: contentHeight - 60 + 'px'}">
</template>
<li>
</div>
<div
class=
"title"
>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
.
</div><div
class=
"des"
v-html=
"questionData.content"
></div>
</div>
<ul
:class=
"questionData.answer_count > 1 ? 'check-option' : 'radio-option'"
>
<!-- radio-option check-option -->
<template
v-for=
"(opt, oIndex) in questionData.options"
>
<li
:id=
"opt.id"
:key=
"'c' + oIndex"
@
click=
"changeOptions(questionData.answer_count > 1 ? 2 : 1, questionData.id, opt.id)"
:class=
"isClass(questionData.id, opt.id)"
>
<div
class=
"icon"
></div>
<div
class=
"txt"
>
{{
A_Z
()[
oIndex
]
}}
.
{{
opt
.
option
}}
</div>
</li>
</
template
>
</ul>
</li>
</ul>
</div>
</template>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
...
@@ -88,13 +90,14 @@ export default {
...
@@ -88,13 +90,14 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
questionData
:
{}
,
questionData
:
[]
,
isAnswer
:
true
,
isAnswer
:
true
,
currentCheck
:
{}
currentCheck
:
{}
}
}
},
},
created
()
{
created
()
{
this
.
questionData
=
this
.
questionParams
.
question
this
.
questionData
=
this
.
questionParams
.
question
console
.
log
(
this
.
questionDatas
,
'lhh=1='
)
},
},
mounted
()
{
mounted
()
{
this
.
isChangeAnswer
()
this
.
isChangeAnswer
()
...
...
src/pages/exam/myExam/questionDetails copy.vue
0 → 100644
浏览文件 @
1740cd8f
<
template
>
<div>
<div
class=
"answer-box"
>
<div
class=
"head"
id=
"head-h"
>
<el-button
icon=
"el-icon-arrow-left"
circle
@
click=
"$router.back()"
></el-button>
<div
class=
"title"
>
{{
$route
.
query
.
type
==
1
?
'我的错题'
:
$route
.
query
.
type
==
2
?
'收藏试题'
:
'已做试题'
}}
</div>
<div
class=
"right"
>
<div
class=
"count"
>
{{
questionParams
.
question
.
sheet_time
}}
</div>
</div>
</div>
<div
class=
"exam-main"
:style=
"
{height: this.contentHeight + 'px'}">
<div
class=
"left"
>
<question
v-if=
"Object.keys(questionParams.question).length"
:contentHeight=
"contentHeight"
:questionParams=
"questionParams"
ref=
"confirmBtn"
></question>
</div>
<div
class=
"right"
>
<answer-card
:questionParams=
"questionParams"
@
cardChangeQuention=
"goAppointQuestion"
></answer-card>
</div>
</div>
<div
class=
"foot"
id=
"foot-h"
>
<div
class=
"exam-btn"
>
<div
class=
"confirm"
v-if=
"this.questionParams.question.answer_count > 1 && $route.query.type != 3"
@
click=
"confirmBtn"
>
确认答案
</div>
<div
@
click=
"changeIndex('prev')"
:class=
"this.questionParams.questionIndex !== 0 ? 'active' : ''"
>
上一题
</div>
<div
:class=
"questionParams.questionIndex + 1 !== questionParams.question.total_question_count ? 'active' : ''"
@
click=
"changeIndex('next')"
>
下一题
</div>
</div>
<div
class=
"rigth-btn"
>
<div
class=
"sign"
@
click=
"collectQuestion"
v-if=
"$route.query.type != 2"
>
<div
:class=
"questionParams.question.is_collection ? 'icon active' : 'icon'"
></div>
<div
class=
"txt"
>
{{
questionParams
.
question
.
is_collection
?
'已收藏'
:
'收藏'
}}
</div>
</div>
<div
class=
"del-btn"
@
click=
"deleteQuestion"
>
删除
</div>
<div
class=
"end-exam-btn"
v-if=
"$route.query.type != 3"
>
<div
class=
"btn"
@
click=
"clearQuestion"
>
清空记录,重新答题
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
*
as
api
from
'@/api/exam.js'
import
answerCard
from
'./components/answerCard.vue'
import
question
from
'./components/question.vue'
export
default
{
components
:
{
question
,
answerCard
},
data
()
{
return
{
// 设置页面高
contentHeight
:
0
,
// 原数据
questionData
:
[],
// 存题
container
:
[],
// 过滤后的数据
afterChangeData
:
{},
questionParams
:
{
// 用户选择的选项 --- 提交后台的数据
answerRecord
:
{},
// 所有题 和题的信息
question
:
{},
questionIndex
:
0
,
card
:
{}
// beforeData: {}
}
}
},
mounted
()
{
// 赋值页面高度
this
.
setPageHeight
()
this
.
initData
()
},
methods
:
{
setPageHeight
()
{
this
.
contentHeight
=
parseInt
(
document
.
documentElement
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
))
},
// 删除试题
deleteQuestion
()
{
this
.
$loading
({
lock
:
true
,
text
:
'Loading'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.7)'
})
const
param
=
{
question_id
:
this
.
questionParams
.
question
.
id
,
type
:
this
.
$route
.
query
.
type
}
api
.
deleteQuestion
(
param
)
.
then
(
response
=>
{
this
.
$router
.
go
(
0
)
})
.
finally
(()
=>
{
})
},
// 初始化
initData
()
{
this
.
getCardAll
()
this
.
goAppointQuestion
(
this
.
$route
.
query
.
index
-
1
)
this
.
questionParams
.
questionIndex
=
0
window
.
localStorage
.
answerRecord
?
this
.
questionParams
.
answerRecord
=
JSON
.
parse
(
window
.
localStorage
.
answerRecord
)
:
this
.
questionParams
.
answerRecord
=
{}
},
confirmBtn
()
{
this
.
$refs
.
confirmBtn
.
answerConfirm
()
},
getDom
(
id
)
{
return
document
.
getElementById
(
id
)
},
// 收藏试题
collectQuestion
()
{
const
data
=
this
.
questionParams
.
question
console
.
log
(
data
)
data
.
is_collection
?
this
.
removeCall
(
data
.
id
,
()
=>
{
data
.
is_collection
=
false
})
:
this
.
addCall
(
data
.
id
,
()
=>
{
data
.
is_collection
=
true
})
},
addCall
(
id
,
call
)
{
api
.
addCollection
({
question_id
:
id
})
.
then
(
response
=>
{
call
(
response
.
list
)
})
.
finally
(()
=>
{
})
},
removeCall
(
id
,
call
)
{
api
.
deleteCollection
({
question_id
:
id
})
.
then
(
response
=>
{
call
(
response
.
list
)
})
.
finally
(()
=>
{
})
},
// 改变数据
setData
(
list
)
{
return
list
.
map
(
list
=>
{
const
type
=
{
1
:
'单选题'
,
2
:
'多选题'
,
5
:
'案例题'
,
6
:
'判断题'
}
const
typeTotal
=
{
3
:
'total'
,
1
:
'error_total'
,
2
:
'collection_total'
}
const
data
=
{
q_order
:
list
.
num
,
question_item_type
:
list
.
question_type
,
content
:
list
.
question_content
,
id
:
list
.
question_id
,
options
:
list
.
question_options
,
question_item_title
:
type
[
parseInt
(
list
.
question_type
)],
total_question_count
:
this
.
questionData
[
typeTotal
[
parseInt
(
this
.
$route
.
query
.
type
)]],
question_analysis
:
list
.
question_analysis
,
user_answer
:
list
.
user_answer
,
is_collection
:
list
.
is_collection
,
answer_count
:
list
.
answer_count
,
common_content
:
list
.
common_content
,
sheet_time
:
list
.
sheet_time
,
rightKey
:
list
.
question_answer
}
const
findAB
=
data
.
question_answer
=
list
.
question_answer
.
map
(
i
=>
{
const
findIndex
=
list
.
question_options
.
findIndex
(
opt
=>
{
return
opt
.
id
===
i
})
return
this
.
A_Z
()[
findIndex
]
})
data
.
question_answer
=
findAB
.
sort
().
toString
().
replace
(
new
RegExp
(
','
,
'g'
),
''
)
return
data
})
},
// 获取考卷
getTopic
(
page
,
call
)
{
const
param
=
{
type
:
this
.
$route
.
query
.
type
,
question_type
:
this
.
$route
.
query
.
qType
,
page
:
page
,
page_size
:
20
}
api
.
getMyQuestion
(
param
)
.
then
(
response
=>
{
this
.
questionData
=
response
call
(
response
.
list
)
})
.
finally
(()
=>
{
})
},
// 获取答题卡所有题
getCardAll
()
{
const
param
=
{
type
:
parseInt
(
this
.
$route
.
query
.
type
)
===
3
?
0
:
this
.
$route
.
query
.
type
,
question_type
:
this
.
$route
.
query
.
qType
}
api
.
getAllQuestion
(
param
)
.
then
(
response
=>
{
if
(
response
.
list
[
0
].
question
)
{
this
.
questionParams
.
card
=
this
.
setCardData
(
response
.
list
)
}
else
{
this
.
questionParams
.
card
=
response
.
list
}
})
.
finally
(()
=>
{
})
},
setCardData
(
list
)
{
return
list
.
map
(
item
=>
{
item
.
question
=
JSON
.
parse
(
item
.
question
)
return
item
})
},
// ABC
A_Z
()
{
const
result
=
[]
for
(
let
i
=
0
;
i
<
26
;
i
++
)
{
result
.
push
(
String
.
fromCharCode
(
65
+
i
))
}
return
result
},
// 点击上一题下一题 答题卡序号
changeData
()
{
this
.
questionData
.
list
.
map
(
list
=>
{
if
(
list
.
q_order
===
this
.
questionParams
.
questionIndex
+
1
)
{
this
.
questionParams
.
question
=
list
}
})
},
// 进入指定的题
goAppointQuestion
(
n
)
{
this
.
container
=
[]
this
.
questionData
.
list
=
[]
const
page
=
parseInt
(
n
/
20
)
if
(
page
===
0
)
{
this
.
getTopic
(
page
+
1
,
data
=>
{
this
.
container
=
this
.
setData
(
data
)
this
.
questionData
.
list
=
this
.
container
this
.
questionParams
.
questionIndex
=
parseInt
(
n
)
this
.
changeData
()
})
}
else
{
this
.
getTopic
(
page
,
data
=>
{
this
.
container
=
this
.
setData
(
data
)
this
.
questionData
.
list
=
this
.
container
})
this
.
getTopic
(
page
+
1
,
data
=>
{
this
.
addCont
(
data
,
1
)
this
.
questionData
.
list
=
this
.
container
this
.
questionParams
.
questionIndex
=
parseInt
(
n
)
this
.
changeData
()
})
}
},
// 改变题序
changeIndex
(
type
)
{
if
(
type
===
'prev'
)
{
if
(
this
.
questionParams
.
questionIndex
>
0
)
{
this
.
questionParams
.
questionIndex
--
const
isData
=
this
.
questionData
.
list
.
findIndex
(
i
=>
{
return
i
.
q_order
===
this
.
questionParams
.
questionIndex
+
1
})
!
isData
&&
(
this
.
supplyRequest
())
}
}
else
{
if
(
parseInt
(
this
.
questionParams
.
questionIndex
+
1
)
!==
parseInt
(
this
.
questionParams
.
question
.
total_question_count
))
{
this
.
questionParams
.
questionIndex
++
const
isData
=
this
.
questionData
.
list
.
find
(
i
=>
{
return
i
.
q_order
===
this
.
questionParams
.
questionIndex
+
2
})
!
isData
&&
(
this
.
supplyRequest
(
1
))
}
}
},
// 加载部分试题
supplyRequest
(
n
)
{
// const loading = this.$loading({
// lock: true,
// text: 'Loading',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)'
// })
this
.
getTopic
(
parseInt
((
n
?
this
.
questionParams
.
questionIndex
+
2
:
this
.
questionParams
.
questionIndex
-
2
)
/
20
)
+
1
,
data
=>
{
if
(
this
.
container
.
length
>=
40
)
{
n
?
this
.
container
.
splice
(
0
,
20
)
:
this
.
container
.
splice
(
20
,
20
)
this
.
addCont
(
data
,
n
)
}
else
{
this
.
addCont
(
data
,
n
)
}
this
.
questionData
.
list
=
this
.
container
this
.
changeData
()
// loading.close()
})
},
addCont
(
data
,
n
)
{
const
changeData
=
n
?
data
:
data
.
reverse
()
this
.
setData
(
changeData
).
map
(
item
=>
{
n
?
this
.
container
.
push
(
item
)
:
this
.
container
.
unshift
(
item
)
})
},
// 缓存 提交
handlePapers
(
n
)
{
const
answerData
=
{}
for
(
const
data
in
this
.
questionParams
.
answerRecord
)
{
answerData
[
data
]
=
this
.
questionParams
.
answerRecord
[
data
].
answer
}
const
param
=
{
type
:
this
.
$route
.
query
.
type
,
question_type
:
this
.
$route
.
query
.
qType
,
answer
:
JSON
.
stringify
(
answerData
)
}
window
.
localStorage
.
answerRecord
=
JSON
.
stringify
(
this
.
questionParams
.
answerRecord
)
this
.
chcheReq
(
param
,
()
=>
{})
},
// 清除所有答案 重新答题
clearQuestion
()
{
const
param
=
{
type
:
this
.
$route
.
query
.
type
,
question_type
:
this
.
$route
.
query
.
qType
,
clear
:
1
}
this
.
chcheReq
(
param
,
()
=>
{
this
.
questionParams
.
questionIndex
=
0
window
.
localStorage
.
removeItem
(
'answerRecord'
)
this
.
initData
()
this
.
$router
.
go
(
0
)
})
},
chcheReq
(
param
,
call
)
{
api
.
setMyCache
(
param
)
.
then
(
response
=>
{
call
()
})
.
finally
(()
=>
{
})
}
},
computed
:
{
changeQuestionIndex
()
{
return
this
.
questionParams
.
questionIndex
}
},
watch
:
{
// 监听题的变化
changeQuestionIndex
(
newV
,
oldV
)
{
this
.
changeData
()
parseInt
(
this
.
$route
.
query
.
type
)
!==
3
&&
(
this
.
handlePapers
())
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.answer-box
{
width
:
100%
;
height
:
100%
;
// background: #f9f9f9;
.head
{
border-bottom
:
1px
solid
#ccc
;
height
:
80px
;
background
:
#FFFFFF
;
display
:
flex
;
align-items
:
center
;
padding-left
:
40px
;
.title
{
padding-left
:
20px
;
font-size
:
24px
;
font-weight
:
bold
;
color
:
#222222
;
line-height
:
80px
;
}
.right
{
width
:
260px
;
margin-left
:
auto
;
display
:
flex
;
justify-content
:
space-around
;
align-items
:
center
;
.count
{
font-size
:
18px
;
font-weight
:
bold
;
color
:
#222222
;
}
.time
{
display
:
flex
;
.icon
{
width
:
23px
;
height
:
23px
;
// background: url(../../assets/images/tick.png);
background-size
:
100%
100%
;
}
.mun
{
font-size
:
18px
;
font-weight
:
bold
;
color
:
#222222
;
line-height
:
25px
;
margin-left
:
10px
;
}
}
}
}
.exam-main
{
display
:
flex
;
.left
{
background
:
#fff
;
flex
:
1
;
padding
:
10px
20px
0
53px
;
overflow-y
:
scroll
;
scrollbar-width
:
none
;
&
:
:-
webkit-scrollbar
{
display
:
none
;
}
}
.right
{
border-left
:
1px
solid
#ccc
;
position
:
relative
;
width
:
220px
;
background
:
#fff
;
padding
:
0
20px
;
overflow-y
:
scroll
;
scrollbar-width
:
none
;
&
:
:-
webkit-scrollbar
{
display
:
none
;
}
}
}
.foot
{
border-top
:
1px
solid
#ccc
;
position
:
fixed
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
height
:
60px
;
background
:
#FFFFFF
;
display
:
flex
;
align-items
:
center
;
.exam-btn
{
display
:
flex
;
padding-left
:
40px
;
.confirm
{
width
:
140px
;
height
:
40px
;
background
:
#C01540
;
border-radius
:
4px
;
font-size
:
14px
;
font-weight
:
bold
;
color
:
#FFFFFF
;
line-height
:
40px
;
text-align
:
center
;
}
cursor
:
pointer
;
div
{
width
:
100px
;
height
:
40px
;
border-radius
:
4px
;
border
:
1px
solid
#CCCCCC
;
font-size
:
14px
;
font-weight
:
bold
;
color
:
#999999
;
line-height
:
40px
;
text-align
:
center
;
margin-right
:
20px
;
&
.active
{
background
:
#C01540
;
border-radius
:
4px
;
color
:
#fff
;
}
}
}
.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
;
margin-top
:
-2px
;
border-left
:
1px
solid
#ccc
;
width
:
260px
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.btn
{
cursor
:
pointer
;
width
:
200px
;
height
:
40px
;
background
:
#c01540
;
border-radius
:
4px
;
font-size
:
14px
;
font-weight
:
bold
;
color
:
#fff
;
line-height
:
40px
;
text-align
:
center
;
}
}
.sign
{
margin-right
:
20px
;
margin-top
:
8px
;
.icon
{
margin
:
0
auto
;
width
:
24px
;
height
:
24px
;
background
:
url(@/assets/images/collection.png)
;
background-size
:
100%
100%
;
&
.active
{
background
:
url(@/assets/images/collection2.png)
;
background-size
:
100%
100%
;
}
}
.txt
{
font-size
:
14px
;
color
:
#CCCCCC
;
line-height
:
20px
;
margin-top
:
2px
;
}
}
}
}
}
</
style
>
src/pages/exam/myExam/questionDetails.vue
浏览文件 @
1740cd8f
...
@@ -161,40 +161,42 @@ export default {
...
@@ -161,40 +161,42 @@ export default {
},
},
// 改变数据
// 改变数据
setData
(
list
)
{
setData
(
list
)
{
return
list
.
map
(
list
=>
{
return
list
.
map
(
pList
=>
{
const
type
=
{
return
pList
.
map
(
list
=>
{
1
:
'单选题'
,
const
type
=
{
2
:
'多选题'
,
1
:
'单选题'
,
5
:
'案例题'
,
2
:
'多选题'
,
6
:
'判断题'
5
:
'案例题'
,
}
6
:
'判断题'
const
typeTotal
=
{
}
3
:
'total'
,
const
typeTotal
=
{
1
:
'error_total'
,
3
:
'total'
,
2
:
'collection_total'
1
:
'error_total'
,
}
2
:
'collection_total'
const
data
=
{
}
q_order
:
list
.
num
,
const
data
=
{
question_item_type
:
list
.
question_type
,
q_order
:
list
.
num
,
content
:
list
.
question_content
,
question_item_type
:
list
.
question_type
,
id
:
list
.
question_id
,
content
:
list
.
question_content
,
options
:
list
.
question_options
,
id
:
list
.
question_id
,
question_item_title
:
type
[
parseInt
(
list
.
question_type
)],
options
:
list
.
question_options
,
total_question_count
:
this
.
questionData
[
typeTotal
[
parseInt
(
this
.
$route
.
query
.
type
)]],
question_item_title
:
type
[
parseInt
(
list
.
question_type
)],
question_analysis
:
list
.
question_analysis
,
total_question_count
:
this
.
questionData
[
typeTotal
[
parseInt
(
this
.
$route
.
query
.
type
)]],
user_answer
:
list
.
user_answer
,
question_analysis
:
list
.
question_analysis
,
is_collection
:
list
.
is_collection
,
user_answer
:
list
.
user_answer
,
answer_count
:
list
.
answer_count
,
is_collection
:
list
.
is_collection
,
common_content
:
list
.
common_content
,
answer_count
:
list
.
answer_count
,
sheet_time
:
list
.
sheet_time
,
common_content
:
list
.
common_content
,
rightKey
:
list
.
question_answer
sheet_time
:
list
.
sheet_time
,
}
rightKey
:
list
.
question_answer
const
findAB
=
data
.
question_answer
=
list
.
question_answer
.
map
(
i
=>
{
}
const
findIndex
=
list
.
question_options
.
findIndex
(
opt
=>
{
return
opt
.
id
===
i
})
const
findAB
=
data
.
question_answer
=
list
.
question_answer
.
map
(
i
=>
{
return
this
.
A_Z
()[
findIndex
]
const
findIndex
=
list
.
question_options
.
findIndex
(
opt
=>
{
return
opt
.
id
===
i
})
return
this
.
A_Z
()[
findIndex
]
})
data
.
question_answer
=
findAB
.
sort
().
toString
().
replace
(
new
RegExp
(
','
,
'g'
),
''
)
return
data
})
})
data
.
question_answer
=
findAB
.
sort
().
toString
().
replace
(
new
RegExp
(
','
,
'g'
),
''
)
return
data
})
})
},
},
// 获取考卷
// 获取考卷
...
@@ -248,11 +250,17 @@ export default {
...
@@ -248,11 +250,17 @@ export default {
},
},
// 点击上一题下一题 答题卡序号
// 点击上一题下一题 答题卡序号
changeData
()
{
changeData
()
{
let
datas
=
[]
this
.
questionData
.
list
.
map
(
list
=>
{
this
.
questionData
.
list
.
map
(
list
=>
{
if
(
list
.
q_order
===
this
.
questionParams
.
questionIndex
+
1
)
{
const
findData
=
list
.
find
(
item
=>
{
this
.
questionParams
.
question
=
list
return
item
.
q_order
===
this
.
questionParams
.
questionIndex
+
1
})
if
(
findData
)
{
datas
=
list
return
false
}
}
})
})
this
.
questionParams
.
question
=
datas
},
},
// 进入指定的题
// 进入指定的题
goAppointQuestion
(
n
)
{
goAppointQuestion
(
n
)
{
...
...
src/pages/exam/testExam/exam/index.vue
浏览文件 @
1740cd8f
<
template
>
<
template
>
<div>
<div>
<exam-card
:hasSubmitBtn=
"!!(!$route.query.id)"
:hasCountDown=
"!!(!$route.query.id)"
v-if=
"Object.keys(data).length
> 1
"
@
submitExam=
"submitExam"
ref=
"exam"
title=
"模拟考试"
:data=
"data"
></exam-card>
<exam-card
:hasSubmitBtn=
"!!(!$route.query.id)"
:hasCountDown=
"!!(!$route.query.id)"
v-if=
"Object.keys(data).length"
@
submitExam=
"submitExam"
ref=
"exam"
title=
"模拟考试"
:data=
"data"
></exam-card>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论