Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
bd0561e9
提交
bd0561e9
authored
12月 01, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
b7692483
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
240 行增加
和
80 行删除
+240
-80
sign2.png
src/assets/images/sign2.png
+0
-0
answerCard.vue
src/pages/exam/components/answerCard.vue
+42
-19
question.vue
src/pages/exam/components/question.vue
+13
-7
resultCard.vue
src/pages/exam/components/resultCard.vue
+6
-4
index.vue
src/pages/exam/mockExam/exam/index.vue
+81
-15
result.vue
src/pages/exam/mockExam/exam/result.vue
+1
-1
answerCard.vue
src/pages/exam/myExam/components/answerCard.vue
+1
-3
questionDetails.vue
src/pages/exam/myExam/questionDetails.vue
+7
-3
index.vue
src/pages/exam/testExam/exam/index.vue
+84
-23
result.vue
src/pages/exam/testExam/exam/result.vue
+5
-5
没有找到文件。
src/assets/images/sign2.png
0 → 100644
浏览文件 @
bd0561e9
728 Bytes
src/pages/exam/components/answerCard.vue
浏览文件 @
bd0561e9
<
template
>
<
template
>
<div>
<div>
<div
class=
"order-num"
>
<!-- stu1已答 stu2当前 stu3标记 -->
<div
class=
"order-num"
v-if=
"questionParams.card"
>
<template
v-for=
"(item, index) in questionParams.card"
>
<template
v-for=
"(item, index) in questionParams.card"
>
<div
:key=
"index"
>
<div
:key=
"index"
v-if=
"item"
>
<div
class=
"tit"
>
{{
item
.
find
(
tit
=>
{
return
tit
.
question_item_title
}
).
question_item_title
}}
<
/div
>
<div
class=
"tit"
>
{{
item
.
find
(
tit
=>
{
return
tit
.
question_item_title
}
).
question_item_title
}}
<
/div
>
<
ul
>
<
ul
>
<
template
v
-
for
=
"(cItem, cIndex) in item"
>
<
template
v
-
for
=
"(cItem, cIndex) in item"
>
<!--
stu1
已答
stu2
当前
stu3
标记
-->
<
li
<
li
:
key
=
"cItem.q_order + '-' + cIndex"
:
key
=
"cItem.q_order + '-' + cIndex"
@
click
=
"goQuestion(cItem.q_order)"
@
click
=
"goQuestion(cItem.q_order)"
...
@@ -30,13 +30,13 @@
...
@@ -30,13 +30,13 @@
<
div
class
=
"circle3"
><
/div
>
<
div
class
=
"circle3"
><
/div
>
<
div
class
=
"txt"
>
当前
<
/div
>
<
div
class
=
"txt"
>
当前
<
/div
>
<
/li
>
<
/li
>
<
!--
<
li
>
<
li
>
<
div
class
=
"circle4"
><
/div
>
<
div
class
=
"circle4"
><
/div
>
<
div
class
=
"txt"
>
标记
<
/div
>
<
div
class
=
"txt"
>
标记
<
/div
>
<
/li>
--
>
<
/li
>
<
/ul
>
<
/ul
>
<
ul
class
=
"tips-box"
v
-
else
>
<
ul
class
=
"tips-box"
v
-
else
>
<
li
>
<
li
v
-
if
=
"this.$route.query.id !== 'err'"
>
<
div
class
=
"circle1"
><
/div
>
<
div
class
=
"circle1"
><
/div
>
<
div
class
=
"txt"
>
答对
<
/div
>
<
div
class
=
"txt"
>
答对
<
/div
>
<
/li
>
<
/li
>
...
@@ -70,10 +70,14 @@ export default {
...
@@ -70,10 +70,14 @@ export default {
return
this
.
questionParams
.
questionIndex
+
1
===
cItem
.
q_order
return
this
.
questionParams
.
questionIndex
+
1
===
cItem
.
q_order
?
currentAnswer
?
currentAnswer
?
currentAnswer
[
cItem
.
id
]
?
currentAnswer
[
cItem
.
id
]
?
currentAnswer
[
cItem
.
id
].
answer
.
length
!==
0
?
currentAnswer
[
cItem
.
id
].
answer
?
currentAnswer
[
cItem
.
id
].
sign
?
currentAnswer
[
cItem
.
id
].
answer
.
length
!==
0
?
'stu1 stu2 stu3'
?
currentAnswer
[
cItem
.
id
].
sign
:
'stu1 stu2'
?
'stu1 stu2 stu3'
:
'stu1 stu2'
:
currentAnswer
[
cItem
.
id
].
sign
?
'stu2 stu3'
:
'stu2'
:
currentAnswer
[
cItem
.
id
].
sign
:
currentAnswer
[
cItem
.
id
].
sign
?
'stu2 stu3'
?
'stu2 stu3'
:
'stu2'
:
'stu2'
...
@@ -81,10 +85,14 @@ export default {
...
@@ -81,10 +85,14 @@ export default {
:
'stu2'
:
'stu2'
:
currentAnswer
:
currentAnswer
?
currentAnswer
[
cItem
.
id
]
?
currentAnswer
[
cItem
.
id
]
?
currentAnswer
[
cItem
.
id
].
answer
.
length
!==
0
?
currentAnswer
[
cItem
.
id
].
answer
?
currentAnswer
[
cItem
.
id
].
sign
?
currentAnswer
[
cItem
.
id
].
answer
.
length
!==
0
?
'stu1 stu3'
?
currentAnswer
[
cItem
.
id
].
sign
:
'stu1'
?
'stu1 stu3'
:
'stu1'
:
currentAnswer
[
cItem
.
id
].
sign
?
'stu3'
:
''
:
currentAnswer
[
cItem
.
id
].
sign
:
currentAnswer
[
cItem
.
id
].
sign
?
'stu3'
?
'stu3'
:
''
:
''
...
@@ -98,10 +106,12 @@ export default {
...
@@ -98,10 +106,12 @@ export default {
const
scoreItems
=
this
.
questionParams
.
beforeData
.
score_items
[
cItem
.
question_item_id
][
cItem
.
id
]
const
scoreItems
=
this
.
questionParams
.
beforeData
.
score_items
[
cItem
.
question_item_id
][
cItem
.
id
]
return
findItems
return
findItems
?
findItems
[
cItem
.
id
]
?
findItems
[
cItem
.
id
]
?
findItems
[
cItem
.
id
].
answer
.
length
?
findItems
[
cItem
.
id
].
answer
?
scoreItems
.
is_right
?
findItems
[
cItem
.
id
].
answer
.
length
?
'stu1'
?
scoreItems
.
is_right
:
'stu2'
?
'stu1'
:
'stu2'
:
'stu3'
:
'stu3'
:
'stu3'
:
'stu3'
:
'stu3'
:
'stu3'
:
'stu3'
...
@@ -109,6 +119,19 @@ export default {
...
@@ -109,6 +119,19 @@ export default {
}
}
}
,
}
,
methods
:
{
methods
:
{
onSignHandle
(
stu
)
{
const
id
=
this
.
questionParams
.
question
this
.
questionParams
.
answerRecord
[
id
.
question_item_id
]
?
this
.
questionParams
.
answerRecord
[
id
.
question_item_id
][
id
.
id
]
?
this
.
questionParams
.
answerRecord
[
id
.
question_item_id
][
id
.
id
].
sign
=
stu
:
this
.
questionParams
.
answerRecord
[
id
.
question_item_id
][
id
.
id
]
=
{
sign
:
stu
}
:
this
.
questionParams
.
answerRecord
[
id
.
question_item_id
]
=
{
[
id
.
id
]:
{
sign
:
stu
}
}
this
.
$forceUpdate
()
}
,
monitoringChanges
()
{
monitoringChanges
()
{
this
.
$forceUpdate
()
this
.
$forceUpdate
()
}
,
}
,
...
@@ -370,7 +393,7 @@ export default {
...
@@ -370,7 +393,7 @@ export default {
list
-
style
:
none
;
list
-
style
:
none
;
li
{
li
{
&
:
nth
-
child
(
2
){
&
:
nth
-
child
(
2
){
margin
:
0
50
px
;
//
margin: 0 50px;
}
}
.
circle1
{
.
circle1
{
width
:
24
px
;
width
:
24
px
;
...
...
src/pages/exam/components/question.vue
浏览文件 @
bd0561e9
...
@@ -16,10 +16,14 @@
...
@@ -16,10 +16,14 @@
@
click=
"changeOptions(questionData.question_item_type, questionData.question_item_id, questionData.id, item.id)"
@
click=
"changeOptions(questionData.question_item_type, questionData.question_item_id, questionData.id, item.id)"
:class=
"questionParams.answerRecord[questionData.question_item_id]
:class=
"questionParams.answerRecord[questionData.question_item_id]
? questionParams.answerRecord[questionData.question_item_id][questionData.id]
? questionParams.answerRecord[questionData.question_item_id][questionData.id]
? questionParams.answerRecord[questionData.question_item_id][questionData.id].answer.find(id =>
{ return id === item.id })
? questionParams.answerRecord[questionData.question_item_id][questionData.id].answer
? 'active'
? questionParams.answerRecord[questionData.question_item_id][questionData.id].answer.length
? questionParams.answerRecord[questionData.question_item_id][questionData.id].answer.find(id =>
{ return id === item.id })
? 'active'
: ''
: ''
: ''
: ''
: ''
: ''
: ''"
: ''"
>
>
<div
class=
"icon"
></div>
<div
class=
"icon"
></div>
...
@@ -130,10 +134,12 @@ export default {
...
@@ -130,10 +134,12 @@ export default {
?
selectAnswer
[
currentData
.
question_item_id
][
currentData
.
id
]
?
selectAnswer
[
currentData
.
question_item_id
][
currentData
.
id
]
?
(()
=>
{
?
(()
=>
{
const
arr
=
[]
const
arr
=
[]
selectAnswer
[
currentData
.
question_item_id
][
currentData
.
id
].
answer
.
map
(
i
=>
{
if
(
selectAnswer
[
currentData
.
question_item_id
][
currentData
.
id
].
answer
)
{
const
findIndex
=
currentData
.
options
.
findIndex
(
d
=>
{
return
i
===
d
.
id
})
selectAnswer
[
currentData
.
question_item_id
][
currentData
.
id
].
answer
.
map
(
i
=>
{
arr
.
push
(
this
.
A_Z
()[
findIndex
])
const
findIndex
=
currentData
.
options
.
findIndex
(
d
=>
{
return
i
===
d
.
id
})
})
arr
.
push
(
this
.
A_Z
()[
findIndex
])
})
}
return
arr
.
sort
().
toString
().
replace
(
new
RegExp
(
','
,
'g'
),
''
)
return
arr
.
sort
().
toString
().
replace
(
new
RegExp
(
','
,
'g'
),
''
)
})()
})()
:
''
:
''
...
...
src/pages/exam/components/resultCard.vue
浏览文件 @
bd0561e9
...
@@ -51,10 +51,12 @@ export default {
...
@@ -51,10 +51,12 @@ export default {
const
scoreItems
=
this
.
data
.
score_items
[
id
][
cId
]
const
scoreItems
=
this
.
data
.
score_items
[
id
][
cId
]
return
findItems
return
findItems
?
findItems
[
cId
]
?
findItems
[
cId
]
?
findItems
[
cId
].
answer
.
length
?
findItems
[
cId
].
answer
?
scoreItems
.
is_right
?
findItems
[
cId
].
answer
.
length
?
'stu1'
?
scoreItems
.
is_right
:
'stu2'
?
'stu1'
:
'stu2'
:
'stu3'
:
'stu3'
:
'stu3'
:
'stu3'
:
'stu3'
:
'stu3'
:
'stu3'
...
...
src/pages/exam/mockExam/exam/index.vue
浏览文件 @
bd0561e9
...
@@ -13,15 +13,12 @@
...
@@ -13,15 +13,12 @@
v-if=
"Object.keys(questionParams.question).length"
v-if=
"Object.keys(questionParams.question).length"
:contentHeight=
"contentHeight"
:contentHeight=
"contentHeight"
:questionParams=
"questionParams"
:questionParams=
"questionParams"
ref=
"signHandle"
@
isSign=
"isSign"
></question>
></question>
</div>
</div>
<div
class=
"right"
>
<div
class=
"right"
>
<answer-card
<answer-card
:questionParams=
"questionParams"
:questionParams=
"questionParams"
ref=
"signHandle"
ref=
"signHandle"
@
isSign=
"isSign"
></answer-card>
></answer-card>
</div>
</div>
</div>
</div>
...
@@ -36,11 +33,15 @@
...
@@ -36,11 +33,15 @@
@
click=
"changeIndex('next')"
@
click=
"changeIndex('next')"
>
下一题
</div>
>
下一题
</div>
</div>
</div>
<div
class=
"rigth-btn"
@
click=
"signHandle"
>
<div
class=
"rigth-btn"
>
<div
class=
"sign"
@
click=
"collectQuestion"
>
<div
class=
"sign"
@
click=
"collectQuestion"
>
<div
:class=
"questionParams.question.isCollection ? 'icon active' : 'icon'"
></div>
<div
:class=
"questionParams.question.isCollection ? 'icon active' : 'icon'"
></div>
<div
class=
"txt"
>
{{
questionParams
.
question
.
isCollection
?
'已收藏'
:
'收藏'
}}
</div>
<div
class=
"txt"
>
{{
questionParams
.
question
.
isCollection
?
'已收藏'
:
'收藏'
}}
</div>
</div>
</div>
<div
class=
"sign2"
@
click=
"setSign"
v-if=
"!$route.query.id"
>
<div
:class=
"questionParams.question.sign ? 'icon active' : 'icon'"
></div>
<div
class=
"txt"
>
{{
questionParams
.
question
.
sign
?
'已标记'
:
'标记'
}}
</div>
</div>
<div
class=
"end-exam-btn"
v-if=
"!$route.query.id"
>
<div
class=
"end-exam-btn"
v-if=
"!$route.query.id"
>
<div
class=
"btn"
@
click=
"endExam"
>
交卷
</div>
<div
class=
"btn"
@
click=
"endExam"
>
交卷
</div>
</div>
</div>
...
@@ -86,10 +87,19 @@ export default {
...
@@ -86,10 +87,19 @@ export default {
question
:
{},
question
:
{},
card
:
{},
card
:
{},
beforeData
:
{}
beforeData
:
{}
}
},
handleTime
:
null
}
}
},
},
beforeDestroy
()
{
this
.
handlePapers
()
clearInterval
(
this
.
handleTime
)
clearInterval
(
this
.
time
.
clearTime
)
},
mounted
()
{
mounted
()
{
this
.
handleTime
=
setInterval
(()
=>
{
this
.
handlePapers
()
},
3000
)
// 赋值页面高度
// 赋值页面高度
this
.
contentHeight
=
parseInt
(
document
.
documentElement
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
))
this
.
contentHeight
=
parseInt
(
document
.
documentElement
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
))
this
.
getTopic
()
this
.
getTopic
()
...
@@ -125,17 +135,18 @@ export default {
...
@@ -125,17 +135,18 @@ export default {
.
finally
(()
=>
{
.
finally
(()
=>
{
})
})
},
},
// 标记
setSign
()
{
signHandle
()
{
const
data
=
this
.
questionParams
.
question
this
.
$refs
.
signHandle
.
onSignHandle
()
data
.
sign
},
?
data
.
sign
=
false
isSign
(
value
)
{
:
data
.
sign
=
true
this
.
itemSign
=
value
this
.
$refs
.
signHandle
.
onSignHandle
(
data
.
sign
)
},
},
// 提交考试
// 提交考试
endExam
()
{
endExam
()
{
this
.
handlePapers
(
1
)
this
.
handlePapers
(
1
)
},
},
// 倒计时考试
setClock
(
time
)
{
setClock
(
time
)
{
let
sec
=
parseInt
(
time
)
let
sec
=
parseInt
(
time
)
clearInterval
(
this
.
time
.
clearTime
)
clearInterval
(
this
.
time
.
clearTime
)
...
@@ -147,6 +158,7 @@ export default {
...
@@ -147,6 +158,7 @@ export default {
sec
--
sec
--
if
(
sec
===
0
)
{
if
(
sec
===
0
)
{
clearInterval
(
this
.
time
.
clearTime
)
clearInterval
(
this
.
time
.
clearTime
)
this
.
time
.
examTimeText
=
'00:00:00'
this
.
$alert
(
'考试时间结束,自动提交试卷'
,
''
,
{
this
.
$alert
(
'考试时间结束,自动提交试卷'
,
''
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
callback
:
action
=>
{
...
@@ -184,7 +196,6 @@ export default {
...
@@ -184,7 +196,6 @@ export default {
this
.
questionParams
.
questionIndex
+
1
!==
this
.
questionParams
.
question
.
total_question_count
&&
(
this
.
questionParams
.
questionIndex
++
)
this
.
questionParams
.
questionIndex
+
1
!==
this
.
questionParams
.
question
.
total_question_count
&&
(
this
.
questionParams
.
questionIndex
++
)
}
}
this
.
changeData
()
this
.
changeData
()
this
.
handlePapers
()
},
},
// 获取考卷
// 获取考卷
getTopic
()
{
getTopic
()
{
...
@@ -198,8 +209,18 @@ export default {
...
@@ -198,8 +209,18 @@ export default {
const
data
=
JSON
.
parse
(
response
.
data
)
const
data
=
JSON
.
parse
(
response
.
data
)
this
.
beforeChangeData
=
data
.
sheet
this
.
beforeChangeData
=
data
.
sheet
this
.
questionParams
.
beforeData
=
data
.
sheet
this
.
questionParams
.
beforeData
=
data
.
sheet
this
.
afterChangeData
=
this
.
setData
(
data
.
sheet
.
questions
.
question_items
)
let
countData
=
this
.
filterData
(
data
)
this
.
questionParams
.
card
=
this
.
setData
(
data
.
sheet
.
questions
.
question_items
)
if
(
this
.
$route
.
query
.
id
===
'err'
)
{
const
Num
=
this
.
countErrNum
(
countData
)
this
.
questionParams
.
question
.
total_question_count
=
Num
countData
=
countData
.
filter
(
item
=>
{
return
item
.
map
(
cItem
=>
{
cItem
.
total_question_count
=
Num
})
})
}
this
.
afterChangeData
=
countData
this
.
questionParams
.
card
=
countData
data
.
sheet
.
answers
!==
null
&&
(
this
.
questionParams
.
answerRecord
=
data
.
sheet
.
answers
)
data
.
sheet
.
answers
!==
null
&&
(
this
.
questionParams
.
answerRecord
=
data
.
sheet
.
answers
)
this
.
$route
.
query
.
id
&&
this
.
$route
.
query
.
id
.
length
>
5
this
.
$route
.
query
.
id
&&
this
.
$route
.
query
.
id
.
length
>
5
?
this
.
analysisInit
()
?
this
.
analysisInit
()
...
@@ -210,6 +231,21 @@ export default {
...
@@ -210,6 +231,21 @@ export default {
.
finally
(()
=>
{
.
finally
(()
=>
{
})
})
},
},
// 计算错题总数
countErrNum
(
data
)
{
let
countNum
=
0
data
.
map
(
item
=>
{
item
.
map
(
cItem
=>
{
countNum
++
})
})
return
countNum
},
filterData
(
data
)
{
return
this
.
setData
(
data
.
sheet
.
questions
.
question_items
).
map
(
item
=>
{
return
item
.
filter
(
is
=>
is
)
})
},
// 重组数据
// 重组数据
setData
(
data
)
{
setData
(
data
)
{
let
countNum
=
0
let
countNum
=
0
...
@@ -252,7 +288,17 @@ export default {
...
@@ -252,7 +288,17 @@ export default {
data
.
list
=
this
.
mergeData
(
item
.
question_list
,
'group_id'
)
data
.
list
=
this
.
mergeData
(
item
.
question_list
,
'group_id'
)
data
.
answer_count
=
cItem
.
answer_count
data
.
answer_count
=
cItem
.
answer_count
}
}
return
data
// 错题
if
(
this
.
$route
.
query
.
id
===
'err'
)
{
const
isRight
=
this
.
beforeChangeData
.
score_items
[
data
.
question_item_id
][
data
.
id
].
is_right
if
(
!
isRight
)
{
return
data
}
else
{
countNum
--
}
}
else
{
return
data
}
})
})
})
})
},
},
...
@@ -458,6 +504,26 @@ export default {
...
@@ -458,6 +504,26 @@ export default {
text-align
:
center
;
text-align
:
center
;
}
}
}
}
.sign2
{
margin-right
:
20px
;
.icon
{
margin
:
0
auto
;
width
:
24px
;
height
:
24px
;
background
:
url(@/assets/images/sign.png)
;
background-size
:
100%
100%
;
&
.active
{
background
:
url(@/assets/images/sign2.png)
;
background-size
:
100%
100%
;
}
}
.txt
{
font-size
:
14px
;
color
:
#CCCCCC
;
line-height
:
20px
;
margin-top
:
2px
;
}
}
.sign
{
.sign
{
margin-right
:
20px
;
margin-right
:
20px
;
.icon
{
.icon
{
...
...
src/pages/exam/mockExam/exam/result.vue
浏览文件 @
bd0561e9
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<
template
v-slot:btnBox
>
<
template
v-slot:btnBox
>
<div
class=
"btn-box"
>
<div
class=
"btn-box"
>
<div
class=
"btn"
@
click=
"goPage('all')"
>
全部解析
</div>
<div
class=
"btn"
@
click=
"goPage('all')"
>
全部解析
</div>
<
!--
<div
class=
"btn"
@
click=
"goPage('err')"
>
错误解析
</div>
--
>
<
div
class=
"btn"
@
click=
"goPage('err')"
>
错误解析
</div
>
</div>
</div>
</
template
>
</
template
>
</card>
</card>
...
...
src/pages/exam/myExam/components/answerCard.vue
浏览文件 @
bd0561e9
...
@@ -31,10 +31,8 @@ export default {
...
@@ -31,10 +31,8 @@ export default {
props
:
{
props
:
{
questionParams
:
{
type
:
Object
,
default
:
()
=>
{}
}
questionParams
:
{
type
:
Object
,
default
:
()
=>
{}
}
},
},
created
()
{
console
.
log
(
this
.
questionParams
,
'====123'
)
},
mounted
()
{
mounted
()
{
console
.
log
(
this
.
questionParams
.
card
,
'====123'
)
this
.
msgCenter
.
$on
(
'monitoringChanges'
,
this
.
monitoringChanges
)
this
.
msgCenter
.
$on
(
'monitoringChanges'
,
this
.
monitoringChanges
)
},
},
computed
:
{
computed
:
{
...
...
src/pages/exam/myExam/questionDetails.vue
浏览文件 @
bd0561e9
...
@@ -86,10 +86,13 @@ export default {
...
@@ -86,10 +86,13 @@ export default {
},
},
mounted
()
{
mounted
()
{
// 赋值页面高度
// 赋值页面高度
this
.
contentHeight
=
parseInt
(
document
.
documentElement
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
)
)
this
.
setPageHeight
(
)
this
.
initData
()
this
.
initData
()
},
},
methods
:
{
methods
:
{
setPageHeight
()
{
this
.
contentHeight
=
parseInt
(
document
.
documentElement
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
))
},
// 删除试题
// 删除试题
deleteQuestion
()
{
deleteQuestion
()
{
this
.
$loading
({
this
.
$loading
({
...
@@ -291,6 +294,7 @@ export default {
...
@@ -291,6 +294,7 @@ export default {
}
}
}
}
},
},
// 加载部分试题
supplyRequest
(
n
)
{
supplyRequest
(
n
)
{
const
loading
=
this
.
$loading
({
const
loading
=
this
.
$loading
({
lock
:
true
,
lock
:
true
,
...
@@ -341,6 +345,7 @@ export default {
...
@@ -341,6 +345,7 @@ export default {
this
.
questionParams
.
questionIndex
=
0
this
.
questionParams
.
questionIndex
=
0
window
.
localStorage
.
removeItem
(
'answerRecord'
)
window
.
localStorage
.
removeItem
(
'answerRecord'
)
this
.
initData
()
this
.
initData
()
this
.
$router
.
go
(
0
)
})
})
},
},
chcheReq
(
param
,
call
)
{
chcheReq
(
param
,
call
)
{
...
@@ -363,7 +368,6 @@ export default {
...
@@ -363,7 +368,6 @@ export default {
changeQuestionIndex
(
newV
,
oldV
)
{
changeQuestionIndex
(
newV
,
oldV
)
{
this
.
changeData
()
this
.
changeData
()
parseInt
(
this
.
$route
.
query
.
type
)
!==
3
&&
(
this
.
handlePapers
())
parseInt
(
this
.
$route
.
query
.
type
)
!==
3
&&
(
this
.
handlePapers
())
console
.
log
(
this
.
questionParams
.
question
)
}
}
}
}
}
}
...
@@ -438,7 +442,7 @@ export default {
...
@@ -438,7 +442,7 @@ export default {
}
}
}
}
.foot
{
.foot
{
position
:
absolute
;
position
:
fixed
;
bottom
:
0
;
bottom
:
0
;
left
:
0
;
left
:
0
;
width
:
100%
;
width
:
100%
;
...
...
src/pages/exam/testExam/exam/index.vue
浏览文件 @
bd0561e9
...
@@ -13,15 +13,12 @@
...
@@ -13,15 +13,12 @@
v-if=
"Object.keys(questionParams.question).length"
v-if=
"Object.keys(questionParams.question).length"
:contentHeight=
"contentHeight"
:contentHeight=
"contentHeight"
:questionParams=
"questionParams"
:questionParams=
"questionParams"
ref=
"signHandle"
@
isSign=
"isSign"
></question>
></question>
</div>
</div>
<div
class=
"right"
>
<div
class=
"right"
>
<answer-card
<answer-card
:questionParams=
"questionParams"
:questionParams=
"questionParams"
ref=
"signHandle"
ref=
"signHandle"
@
isSign=
"isSign"
></answer-card>
></answer-card>
</div>
</div>
</div>
</div>
...
@@ -36,11 +33,15 @@
...
@@ -36,11 +33,15 @@
@
click=
"changeIndex('next')"
@
click=
"changeIndex('next')"
>
下一题
</div>
>
下一题
</div>
</div>
</div>
<div
class=
"rigth-btn"
@
click=
"signHandle"
>
<div
class=
"rigth-btn"
>
<div
class=
"sign"
@
click=
"collectQuestion"
>
<div
class=
"sign"
@
click=
"collectQuestion"
>
<div
:class=
"questionParams.question.isCollection ? 'icon active' : 'icon'"
></div>
<div
:class=
"questionParams.question.isCollection ? 'icon active' : 'icon'"
></div>
<div
class=
"txt"
>
{{
questionParams
.
question
.
isCollection
?
'已收藏'
:
'收藏'
}}
</div>
<div
class=
"txt"
>
{{
questionParams
.
question
.
isCollection
?
'已收藏'
:
'收藏'
}}
</div>
</div>
</div>
<div
class=
"sign2"
@
click=
"setSign"
v-if=
"!$route.query.id"
>
<div
:class=
"questionParams.question.sign ? 'icon active' : 'icon'"
></div>
<div
class=
"txt"
>
{{
questionParams
.
question
.
sign
?
'已标记'
:
'标记'
}}
</div>
</div>
<div
class=
"end-exam-btn"
v-if=
"!$route.query.id"
>
<div
class=
"end-exam-btn"
v-if=
"!$route.query.id"
>
<div
class=
"btn"
@
click=
"endExam"
>
交卷
</div>
<div
class=
"btn"
@
click=
"endExam"
>
交卷
</div>
</div>
</div>
...
@@ -86,23 +87,35 @@ export default {
...
@@ -86,23 +87,35 @@ export default {
question
:
{},
question
:
{},
card
:
{},
card
:
{},
beforeData
:
{}
beforeData
:
{}
}
},
handleTime
:
null
}
}
},
},
beforeDestroy
()
{
beforeDestroy
()
{
this
.
handlePapers
()
this
.
handlePapers
()
clearInterval
(
this
.
handleTime
)
clearInterval
(
this
.
time
.
clearTime
)
clearInterval
(
this
.
time
.
clearTime
)
},
},
mounted
()
{
mounted
()
{
this
.
handleTime
=
setInterval
(()
=>
{
this
.
handlePapers
()
},
3000
)
// 赋值页面高度
// 赋值页面高度
this
.
contentHeight
=
parseInt
(
document
.
documentElement
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
))
this
.
contentHeight
=
parseInt
(
document
.
documentElement
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
))
this
.
getTopic
()
this
.
getTopic
()
},
},
methods
:
{
methods
:
{
// 标记
setSign
()
{
const
data
=
this
.
questionParams
.
question
data
.
sign
?
data
.
sign
=
false
:
data
.
sign
=
true
this
.
$refs
.
signHandle
.
onSignHandle
(
data
.
sign
)
},
// 收藏试题
// 收藏试题
collectQuestion
()
{
collectQuestion
()
{
const
data
=
this
.
questionParams
.
question
const
data
=
this
.
questionParams
.
question
console
.
log
(
data
)
data
.
isCollection
data
.
isCollection
?
this
.
removeCall
(
data
.
id
,
()
=>
{
?
this
.
removeCall
(
data
.
id
,
()
=>
{
data
.
isCollection
=
false
data
.
isCollection
=
false
...
@@ -129,13 +142,6 @@ export default {
...
@@ -129,13 +142,6 @@ export default {
.
finally
(()
=>
{
.
finally
(()
=>
{
})
})
},
},
// 标记
signHandle
()
{
this
.
$refs
.
signHandle
.
onSignHandle
()
},
isSign
(
value
)
{
this
.
itemSign
=
value
},
// 提交考试
// 提交考试
endExam
()
{
endExam
()
{
this
.
handlePapers
(
1
)
this
.
handlePapers
(
1
)
...
@@ -144,18 +150,14 @@ export default {
...
@@ -144,18 +150,14 @@ export default {
let
sec
=
parseInt
(
time
)
let
sec
=
parseInt
(
time
)
clearInterval
(
this
.
time
.
clearTime
)
clearInterval
(
this
.
time
.
clearTime
)
this
.
time
.
clearTime
=
setInterval
(()
=>
{
this
.
time
.
clearTime
=
setInterval
(()
=>
{
// if (this.requestParam.course_id) {
// this.time.examTimeText = this.secondToDate(sec)
// sec++
// } else {
// }
if
(
this
.
$route
.
query
.
id
)
{
if
(
this
.
$route
.
query
.
id
)
{
this
.
time
.
examTimeText
=
'
00:00:00
'
this
.
time
.
examTimeText
=
''
return
false
return
false
}
}
sec
--
sec
--
if
(
sec
===
0
)
{
if
(
sec
===
0
)
{
clearInterval
(
this
.
time
.
clearTime
)
clearInterval
(
this
.
time
.
clearTime
)
this
.
time
.
examTimeText
=
'00:00:00'
this
.
$alert
(
'考试时间结束,自动提交试卷'
,
''
,
{
this
.
$alert
(
'考试时间结束,自动提交试卷'
,
''
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
callback
:
action
=>
{
...
@@ -193,7 +195,6 @@ export default {
...
@@ -193,7 +195,6 @@ export default {
this
.
questionParams
.
questionIndex
+
1
!==
this
.
questionParams
.
question
.
total_question_count
&&
(
this
.
questionParams
.
questionIndex
++
)
this
.
questionParams
.
questionIndex
+
1
!==
this
.
questionParams
.
question
.
total_question_count
&&
(
this
.
questionParams
.
questionIndex
++
)
}
}
this
.
changeData
()
this
.
changeData
()
this
.
handlePapers
()
},
},
// 获取考卷
// 获取考卷
getTopic
()
{
getTopic
()
{
...
@@ -207,8 +208,19 @@ export default {
...
@@ -207,8 +208,19 @@ export default {
const
data
=
JSON
.
parse
(
response
.
data
)
const
data
=
JSON
.
parse
(
response
.
data
)
this
.
beforeChangeData
=
data
.
sheet
this
.
beforeChangeData
=
data
.
sheet
this
.
questionParams
.
beforeData
=
data
.
sheet
this
.
questionParams
.
beforeData
=
data
.
sheet
this
.
afterChangeData
=
this
.
setData
(
data
.
sheet
.
questions
.
question_items
)
let
countData
=
this
.
filterData
(
data
)
this
.
questionParams
.
card
=
this
.
setData
(
data
.
sheet
.
questions
.
question_items
)
if
(
this
.
$route
.
query
.
id
===
'err'
)
{
const
Num
=
this
.
countErrNum
(
countData
)
this
.
questionParams
.
question
.
total_question_count
=
Num
countData
=
countData
.
filter
(
item
=>
{
return
item
.
map
(
cItem
=>
{
cItem
.
total_question_count
=
Num
})
})
}
console
.
log
(
countData
)
this
.
afterChangeData
=
countData
this
.
questionParams
.
card
=
countData
data
.
sheet
.
answers
!==
null
&&
(
this
.
questionParams
.
answerRecord
=
data
.
sheet
.
answers
)
data
.
sheet
.
answers
!==
null
&&
(
this
.
questionParams
.
answerRecord
=
data
.
sheet
.
answers
)
this
.
$route
.
query
.
id
&&
this
.
$route
.
query
.
id
.
length
>
5
this
.
$route
.
query
.
id
&&
this
.
$route
.
query
.
id
.
length
>
5
?
this
.
analysisInit
()
?
this
.
analysisInit
()
...
@@ -219,6 +231,16 @@ export default {
...
@@ -219,6 +231,16 @@ export default {
.
finally
(()
=>
{
.
finally
(()
=>
{
})
})
},
},
// 计算错题总数
countErrNum
(
data
)
{
let
countNum
=
0
data
.
map
(
item
=>
{
item
.
map
(
cItem
=>
{
countNum
++
})
})
return
countNum
},
// 重组数据
// 重组数据
setData
(
data
)
{
setData
(
data
)
{
let
countNum
=
0
let
countNum
=
0
...
@@ -242,6 +264,7 @@ export default {
...
@@ -242,6 +264,7 @@ export default {
total_question_count
:
this
.
beforeChangeData
.
questions
.
total_question_count
,
total_question_count
:
this
.
beforeChangeData
.
questions
.
total_question_count
,
isCollection
:
cItem
.
isCollection
isCollection
:
cItem
.
isCollection
}
}
// 解析
if
(
this
.
$route
.
query
.
id
)
{
if
(
this
.
$route
.
query
.
id
)
{
if
(
this
.
$route
.
query
.
id
.
length
>
5
||
this
.
$route
.
query
.
id
===
'all'
||
this
.
$route
.
query
.
id
===
'err'
)
{
if
(
this
.
$route
.
query
.
id
.
length
>
5
||
this
.
$route
.
query
.
id
===
'all'
||
this
.
$route
.
query
.
id
===
'err'
)
{
const
qAnswer
=
Array
.
isArray
(
cItem
.
question_answer
)
?
cItem
.
question_answer
:
cItem
.
question_answer
=
[
cItem
.
question_answer
]
const
qAnswer
=
Array
.
isArray
(
cItem
.
question_answer
)
?
cItem
.
question_answer
:
cItem
.
question_answer
=
[
cItem
.
question_answer
]
...
@@ -255,13 +278,24 @@ export default {
...
@@ -255,13 +278,24 @@ export default {
data
.
question_answer
=
optGroup
data
.
question_answer
=
optGroup
}
}
}
}
// 案例题
if
(
parseInt
(
item
.
question_type
)
===
5
)
{
if
(
parseInt
(
item
.
question_type
)
===
5
)
{
data
.
common_content
=
cItem
.
common_content
data
.
common_content
=
cItem
.
common_content
data
.
group_id
=
cItem
.
group_id
data
.
group_id
=
cItem
.
group_id
data
.
list
=
this
.
mergeData
(
item
.
question_list
,
'group_id'
)
data
.
list
=
this
.
mergeData
(
item
.
question_list
,
'group_id'
)
data
.
answer_count
=
cItem
.
answer_count
data
.
answer_count
=
cItem
.
answer_count
}
}
return
data
// 错题
if
(
this
.
$route
.
query
.
id
===
'err'
)
{
const
isRight
=
this
.
beforeChangeData
.
score_items
[
data
.
question_item_id
][
data
.
id
].
is_right
if
(
!
isRight
)
{
return
data
}
else
{
countNum
--
}
}
else
{
return
data
}
})
})
})
})
},
},
...
@@ -331,6 +365,11 @@ export default {
...
@@ -331,6 +365,11 @@ export default {
.
finally
(()
=>
{
.
finally
(()
=>
{
})
})
}
}
},
filterData
(
data
)
{
return
this
.
setData
(
data
.
sheet
.
questions
.
question_items
).
map
(
item
=>
{
return
item
.
filter
(
is
=>
is
)
})
}
}
},
},
computed
:
{
computed
:
{
...
@@ -467,6 +506,8 @@ export default {
...
@@ -467,6 +506,8 @@ export default {
text-align
:
center
;
text-align
:
center
;
}
}
}
}
.sign-box
{
}
.sign
{
.sign
{
margin-right
:
20px
;
margin-right
:
20px
;
.icon
{
.icon
{
...
@@ -487,6 +528,26 @@ export default {
...
@@ -487,6 +528,26 @@ export default {
margin-top
:
2px
;
margin-top
:
2px
;
}
}
}
}
.sign2
{
margin-right
:
20px
;
.icon
{
margin
:
0
auto
;
width
:
24px
;
height
:
24px
;
background
:
url(@/assets/images/sign.png)
;
background-size
:
100%
100%
;
&
.active
{
background
:
url(@/assets/images/sign2.png)
;
background-size
:
100%
100%
;
}
}
.txt
{
font-size
:
14px
;
color
:
#CCCCCC
;
line-height
:
20px
;
margin-top
:
2px
;
}
}
}
}
}
}
}
}
...
...
src/pages/exam/testExam/exam/result.vue
浏览文件 @
bd0561e9
<
template
>
<
template
>
<div
class=
"result-box"
>
<div
class=
"result-box"
v-if=
"data.sheet"
>
<div
class=
"card-left"
>
<div
class=
"card-left"
>
<div
class=
"title"
>
成绩报告
</div>
<div
class=
"title"
>
成绩报告
</div>
<div
class=
"chart-box"
>
<div
class=
"chart-box"
>
<chart
:accuracy=
"accuracy"
:accuracScore=
"accuracScore"
v-if=
"data.sheet"
>
<chart
:accuracy=
"accuracy"
:accuracScore=
"accuracScore"
>
<template
v-slot:tips
>
<template
v-slot:tips
>
<div
class=
"num"
>
{{
accuracy
}}
%
</div>
<div
class=
"num"
>
{{
accuracy
}}
%
</div>
<div
class=
"t"
>
正确率
</div>
<div
class=
"t"
>
正确率
</div>
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<div
class=
"icon"
></div>
<div
class=
"icon"
></div>
</div>
</div>
<div
class=
"text"
>
{{ accuracy !== 100 ? '您离成功还有一段距离,继续努力!' : '成功近在眼前,再接再厉!' }}
</div>
<div
class=
"text"
>
{{ accuracy !== 100 ? '您离成功还有一段距离,继续努力!' : '成功近在眼前,再接再厉!' }}
</div>
<
div
class=
"btn"
>
全部考试服务
</div
>
<
!-- <div class="btn">全部考试服务</div> --
>
</div>
</div>
</div>
</div>
<div
class=
"card-right"
>
<div
class=
"card-right"
>
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<
template
v-slot:btnBox
>
<
template
v-slot:btnBox
>
<div
class=
"btn-box"
>
<div
class=
"btn-box"
>
<div
class=
"btn"
@
click=
"goPage('all')"
>
全部解析
</div>
<div
class=
"btn"
@
click=
"goPage('all')"
>
全部解析
</div>
<
!--
<div
class=
"btn"
@
click=
"goPage('err')"
>
错误解析
</div>
--
>
<
div
class=
"btn"
@
click=
"goPage('err')"
>
错误解析
</div
>
</div>
</div>
</
template
>
</
template
>
</card>
</card>
...
@@ -78,8 +78,8 @@ export default {
...
@@ -78,8 +78,8 @@ export default {
.
getExamQuestion
(
param
)
.
getExamQuestion
(
param
)
.
then
(
response
=>
{
.
then
(
response
=>
{
const
data
=
JSON
.
parse
(
response
.
data
)
const
data
=
JSON
.
parse
(
response
.
data
)
this
.
data
=
data
this
.
accuracy
=
parseInt
(
data
.
sheet
.
score
)
this
.
accuracy
=
parseInt
(
data
.
sheet
.
score
)
this
.
data
=
data
this
.
accuracScore
=
parseInt
(
data
.
sheet
.
questions
.
total_score
)
this
.
accuracScore
=
parseInt
(
data
.
sheet
.
questions
.
total_score
)
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论