Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
fbc58e60
提交
fbc58e60
authored
10月 21, 2021
作者:
lihuihui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://gitlab.ezijing.com/ezijing/x-learn
上级
91ea0111
624134c5
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
50 行增加
和
89 行删除
+50
-89
examCard.vue
src/components/exam/examCard.vue
+3
-2
questionListItem.vue
src/components/exam/questionListItem.vue
+3
-0
index.vue
src/pages/exam/testExam/index.vue
+9
-6
review.vue
src/pages/teacher/examReview/review.vue
+35
-81
没有找到文件。
src/components/exam/examCard.vue
浏览文件 @
fbc58e60
...
@@ -244,7 +244,7 @@ export default {
...
@@ -244,7 +244,7 @@ export default {
}
}
const
isSubmited
=
[
'1'
,
'2'
].
includes
(
data
.
status
)
const
isSubmited
=
[
'1'
,
'2'
].
includes
(
data
.
status
)
this
.
disabled
=
isSubmited
this
.
disabled
=
isSubmited
this
.
hasResult
=
isSubmited
this
.
hasResult
=
isSubmited
&&
this
.
status
!==
3
this
.
genQuestions
(
data
)
this
.
genQuestions
(
data
)
this
.
currentGroupCount
=
this
.
questionGroups
.
length
this
.
currentGroupCount
=
this
.
questionGroups
.
length
if
(
this
.
$route
.
query
.
id
)
{
if
(
this
.
$route
.
query
.
id
)
{
...
@@ -284,6 +284,7 @@ export default {
...
@@ -284,6 +284,7 @@ export default {
if
(
bigQuestionScore
)
{
if
(
bigQuestionScore
)
{
// 小题分数
// 小题分数
scoreItem
=
bigQuestionScore
[
item
.
id
]
||
{}
scoreItem
=
bigQuestionScore
[
item
.
id
]
||
{}
scoreItem
.
user_score
=
scoreItem
.
score
if
(
userAnswers
.
length
)
{
if
(
userAnswers
.
length
)
{
scoreItem
.
answer
=
scoreItem
.
is_right
?
1
:
2
scoreItem
.
answer
=
scoreItem
.
is_right
?
1
:
2
}
else
{
}
else
{
...
@@ -291,7 +292,7 @@ export default {
...
@@ -291,7 +292,7 @@ export default {
}
}
}
}
}
}
return
{
...
scoreItem
,
...
item
,
user_answer
:
userAnswers
,
sign
}
return
{
...
{
comment_visible
:
false
},
...
scoreItem
,
...
item
,
user_answer
:
userAnswers
,
sign
}
})
})
result
.
push
(
Object
.
assign
({},
question
,
{
question_list
:
list
}))
result
.
push
(
Object
.
assign
({},
question
,
{
question_list
:
list
}))
})
})
...
...
src/components/exam/questionListItem.vue
浏览文件 @
fbc58e60
...
@@ -83,6 +83,9 @@ export default {
...
@@ -83,6 +83,9 @@ export default {
const
questionType
=
parseInt
(
this
.
question
.
question_type
)
const
questionType
=
parseInt
(
this
.
question
.
question_type
)
const
{
answer_count
:
answerCount
=
0
}
=
this
.
data
const
{
answer_count
:
answerCount
=
0
}
=
this
.
data
if
([
5
,
7
,
8
].
includes
(
questionType
))
{
if
([
5
,
7
,
8
].
includes
(
questionType
))
{
if
(
answerCount
>=
2
)
{
return
2
}
return
answerCount
||
3
return
answerCount
||
3
}
else
{
}
else
{
return
questionType
return
questionType
...
...
src/pages/exam/testExam/index.vue
浏览文件 @
fbc58e60
<
template
>
<
template
>
<app-container
title=
"模拟考试"
>
<app-container
title=
"模拟考试"
>
<
ul
class=
"exam-list"
>
<
div
class=
"exam-list"
>
<
li
v-for=
"item in examList"
:key=
"item.id"
class=
"exam-item"
@
click=
"startExam(item)
"
>
<
template
v-for=
"item in examList
"
>
<el-card
shadow=
"hover"
>
<el-card
shadow=
"hover"
class=
"exam-item"
:key=
"item.id"
@
click
.
native=
"startExam(item)"
>
<h3>
{{
item
.
paper_title
}}
</h3>
<h3>
{{
item
.
paper_title
}}
</h3>
<p
v-if=
"[1, 2].includes(item.status)"
>
已完成
</p>
<p
v-if=
"[1, 2].includes(item.status)"
>
已完成
</p>
<p
v-if=
"[0, 3].includes(item.status)"
>
待完成
</p>
<p
v-if=
"[0, 3].includes(item.status)"
>
待完成
</p>
<!--
<p>
重新考试
</p>
-->
<!--
<p>
重新考试
</p>
-->
</el-card>
</el-card>
</
li
>
</
template
>
</
ul
>
</
div
>
<!-- <template #footer>
<!-- <template #footer>
<div class="app-container-ft"><el-button type="primary" @click="getExamStatus">开始考试</el-button></div>
<div class="app-container-ft"><el-button type="primary" @click="getExamStatus">开始考试</el-button></div>
</template> -->
</template> -->
...
@@ -69,8 +69,11 @@ export default {
...
@@ -69,8 +69,11 @@ export default {
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.exam-list
{
display
:
flex
;
flex-wrap
:
wrap
;
}
.exam-item
{
.exam-item
{
display
:
inline-block
;
width
:
300px
;
width
:
300px
;
margin
:
0
20px
20px
0
;
margin
:
0
20px
20px
0
;
text-align
:
center
;
text-align
:
center
;
...
...
src/pages/teacher/examReview/review.vue
浏览文件 @
fbc58e60
...
@@ -8,42 +8,47 @@
...
@@ -8,42 +8,47 @@
:hasCollect=
"false"
:hasCollect=
"false"
:hasMark=
"false"
:hasMark=
"false"
:data=
"data"
:data=
"data"
:disabled=
"false"
@
submit=
"submitExam"
@
back=
"handleBack"
@
back=
"handleBack"
@
page-change=
"handlePageChange"
ref=
"exam"
ref=
"exam"
v-if=
"Object.keys(data).length"
v-if=
"Object.keys(data).length"
>
>
<template
v-slot:question-item=
"
{ item, data }">
<template
v-slot:question-item=
"
{ item, data }">
<div
ref=
"reviewCards"
:scorenum=
"item.score"
:questionid=
"item.id"
:itemid=
"data.question_item_id"
></div>
<div
class=
"review-box"
>
<div
class=
"review-box"
>
<div
class=
"review-btn"
>
<div
class=
"review-btn"
>
<el-button
type=
"primary"
@
click=
"visible = true"
>
点评
</el-button>
<el-button
type=
"primary"
@
click=
"
item.comment_
visible = true"
>
点评
</el-button>
</div>
</div>
<div
class=
"review-card"
v-if=
"
visible
"
>
<div
class=
"review-card"
v-if=
"
item.comment_visible || item.checked_flag
"
>
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
<div
slot=
"header"
class=
"clearfix"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
本题
{{
item
.
score
}}
分
</span>
<span>
本题
{{
item
.
score
}}
分
</span>
<div
class=
"score"
>
<div
class=
"score"
>
<span>
学生得分:
</span>
<span>
学生得分:
</span>
<input
type=
"number"
:disabled=
"isReviewFlag"
v-model=
"scoreNum"
placeholder=
"请输入分数"
/>
<el-input
type=
"number"
:disabled=
"item.checked_flag"
v-model=
"item.user_score"
placeholder=
"请输入分数"
size=
"mini"
style=
"width:80px"
></el-input>
</div>
</div>
</div>
</div>
<div
class=
"textarea"
>
<div
class=
"textarea"
>
<el-input
<el-input
:disabled=
"i
sReviewF
lag"
:disabled=
"i
tem.checked_f
lag"
type=
"textarea"
type=
"textarea"
:rows=
"5"
:rows=
"5"
placeholder=
"请输入本题点评"
placeholder=
"请输入本题点评"
max=
"2"
max=
"2"
resize=
"none"
resize=
"none"
v-model=
"
textarea
"
v-model=
"
item.comment
"
>
>
</el-input>
</el-input>
</div>
</div>
<div
class=
"submit-btn"
>
<div
class=
"submit-btn"
>
<el-button
type=
"primary"
@
click=
"submitExam"
v-if=
"!isReviewFlag"
>
提交点评
</el-button>
<el-button
type=
"primary"
@
click=
"submitComment(item, data)"
v-if=
"!item.checked_flag"
>
提交点评
</el-button>
</div>
</div>
</el-card>
</el-card>
</div>
</div>
...
@@ -79,29 +84,14 @@ export default {
...
@@ -79,29 +84,14 @@ export default {
components
:
{
ExamCard
},
components
:
{
ExamCard
},
data
()
{
data
()
{
return
{
return
{
scoreNum
:
''
,
data
:
{},
textarea
:
''
,
data
:
{
cacheAnswerTime
:
null
// 缓存题计时器
},
isReviewFlag
:
false
,
visible
:
false
,
selectValue
:
0
,
selectValue
:
0
,
studentList
:
[],
studentList
:
[],
sheetIds
:
0
,
sheetIds
:
''
,
options
:
[
options
:
[
{
{
value
:
0
,
label
:
'全部'
},
value
:
0
,
{
value
:
1
,
label
:
'未批阅'
},
label
:
'全部'
{
value
:
2
,
label
:
'已批阅'
}
},
{
value
:
1
,
label
:
'未批阅'
},
{
value
:
2
,
label
:
'已批阅'
}
]
]
}
}
},
},
...
@@ -116,17 +106,12 @@ export default {
...
@@ -116,17 +106,12 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
studentList
=
JSON
.
parse
(
window
.
localStorage
.
examStudentsList
)
this
.
studentList
=
JSON
.
parse
(
window
.
localStorage
.
examStudentsList
)
setTimeout
(()
=>
{
this
.
handlePageChange
()
},
1000
)
},
beforeDestroy
()
{
clearInterval
(
this
.
cacheAnswerTime
)
// 停止缓存
},
},
methods
:
{
methods
:
{
selectStudent
(
item
)
{
selectStudent
(
item
)
{
this
.
sheetIds
=
item
.
sheet_id
this
.
sheetIds
=
item
.
sheet_id
this
.
getTopic
(
item
.
sheet_id
)
this
.
getTopic
(
item
.
sheet_id
)
this
.
$refs
.
exam
.
reset
()
},
},
change
()
{
change
()
{
this
.
studentList
=
JSON
.
parse
(
window
.
localStorage
.
examStudentsList
)
this
.
studentList
=
JSON
.
parse
(
window
.
localStorage
.
examStudentsList
)
...
@@ -145,61 +130,36 @@ export default {
...
@@ -145,61 +130,36 @@ export default {
this
.
$router
.
push
(
'/teacher/exam'
)
this
.
$router
.
push
(
'/teacher/exam'
)
},
},
// 提交批阅
// 提交批阅
submit
Exam
(
)
{
submit
Comment
(
item
,
data
)
{
const
refReview
=
this
.
$refs
.
reviewCards
if
(
item
.
comment
===
''
)
{
if
(
!
refReview
)
{
this
.
$message
(
'请输入点评内容'
)
return
false
return
false
}
}
if
(
this
.
textarea
===
''
||
this
.
scoreNum
===
''
)
{
if
(
item
.
user_score
===
''
)
{
this
.
$message
(
'请
填写
'
)
this
.
$message
(
'请
输入分数
'
)
return
false
return
false
}
}
if
(
parseInt
(
this
.
scoreNum
)
>
parseInt
(
refReview
.
getAttribute
(
'scorenum'
))
)
{
if
(
parseInt
(
item
.
user_score
)
>
item
.
score
)
{
this
.
$message
(
'请填写正确分值'
)
this
.
$message
(
'请填写正确分值'
)
return
false
return
false
}
}
const
param
=
{
const
param
=
{
sheet_id
:
this
.
$route
.
query
.
sheet_id
,
sheet_id
:
this
.
$route
.
query
.
sheet_id
,
question_item_id
:
refReview
.
getAttribute
(
'itemid'
)
,
question_item_id
:
data
.
question_item_id
,
question_id
:
refReview
.
getAttribute
(
'questionid'
)
,
question_id
:
item
.
id
,
comment
:
this
.
textarea
,
comment
:
item
.
comment
,
score
:
this
.
scoreNum
score
:
item
.
user_score
}
}
this
.
$confirm
(
'确认评价后将不得再次修改'
,
'请确认'
,
{
this
.
$confirm
(
'确认评价后将不得再次修改'
,
'请确认'
,
{
confirmButtonText
:
'点评'
,
confirmButtonText
:
'点评'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
})
}).
then
(()
=>
{
.
then
(()
=>
{
api
.
submitReviewDetails
(
param
).
then
(
response
=>
{
api
.
submitReviewDetails
(
param
).
then
(
response
=>
{
this
.
isReviewF
lag
=
true
item
.
checked_f
lag
=
true
this
.
$message
(
'批阅成功'
)
this
.
$message
(
'批阅成功'
)
})
})
})
})
.
catch
(()
=>
{})
},
handlePageChange
(
index
,
group
,
groupList
)
{
setTimeout
(()
=>
{
const
refReview
=
this
.
$refs
.
reviewCards
if
(
!
refReview
)
{
return
false
}
const
itemId
=
refReview
.
getAttribute
(
'itemid'
)
const
questionId
=
refReview
.
getAttribute
(
'questionid'
)
this
.
visible
=
false
const
isReview
=
this
.
data
.
score_items
[
itemId
][
questionId
]
if
(
isReview
.
checked_flag
)
{
this
.
scoreNum
=
isReview
.
score
this
.
textarea
=
isReview
.
comment
this
.
isReviewFlag
=
true
this
.
visible
=
true
}
else
{
this
.
scoreNum
=
''
this
.
textarea
=
''
this
.
isReviewFlag
=
false
this
.
visible
=
false
}
},
500
)
}
}
}
}
}
}
...
@@ -213,20 +173,14 @@ export default {
...
@@ -213,20 +173,14 @@ export default {
.score
{
.score
{
float
:
right
;
float
:
right
;
display
:
flex
;
display
:
flex
;
input
{
align-items
:
center
;
width
:
90px
;
height
:
100%
;
outline
:
none
;
}
}
}
.submit-btn
{
.submit-btn
{
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
padding-top
:
20px
;
padding-top
:
20px
;
}
}
.review-box
{
// max-width: 500px;
}
.stu-list
{
.stu-list
{
.title
{
.title
{
// text-align: center;
// text-align: center;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论