Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
d1673c75
提交
d1673c75
authored
8月 02, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
批改试卷接口对接
上级
39721f96
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
99 行增加
和
98 行删除
+99
-98
api.ts
src/modules/teach/exam/api.ts
+2
-2
PaperQuestion.vue
src/modules/teach/exam/components/PaperQuestion.vue
+0
-61
QuestionItem.vue
src/modules/teach/exam/components/QuestionItem.vue
+34
-19
type.ts
src/modules/teach/exam/type.ts
+4
-1
StudentList.vue
src/modules/teach/exam/views/StudentList.vue
+1
-0
View.vue
src/modules/teach/exam/views/View.vue
+58
-15
没有找到文件。
src/modules/teach/exam/api.ts
浏览文件 @
d1673c75
...
@@ -25,14 +25,14 @@ export function getPaperStuDetail(params?: { id: string }) {
...
@@ -25,14 +25,14 @@ export function getPaperStuDetail(params?: { id: string }) {
return
httpRequest
.
get
(
'/api/resource/v1/teaching/paper/view'
,
{
params
})
return
httpRequest
.
get
(
'/api/resource/v1/teaching/paper/view'
,
{
params
})
}
}
// 评分
// 评分
export
function
updateComment
(
params
?
:
{
export
function
updateComment
(
data
:
{
id
:
string
id
:
string
index
:
string
index
:
string
child_index
?:
string
child_index
?:
string
user_score
:
string
user_score
:
string
reviews
:
string
reviews
:
string
})
{
})
{
return
httpRequest
.
get
(
'/api/resource/v1/teaching/paper/update '
,
{
params
}
)
return
httpRequest
.
post
(
'/api/resource/v1/teaching/paper/update '
,
data
)
}
}
// /**
// /**
// * 获取试卷详情
// * 获取试卷详情
...
...
src/modules/teach/exam/components/PaperQuestion.vue
deleted
100644 → 0
浏览文件 @
39721f96
<
script
lang=
"ts"
setup
>
import
type
{
IQuestionList
}
from
'../type'
import
QuestionItem
from
'./QuestionItem.vue'
interface
Props
{
everyQuestion
:
any
questionList
:
IQuestionList
[]
}
const
props
=
defineProps
<
Props
>
()
</
script
>
<
template
>
<el-card
class=
"container"
>
<template
#
header
>
<span>
{{
everyQuestion
?.
question_content
}}
</span>
</
template
>
<div
class=
"content"
>
<
template
v-for=
"item in props.questionList"
>
<div
class=
"sub-content"
v-if=
"item?.children"
:key=
"item.id"
>
<div
class=
"title"
v-html=
"item.common_content"
></div>
<div
class=
"sub-container"
>
<QuestionItem
v-for=
"subItem in item.children"
:key=
"subItem.id"
:question=
"subItem"
/>
</div>
</div>
<div
v-else
:key=
"item.id"
>
<QuestionItem
:question=
"item"
/>
</div>
</
template
>
</div>
</el-card>
</template>
<
style
lang=
"scss"
scoped
>
.container
{
background
:
#fff
;
border
:
1px
solid
#f3f3f3
;
margin-bottom
:
20px
;
border-radius
:
6px
;
::v-deep
.el-card__body
{
padding
:
10px
20px
;
}
.content
{
// border:1px solid #f3f3f3;
padding
:
10px
;
.title
{
line-height
:
40px
;
font-size
:
16px
;
}
.sub-container
{
border
:
1px
solid
#e3e3e3
;
padding
:
15px
15px
0
;
border-radius
:
4px
;
}
.sub-content
{
margin-bottom
:
20px
;
}
.question-item
:last-child
{
border
:
none
;
}
}
}
</
style
>
src/modules/teach/exam/components/QuestionItem.vue
浏览文件 @
d1673c75
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ElMessage
}
from
'element-plus'
import
{
updateComment
}
from
'../api'
import
{
updateComment
}
from
'../api'
const
showComment
=
ref
(
false
)
const
showComment
=
ref
(
false
)
const
props
=
defineProps
({
const
props
=
defineProps
({
...
@@ -8,30 +10,43 @@ const props = defineProps({
...
@@ -8,30 +10,43 @@ const props = defineProps({
return
{}
return
{}
}
}
},
},
question_item_id
:
{
currentIndex
:
{
type
:
Number
},
childIndex
:
{
type
:
Number
},
// 试卷id
questionId
:
{
type
:
String
type
:
String
}
}
})
})
const
questionData
=
Object
.
assign
({},
props
.
question
)
const
reviews
=
ref
(
''
)
let
questionData
:
any
=
$ref
({})
questionData
=
Object
.
assign
({},
props
.
question
)
const
questionType
=
computed
(()
=>
{
const
questionType
=
computed
(()
=>
{
// 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景
// 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景
if
(
props
.
question
.
child_question_type
)
{
console
.
log
(
props
.
question
.
child_question_type
,
props
.
question
.
child_question_type
)
if
(
props
.
question
.
child_question_type
!==
0
)
{
return
parseInt
(
props
.
question
.
child_question_type
)
return
parseInt
(
props
.
question
.
child_question_type
)
}
else
{
}
else
{
return
parseInt
(
props
.
question
.
question
T
ype
)
return
parseInt
(
props
.
question
.
question
_t
ype
)
}
}
})
})
const
fetchComment
=
()
=>
{
const
fetchComment
=
()
=>
{
const
params
=
{
const
params
:
any
=
{
id
:
''
,
id
:
props
.
questionId
,
index
:
''
,
index
:
props
.
currentIndex
,
child_index
:
''
,
child_index
:
props
.
childIndex
,
user_score
:
''
,
user_score
:
questionData
.
user_score
,
reviews
:
''
reviews
:
reviews
.
value
}
}
updateComment
(
params
).
then
(()
=>
{
updateComment
(
params
).
then
(()
=>
{
console
.
log
(
'000'
)
ElMessage
.
success
(
'点评成功'
)
questionData
.
is_reviewed
=
true
})
})
}
}
</
script
>
</
script
>
...
@@ -40,7 +55,7 @@ const fetchComment = () => {
...
@@ -40,7 +55,7 @@ const fetchComment = () => {
<div
class=
"question-item-title"
v-html=
"props.question.question_content"
></div>
<div
class=
"question-item-title"
v-html=
"props.question.question_content"
></div>
<template
v-if=
"questionType === 1 || questionType === 6"
>
<template
v-if=
"questionType === 1 || questionType === 6"
>
<el-radio-group
v-model=
"questionData.user_answer"
:disabled=
"true"
class=
"question-item-content"
>
<el-radio-group
v-model=
"questionData.user_answer"
:disabled=
"true"
class=
"question-item-content"
>
<div
class=
"question-item-option"
v-for=
"subItem in
props.question
.question_options"
:key=
"subItem.id"
>
<div
class=
"question-item-option"
v-for=
"subItem in
questionData
.question_options"
:key=
"subItem.id"
>
<el-radio
:label=
"subItem.id"
>
{{
subItem
.
option
}}
</el-radio>
<el-radio
:label=
"subItem.id"
>
{{
subItem
.
option
}}
</el-radio>
</div>
</div>
</el-radio-group>
</el-radio-group>
...
@@ -60,7 +75,7 @@ const fetchComment = () => {
...
@@ -60,7 +75,7 @@ const fetchComment = () => {
size=
"small"
size=
"small"
plain
plain
@
click=
"showComment = !showComment"
@
click=
"showComment = !showComment"
v-
permission=
"'admin_exam_exam_submit_sheet'
"
v-
if=
"props.question.is_reviewed !== true
"
>
点击评分
</el-button
>
点击评分
</el-button
>
>
</div>
</div>
...
@@ -69,11 +84,11 @@ const fetchComment = () => {
...
@@ -69,11 +84,11 @@ const fetchComment = () => {
<p>
本题
{{
props
.
question
.
score
}}
分
</p>
<p>
本题
{{
props
.
question
.
score
}}
分
</p>
<div
class=
"get-score"
>
<div
class=
"get-score"
>
学生得分:
<el-input-number
学生得分:
<el-input-number
:disabled=
"questionData.
checked_flag
"
:disabled=
"questionData.
is_reviewed
"
v-model=
"questionData.user_score"
v-model=
"questionData.user_score"
controls-position=
"right"
controls-position=
"right"
:min=
"0"
:min=
"0"
:max=
"
props.question
.score"
:max=
"
questionData
.score"
size=
"small"
size=
"small"
></el-input-number>
></el-input-number>
</div>
</div>
...
@@ -81,18 +96,18 @@ const fetchComment = () => {
...
@@ -81,18 +96,18 @@ const fetchComment = () => {
<el-input
<el-input
type=
"textarea"
type=
"textarea"
placeholder=
"请输入评语"
placeholder=
"请输入评语"
v-model=
"
questionData.
reviews"
v-model=
"reviews"
rows=
"3"
rows=
"3"
:disabled=
"questionData.
checked_flag
"
:disabled=
"questionData.
is_reviewed
"
/>
/>
<div
style=
"text-align: center; padding-top: 10px"
>
<div
style=
"text-align: center; padding-top: 10px"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"fetchComment"
:disabled=
"
props.question.checked_flag
"
<el-button
type=
"primary"
size=
"small"
@
click=
"fetchComment"
:disabled=
"
questionData.is_reviewed
"
>
提交点评
</el-button
>
提交点评
</el-button
>
>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<div
class=
"question-item-score"
>
得分:{{
props.question
.user_score }}分
</div>
<div
class=
"question-item-score"
>
得分:{{
questionData
.user_score }}分
</div>
</div>
</div>
</template>
</template>
...
...
src/modules/teach/exam/type.ts
浏览文件 @
d1673c75
interface
IQuestionptions
{
interface
IQuestionptions
{
option
:
string
option
:
string
checked_option
:
string
checked_option
:
string
checked
:
boolean
checked
:
boolean
...
@@ -24,5 +24,8 @@ export interface IQuestionList {
...
@@ -24,5 +24,8 @@ export interface IQuestionList {
is_parent
:
number
is_parent
:
number
child_question_type
:
number
child_question_type
:
number
score
:
number
score
:
number
user_answer
:
any
user_answer_status
:
boolean
user_score
:
number
children
?:
IQuestionList
[]
children
?:
IQuestionList
[]
}
}
src/modules/teach/exam/views/StudentList.vue
浏览文件 @
d1673c75
...
@@ -67,6 +67,7 @@ const listOptions = $computed(() => {
...
@@ -67,6 +67,7 @@ const listOptions = $computed(() => {
const
handleCheckPaper
=
(
row
:
any
)
=>
{
const
handleCheckPaper
=
(
row
:
any
)
=>
{
router
.
push
({
path
:
'/teach/view'
,
query
:
{
id
:
row
.
id
}
})
router
.
push
({
path
:
'/teach/view'
,
query
:
{
id
:
row
.
id
}
})
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
checkPermission
(
'v1-teaching-paper-search-list'
)
&&
handleGetClassList
()
checkPermission
(
'v1-teaching-paper-search-list'
)
&&
handleGetClassList
()
})
})
...
...
src/modules/teach/exam/views/View.vue
浏览文件 @
d1673c75
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
type
{
IQuestionList
}
from
'../type'
import
type
{
IQuestionList
}
from
'../type'
import
{
getPaperStuDetail
}
from
'../api'
import
{
getPaperStuDetail
}
from
'../api'
import
PaperQuestion
from
'../components/PaperQuestion.vue'
import
QuestionItem
from
'../components/QuestionItem.vue'
const
route
=
useRoute
()
const
route
=
useRoute
()
const
questionList
:
any
=
ref
<
IQuestionList
[]
>
([])
const
questionList
:
any
=
ref
<
IQuestionList
[]
>
([])
const
questionData
:
any
=
ref
({})
const
questionData
:
any
=
ref
({})
const
paper_id
=
route
.
query
.
id
as
string
// 获取试卷详情
// 获取试卷详情
getPaperStuDetail
({
id
:
route
.
query
.
id
as
string
}).
then
(
res
=>
{
getPaperStuDetail
({
id
:
paper_id
}).
then
(
res
=>
{
questionData
.
value
=
res
.
data
questionData
.
value
=
res
.
data
questionList
.
value
=
questionData
.
value
.
score_details
questionList
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
questionData
.
value
.
score_details
))
questionList
.
value
.
forEach
((
item
:
any
)
=>
{
questionList
.
value
.
map
((
item
:
any
)
=>
{
if
(
item
.
children
)
{
if
(
item
.
user_answer
.
indexOf
(
','
)
!==
-
1
)
{
item
.
user_answer
=
[
item
.
user_answer
].
forEach
(
it
=>
item
.
question_options
[
it
.
id
])
item
.
user_answer
=
item
.
user_answer
.
split
(
','
)
}
else
{
item
.
user_answer
=
item
.
question_options
[
item
.
id
]
}
}
return
item
})
})
})
})
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<el-card
class=
"container"
>
<paper-question
<div
class=
"content"
>
:everyQuestion=
"item"
<template
v-for=
"(item, index) in questionList"
:key=
"index"
>
:key=
"item.question_item_id"
<div
class=
"sub-content"
v-if=
"item?.children && item?.children.length > 0"
>
:questionList=
"questionList"
<div
class=
"title"
v-html=
"item.common_content"
></div>
v-for=
"item in questionList"
<div
class=
"sub-container"
>
<QuestionItem
v-for=
"(subItem, itemIndex) in item.children"
:key=
"subItem.id"
:question=
"subItem"
:currentIndex=
"index"
:childIndex=
"itemIndex"
:questionId=
"paper_id"
/>
/>
</div>
</div>
</div>
<div
v-else
>
<QuestionItem
:question=
"item"
:currentIndex=
"index"
:questionId=
"paper_id"
/>
</div>
</
template
>
</div>
</el-card>
</template>
</template>
<
style
lang=
"scss"
scoped
>
.container
{
background
:
#fff
;
border
:
1px
solid
#f3f3f3
;
margin-bottom
:
20px
;
border-radius
:
6px
;
::v-deep
.el-card__body
{
padding
:
10px
20px
;
}
.content
{
// border:1px solid #f3f3f3;
padding
:
10px
;
.title
{
line-height
:
40px
;
font-size
:
16px
;
}
.sub-container
{
border
:
1px
solid
#e3e3e3
;
padding
:
15px
15px
0
;
border-radius
:
4px
;
}
.sub-content
{
margin-bottom
:
20px
;
}
.question-item
:last-child
{
border
:
none
;
}
}
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论