Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
845c6c01
提交
845c6c01
authored
11月 03, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 修改成绩报告展示
上级
9c3bcef2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
155 行增加
和
36 行删除
+155
-36
result.vue
src/pages/exam/courseExam/chapter/result.vue
+71
-6
result.vue
src/pages/exam/testExam/exam/result.vue
+84
-30
没有找到文件。
src/pages/exam/courseExam/chapter/result.vue
浏览文件 @
845c6c01
...
...
@@ -8,11 +8,23 @@
</span>
</div>
<div
class=
"chart-box"
>
<chart
:accuracy=
"accuracy"
:accuracScore=
"accuracScore"
>
<
!--
<
chart
:accuracy=
"accuracy"
:accuracScore=
"accuracScore"
>
<template
v-slot:tips
>
<div
class=
"num"
>
{{
accuracText
}}
%
</div>
<div
class=
"t"
>
正确率
</div>
</
template
>
</chart>
-->
<chart
:accuracy=
"objectQuestionScore"
:accuracScore=
"objectQuestionTotal"
>
<
template
v-slot:tips
>
<div
class=
"num"
>
{{
objectQuestionScore
||
'-'
}}
分
</div>
<div
class=
"t"
>
客观题
</div>
</
template
>
</chart>
<chart
style=
"margin-left:60px;"
:accuracy=
"subjectQuestionScore"
:accuracScore=
"subjectQuestionTotal"
>
<
template
v-slot:tips
>
<div
class=
"num"
>
{{
subjectQuestionScore
||
'-'
}}
分
</div>
<div
class=
"t"
>
主观题
</div>
</
template
>
</chart>
</div>
<div
class=
"assess"
>
测试评估
</div>
...
...
@@ -23,9 +35,24 @@
</div>
<div
class=
"icon"
></div>
</div>
<div
class=
"text"
v-if=
"accuracText < 100"
>
<
!-- <
div class="text" v-if="accuracText < 100">
{{ accuracText < 80 ? '您离成功还有一段距离,继续努力!' : '成功近在眼前,再接再厉!' }}
</div> -->
<
template
v-if=
"subjectQuestionScore === 0"
>
<p
class=
"text"
>
请等待老师评分~
</p></
template
>
<
template
v-else
>
<p
class=
"text"
v-if=
"percent
<
0
.
8
"
>
您离成功还有一段距离,继续努力!
</p>
<div
v-else
class=
"chart-box"
>
<chart
:accuracy=
"subjectQuestionScore+objectQuestionScore"
:accuracScore=
"subjectQuestionTotal + objectQuestionTotal"
>
<template
v-slot:tips
>
<div
class=
"num"
>
{{
subjectQuestionScore
+
objectQuestionScore
||
'-'
}}
分
</div>
<div
class=
"t"
>
总分
</div>
</
template
>
</chart>
</div>
</template>
<!-- <div class="btn">全部考试服务</div> -->
</div>
</div>
...
...
@@ -55,7 +82,11 @@ export default {
data
:
{},
accuracy
:
0
,
accuracScore
:
0
,
accuracText
:
0
accuracText
:
0
,
subjectQuestionTotal
:
0
,
subjectQuestionScore
:
0
,
objectQuestionTotal
:
0
,
objectQuestionScore
:
0
}
},
created
()
{
...
...
@@ -65,8 +96,11 @@ export default {
examId
()
{
return
this
.
$route
.
query
.
exam_id
},
percent
()
{
return
(
this
.
subjectQuestionScore
+
this
.
objectQuestionScore
)
/
(
this
.
subjectQuestionTotal
+
this
.
objectQuestionTotal
)
},
setStyle
()
{
return
`width:
${
this
.
accuracTex
t
}
%`
return
`width:
${
100
*
this
.
percen
t
}
%`
}
},
methods
:
{
...
...
@@ -115,6 +149,35 @@ export default {
}
this
.
data
=
data
this
.
accuracScore
=
parseInt
(
totalNum
)
let
subjectQuestionTotal
=
0
let
subjectQuestionScore
=
0
let
objectQuestionTotal
=
0
let
objectQuestionScore
=
0
data
.
sheet
.
questions
.
question_items
.
forEach
(
item
=>
{
item
.
question_list
=
item
.
question_list
.
reduce
((
a
,
b
)
=>
{
return
a
.
concat
(
b
)
},
[])
const
currentQuestionScore
=
data
.
sheet
.
score_items
[
item
.
question_item_id
]
// console.log(item)
item
.
question_list
.
forEach
(
it
=>
{
const
currentItem
=
currentQuestionScore
[
it
.
id
]
if
(
Array
.
isArray
(
it
.
question_options
)
&&
it
.
question_options
.
length
)
{
if
(
currentItem
.
is_right
)
objectQuestionScore
+=
currentItem
.
score
objectQuestionTotal
+=
it
.
score
}
else
{
if
(
currentItem
.
is_right
)
subjectQuestionScore
+=
currentItem
.
score
subjectQuestionTotal
+=
it
.
score
}
})
})
this
.
subjectQuestionTotal
=
subjectQuestionTotal
this
.
subjectQuestionScore
=
subjectQuestionScore
console
.
log
(
subjectQuestionTotal
)
this
.
subjectQuestionScore
=
7
this
.
objectQuestionTotal
=
objectQuestionTotal
console
.
log
(
objectQuestionTotal
)
this
.
objectQuestionScore
=
objectQuestionScore
this
.
objectQuestionScore
=
29
})
}
}
...
...
@@ -147,8 +210,10 @@ export default {
margin-left
:
auto
;
}
.chart-box
{
width
:
148px
;
margin
:
26px
auto
0
;
// width: 148px;
margin
:
26px
0
0
;
display
:flex
;
justify-content
:center
;
}
.assess
{
font-size
:
18px
;
...
...
src/pages/exam/testExam/exam/result.vue
浏览文件 @
845c6c01
...
...
@@ -8,10 +8,16 @@
</span>
</div>
<div
class=
"chart-box"
>
<chart
:accuracy=
"
accuracy"
:accuracScore=
"accuracScore
"
>
<chart
:accuracy=
"
objectQuestionScore"
:accuracScore=
"objectQuestionTotal
"
>
<template
v-slot:tips
>
<div
class=
"num"
>
{{
accuracText
}}
%
</div>
<div
class=
"t"
>
正确率
</div>
<div
class=
"num"
>
{{
objectQuestionScore
||
'-'
}}
分
</div>
<div
class=
"t"
>
客观题
</div>
</
template
>
</chart>
<chart
style=
"margin-left:60px;"
:accuracy=
"subjectQuestionScore"
:accuracScore=
"subjectQuestionTotal"
>
<
template
v-slot:tips
>
<div
class=
"num"
>
{{
subjectQuestionScore
||
'-'
}}
分
</div>
<div
class=
"t"
>
主观题
</div>
</
template
>
</chart>
</div>
...
...
@@ -23,9 +29,21 @@
</div>
<div
class=
"icon"
></div>
</div>
<div
class=
"text"
v-if=
"accuracText < 100"
>
{{ accuracText
<
80
?
'您离成功还有一段距离,继续努力!'
:
'成功近在眼前,再接再厉!'
}}
<
template
v-if=
"subjectQuestionScore === 0"
>
<p
class=
"text"
>
请等待老师评分~
</p></
template
>
<
template
v-else
>
<p
class=
"text"
v-if=
"subjectQuestionScore+objectQuestionScore
<
80
"
>
您离成功还有一段距离,继续努力!
</p>
<div
v-else
class=
"chart-box"
>
<chart
:accuracy=
"subjectQuestionScore+objectQuestionScore"
:accuracScore=
"subjectQuestionTotal + objectQuestionTotal"
>
<template
v-slot:tips
>
<div
class=
"num"
>
{{
subjectQuestionScore
+
objectQuestionScore
||
'-'
}}
分
</div>
<div
class=
"t"
>
总分
</div>
</
template
>
</chart>
</div>
</template>
<!-- <div class="btn">全部考试服务</div> -->
</div>
</div>
...
...
@@ -55,7 +73,11 @@ export default {
data
:
{},
accuracy
:
0
,
accuracScore
:
0
,
accuracText
:
0
accuracText
:
0
,
subjectQuestionTotal
:
0
,
subjectQuestionScore
:
0
,
objectQuestionTotal
:
0
,
objectQuestionScore
:
0
}
},
created
()
{
...
...
@@ -65,8 +87,11 @@ export default {
examId
()
{
return
this
.
$route
.
query
.
exam_id
},
percent
()
{
return
(
this
.
subjectQuestionScore
+
this
.
objectQuestionScore
)
/
(
this
.
subjectQuestionTotal
+
this
.
objectQuestionTotal
)
},
setStyle
()
{
return
`width:
${
this
.
accuracTex
t
}
%`
return
`width:
${
100
*
this
.
percen
t
}
%`
}
},
methods
:
{
...
...
@@ -84,33 +109,60 @@ export default {
}
api
.
getExamQuestion
(
param
).
then
(
response
=>
{
const
data
=
JSON
.
parse
(
response
.
data
)
let
rightNum
=
0
let
totalNum
=
0
data
.
sheet
.
questions
.
question_items
.
forEach
(
list
=>
{
list
.
question_list
=
list
.
question_list
.
reduce
((
a
,
b
)
=>
{
// let rightNum = 0
// let totalNum = 0
// data.sheet.questions.question_items.forEach(list => {
// list.question_list = list.question_list.reduce((a, b) => {
// return a.concat(b)
// }, [])
// list.question_list.forEach(item => {
// const currentItem = data.sheet.score_items[list.question_item_id][item.id]
// if (currentItem.checked_flag) {
// totalNum++
// if (currentItem.is_right) rightNum++
// } else {
// if (item.question_options) {
// totalNum++
// if (currentItem.is_right) rightNum++
// }
// }
// })
// })
// this.accuracy = parseInt(rightNum)
// if (parseInt(rightNum) === 0 && parseInt(totalNum) === 0) {
// this.accuracText = '-'
// } else {
// this.accuracText = parseInt((rightNum / totalNum) * 100)
// }
this
.
data
=
data
// this.accuracScore = parseInt(totalNum)
let
subjectQuestionTotal
=
0
let
subjectQuestionScore
=
0
let
objectQuestionTotal
=
0
let
objectQuestionScore
=
0
data
.
sheet
.
questions
.
question_items
.
forEach
(
item
=>
{
item
.
question_list
=
item
.
question_list
.
reduce
((
a
,
b
)
=>
{
return
a
.
concat
(
b
)
},
[])
list
.
question_list
.
forEach
(
item
=>
{
const
currentItem
=
data
.
sheet
.
score_items
[
list
.
question_item_id
][
item
.
id
]
if
(
currentItem
.
checked_flag
)
{
totalNum
++
if
(
currentItem
.
is_right
)
rightNum
++
const
currentQuestionScore
=
data
.
sheet
.
score_items
[
item
.
question_item_id
]
// console.log(item)
item
.
question_list
.
forEach
(
it
=>
{
const
currentItem
=
currentQuestionScore
[
it
.
id
]
if
(
Array
.
isArray
(
it
.
question_options
)
&&
it
.
question_options
.
length
)
{
if
(
currentItem
.
is_right
)
objectQuestionScore
+=
currentItem
.
score
objectQuestionTotal
+=
it
.
score
}
else
{
if
(
item
.
question_options
)
{
totalNum
++
if
(
currentItem
.
is_right
)
rightNum
++
}
if
(
currentItem
.
is_right
)
subjectQuestionScore
+=
currentItem
.
score
subjectQuestionTotal
+=
it
.
score
}
})
})
this
.
accuracy
=
parseInt
(
rightNum
)
if
(
parseInt
(
rightNum
)
===
0
&&
parseInt
(
totalNum
)
===
0
)
{
this
.
accuracText
=
'-'
}
else
{
this
.
accuracText
=
parseInt
((
rightNum
/
totalNum
)
*
100
)
}
this
.
data
=
data
this
.
accuracScore
=
parseInt
(
totalNum
)
this
.
subjectQuestionTotal
=
subjectQuestionTotal
this
.
subjectQuestionScore
=
subjectQuestionScore
// this.subjectQuestionScore = 20
this
.
objectQuestionTotal
=
objectQuestionTotal
this
.
objectQuestionScore
=
objectQuestionScore
// this.objectQuestionScore = 65
})
}
}
...
...
@@ -143,8 +195,10 @@ export default {
margin-left
:
auto
;
}
.chart-box
{
width
:
148px
;
margin
:
26px
auto
0
;
// width: 148px;
margin
:
26px
0
0
;
display
:flex
;
justify-content
:center
;
}
.assess
{
font-size
:
18px
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论