Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
bc8d8a5f
提交
bc8d8a5f
authored
7月 14, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore:批改试卷修改
上级
a4e77cc0
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
307 行增加
和
113 行删除
+307
-113
menus.ts
src/assets/menus.ts
+1
-1
api.ts
src/modules/teach/exam/api.ts
+18
-18
PaperQuestion.vue
src/modules/teach/exam/components/PaperQuestion.vue
+23
-26
QuestionItem.vue
src/modules/teach/exam/components/QuestionItem.vue
+52
-52
View.vue
src/modules/teach/exam/views/View.vue
+213
-11
vite.config.ts
vite.config.ts
+0
-5
没有找到文件。
src/assets/menus.ts
浏览文件 @
bc8d8a5f
...
...
@@ -177,7 +177,7 @@ export const menus: IMenuItem[] = [
tag
:
'v1-backend-lecturer-list'
,
icon
:
DataAnalysis
,
name
:
'数据画像与分析'
,
path
:
'
/teach/exam
'
path
:
''
}
]
}
...
...
src/modules/teach/exam/api.ts
浏览文件 @
bc8d8a5f
...
...
@@ -5,21 +5,21 @@ export function getProList(params?: { type?: string; page?: number; page_size?:
return
httpRequest
.
get
(
'/api/psp/backend/video/index'
,
{
params
})
}
/**
* 获取试卷详情
*/
export
function
getPaperDetails
(
params
?:
{
exam_id
:
string
;
student_id
:
string
})
{
return
httpRequest
.
get
(
'/api/exam/v1/exam/sheet-detail'
,
{
params
})
}
/**
* 批改试卷
*/
export
function
submitPaper
(
data
?:
{
sheet_id
:
string
question_item_id
:
string
question_id
:
string
score
:
string
comment
:
string
})
{
return
httpRequest
.
post
(
'/api/exam/v1/exam/submit-sheet'
,
data
)
}
/
/ /
**
//
* 获取试卷详情
//
*/
//
export function getPaperDetails(params?: { exam_id: string; student_id: string }) {
//
return httpRequest.get('/api/exam/v1/exam/sheet-detail', { params })
//
}
/
/ /
**
//
* 批改试卷
//
*/
//
export function submitPaper(data?: {
//
sheet_id: string
//
question_item_id: string
//
question_id: string
//
score: string
//
comment: string
//
}) {
//
return httpRequest.post('/api/exam/v1/exam/submit-sheet', data)
//
}
src/modules/teach/exam/components/PaperQuestion.vue
浏览文件 @
bc8d8a5f
<
script
lang=
"ts"
setup
>
import
QuestionItem
from
'./QuestionItem.vue'
const
props
=
defineProps
({
options
:
{
type
:
Object
},
question_item_id
:
{
type
:
String
}
})
const
questionItem
=
computed
(()
=>
{
return
props
.
options
?.
item
})
const
sheet_id
=
computed
(()
=>
{
return
props
.
options
?.
sheet_id
})
const
questionType
=
computed
(()
=>
{
return
props
.
options
?.
item
.
question_item_type
})
</
script
>
<
template
>
<el-card
class=
"container"
>
<template
#
header
>
...
...
@@ -16,40 +37,16 @@
/>
</div>
</div>
<div
v-else
:key=
"item.id"
>
<QuestionItem
v-else
:question=
"
{ item, question_item_id, questionType, sheet_id }"
:question_item_id="question_item_id"
:key="item.id"
/>
</div>
</
template
>
</div>
</el-card>
</template>
<
script
lang=
"ts"
setup
>
import
QuestionItem
from
'./QuestionItem.vue'
const
props
=
defineProps
({
options
:
{
type
:
Object
,
default
()
{
return
{}
}
},
question_item_id
:
{
type
:
String
}
})
const
questionItem
=
computed
(()
=>
{
return
props
.
options
.
item
})
const
sheet_id
=
computed
(()
=>
{
return
props
.
options
.
sheet_id
})
const
questionType
=
computed
(()
=>
{
return
props
.
options
.
item
.
question_item_type
})
</
script
>
<
style
lang=
"scss"
scoped
>
.container
{
background
:
#fff
;
...
...
src/modules/teach/exam/components/QuestionItem.vue
浏览文件 @
bc8d8a5f
<
script
lang=
"ts"
setup
>
// import { ElMessage } from 'element-plus'
// import { submitPaper } from '../api.js'
const
bc
:
any
=
ref
(
null
)
const
showComment
=
ref
(
false
)
const
props
=
defineProps
({
question
:
{
type
:
Object
,
default
()
{
return
{}
}
},
question_item_id
:
{
type
:
String
}
})
const
questionData
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
question
.
item
))
const
questionType
=
computed
(()
=>
{
// 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景
const
type
=
questionData
.
type
||
props
.
question
.
questionType
||
1
return
parseInt
(
type
)
})
// const sheet_id = computed(() => {
// return props.question.sheet_id
// })
onUnmounted
(()
=>
{
bc
.
value
&&
bc
.
value
.
close
()
})
const
fetchComment
=
()
=>
{
console
.
log
(
'0000'
)
// const params: any = {
// sheet_id: sheet_id,
// question_item_id: props.question_item_id,
// question_id: questionData.value.id,
// score: questionData.value.get_score,
// comment: questionData.value.comment
// }
// submitPaper(params).then((res: any) => {
// if (res.success) {
// ElMessage.success('提交点评成功')
// } else {
// ElMessage.success('提交点评失败')
// }
// bc.value = new BroadcastChannel('exam')
// bc.value.postMessage({ action: 'refetch' })
// })
}
</
script
>
<
template
>
<div
class=
"question-item"
>
<div
class=
"question-item-title"
v-html=
"questionData.content"
></div>
...
...
@@ -17,6 +68,7 @@
</
template
>
<
template
v-if=
"questionType === 3"
>
<div
class=
"SAQ"
>
{{
questionData
.
user_answer
[
0
]
||
''
}}
</div>
-->
<div
style=
"text-align: right"
>
<el-button
type=
"primary"
...
...
@@ -58,59 +110,7 @@
<div
class=
"question-item-score"
>
得分:{{ questionData.get_score }}分
</div>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
{
ElMessage
}
from
'element-plus'
import
{
submitPaper
}
from
'../api.js'
const
bc
:
any
=
ref
(
null
)
const
questionData
:
any
=
ref
({})
const
showComment
=
ref
(
false
)
const
props
=
defineProps
({
question
:
{
type
:
Object
,
default
()
{
return
{}
}
},
question_item_id
:
{
type
:
String
}
})
const
questionType
=
computed
(()
=>
{
// 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景
const
type
=
questionData
.
value
.
type
||
props
.
question
.
questionType
||
1
return
parseInt
(
type
)
})
const
sheet_id
=
computed
(()
=>
{
return
props
.
question
.
sheet_id
})
onMounted
(()
=>
{
questionData
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
question
.
item
))
})
onUnmounted
(()
=>
{
bc
.
value
&&
bc
.
value
.
close
()
})
const
fetchComment
=
()
=>
{
const
params
:
any
=
{
sheet_id
:
sheet_id
,
question_item_id
:
props
.
question_item_id
,
question_id
:
questionData
.
value
.
id
,
score
:
questionData
.
value
.
get_score
,
comment
:
questionData
.
value
.
comment
}
submitPaper
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
success
)
{
ElMessage
.
success
(
'提交点评成功'
)
}
else
{
ElMessage
.
success
(
'提交点评失败'
)
}
bc
.
value
=
new
BroadcastChannel
(
'exam'
)
bc
.
value
.
postMessage
({
action
:
'refetch'
})
})
}
</
script
>
<
style
lang=
"scss"
scoped
>
.question-item
{
font-size
:
14px
;
...
...
src/modules/teach/exam/views/View.vue
浏览文件 @
bc8d8a5f
<
script
lang=
"ts"
setup
>
import
{
getPaperDetails
}
from
'../api.js'
//
import { getPaperDetails } from '../api.js'
import
PaperQuestion
from
'../components/PaperQuestion.vue'
const
route
=
useRoute
()
//
const route = useRoute()
const
questionData
:
any
=
ref
({})
const
questionList
:
any
=
ref
([])
const
eid
=
route
.
query
.
eid
as
string
const
sid
=
route
.
query
.
sid
as
string
//
const eid = route.query.eid as string
//
const sid = route.query.sid as string
onMounted
(()
=>
{
getDetail
()
})
// 获取试卷详情
const
getDetail
=
()
=>
{
const
params
:
any
=
{
exam_id
:
eid
,
student_id
:
sid
}
getPaperDetails
(
params
).
then
((
res
:
any
)
=>
{
questionData
.
value
=
res
.
data
.
sheet
// const params: any = { exam_id: eid, student_id: sid }
// getPaperDetails(params).then((res: any) => {
// questionData.value = res.data.sheet
// assembleData()
// })
questionData
.
value
=
{
sheet_id
:
'6953257027279781888'
,
student_id
:
'6953256575158976512'
,
exam_id
:
'6952903190949920768'
,
paper_id
:
'402839625706909696'
,
questions
:
{
paper_id
:
'402839625706909696'
,
total_question_count
:
7
,
total_score
:
100
,
question_items
:
[
{
question_item_id
:
'1'
,
question_item_title
:
'单选题'
,
question_item_type
:
'1'
,
question_list
:
[
{
id
:
'402782625878831104'
,
content
:
'<p>测试单选题1</p>'
,
options
:
'[{"option":"测试1","id":"6949923397711167488"},{"option":"侧事故2","id":"6949923397711167489"},{"option":"大神","id":"6949923397711167490"}]'
,
answer
:
'["6949923397711167488"]'
,
score
:
30
,
q_order
:
1
}
]
},
{
question_item_id
:
'2'
,
question_item_title
:
'多选题'
,
question_item_type
:
'2'
,
question_list
:
[
{
id
:
'402782856271941632'
,
content
:
'<p>多选题测试1</p>'
,
options
:
'[{"option":"大萨达","id":"6949923628104286208"},{"option":"大萨达as","id":"6949923628104286209"},{"option":"大叔大婶","id":"6949923628104286210"}]'
,
answer
:
'["6949923628104286208","6949923628104286209"]'
,
score
:
20
,
q_order
:
2
}
]
},
{
question_item_id
:
'3'
,
question_item_title
:
'问答题'
,
question_item_type
:
'3'
,
question_list
:
[
{
id
:
'402816813826957312'
,
content
:
'<p>防守打法是</p>'
,
options
:
'[]'
,
answer
:
'[]'
,
score
:
20
,
q_order
:
3
},
{
id
:
'402784072410382336'
,
content
:
'<p>问答题测试1问答题测试1</p>'
,
options
:
'[]'
,
answer
:
'[]'
,
score
:
10
,
q_order
:
4
}
]
},
{
question_item_id
:
'8'
,
question_item_title
:
'情景题'
,
question_item_type
:
'8'
,
question_list
:
[
{
common_content
:
'农行厦门江头支行所有员工都有一个专属二维码,随时随地可以掏出手机营销并实现按件计价,因为产品好、门槛低,营销成功率非常高。过去较长一段时间,厦门分行普惠业务发展徘徊滞后,2017年末,该行法人普惠贷款客户仅有157户。在2019年开展数字化转型以来,陆续上线“房抵e贷”“海关e贷”以及“纳税e贷”等三款线上融资产品,扭转了对公业务“空心化”的不利局面,普惠贷款客户数量已经超过6400户, 较2017年增长40多倍,贷款余额和户数增量、增幅连续两年保持当地四大行第一。'
,
group_id
:
'6923137023951765577'
,
list
:
[
{
id
:
'375996268660805632'
,
content
:
'情境中提到的“海关e贷”、“房抵e贷”和“纳税e贷”这三项线上业务融资产品用到了以下哪个营销策略?'
,
options
:
'[{"checked_option":"A","option":"高额定价策略","id":"6923137025579155456"},{"checked_option":"B","option":"渗透价策略","id":"6923137025579155457"},{"checked_option":"C","option":"产品线填补策略","id":"6923137025579155458"},{"checked_option":"D","option":"关系定价策略","id":"6923137025579155459"}]'
,
answer
:
'["6923137025579155458"]'
,
type
:
1
,
question_order
:
0
,
score
:
10
,
q_order
:
5
},
{
id
:
'375996268681777152'
,
content
:
'农行厦门江头支行对于潜在的客户进行了很有效率的市场细分,从题目中来看,该类客户属于?'
,
options
:
'[{"checked_option":"A","option":"人口细分","id":"6923137025604321280"},{"checked_option":"B","option":"地理细分","id":"6923137025604321281"},{"checked_option":"C","option":"行为细分","id":"6923137025604321282"},{"checked_option":"D","option":"公司细分","id":"6923137025604321283"}]'
,
answer
:
'["6923137025604321283"]'
,
type
:
1
,
question_order
:
1
,
score
:
5
,
q_order
:
6
},
{
id
:
'375996268702748672'
,
content
:
'农行厦门江头支行的每一位员工都有专属的二维码,从营销渠道来看,该二维码属于?'
,
options
:
'[{"checked_option":"A","option":"微博","id":"6923137025625292800"},{"checked_option":"B","option":"抖音","id":"6923137025625292801"},{"checked_option":"C","option":"公司二维码","id":"6923137025625292802"},{"checked_option":"D","option":"电子广告","id":"6923137025625292803"}]'
,
answer
:
'["6923137025625292802"]'
,
type
:
1
,
question_order
:
2
,
score
:
5
,
q_order
:
7
}
]
}
]
}
]
},
answers
:
{
'1'
:
{
'402782625878831104'
:
{
answer
:
[
'6949923397711167490'
],
sign
:
false
}
},
'2'
:
{
'402782856271941632'
:
{
answer
:
[
'6949923628104286209'
],
sign
:
false
}
},
'3'
:
{
'402816813826957312'
:
{
answer
:
[
'111'
],
sign
:
false
},
'402784072410382336'
:
{
answer
:
[
'2122313'
],
sign
:
false
}
},
'8'
:
{
'375996268660805632'
:
{
answer
:
[
'6923137025579155456'
],
sign
:
false
},
'375996268681777152'
:
{
answer
:
[
'6923137025604321280'
],
sign
:
false
},
'375996268702748672'
:
{
answer
:
[
'6923137025625292800'
],
sign
:
false
}
}
},
status
:
1
,
score
:
'0.00'
,
score_item
:
{
'1'
:
{
'402782625878831104'
:
{
score
:
0
,
checked_flag
:
true
}
},
'2'
:
{
'402782856271941632'
:
{
score
:
0
,
checked_flag
:
true
}
},
'3'
:
{
'402816813826957312'
:
{
score
:
0
,
checked_flag
:
false
},
'402784072410382336'
:
{
score
:
0
,
checked_flag
:
false
}
},
'8'
:
{
'375996268660805632'
:
{
score
:
0
,
checked_flag
:
true
},
'375996268681777152'
:
{
score
:
0
,
checked_flag
:
true
},
'375996268702748672'
:
{
score
:
0
,
checked_flag
:
true
}
}
},
commit_time
:
'2022-07-14 16:00:04'
,
checker_id
:
null
,
checked_time
:
'2022-07-14 16:01:00'
,
created_time
:
'2022-07-14 16:01:00'
,
updated_time
:
'2022-07-14 16:01:00'
,
status_text
:
'已提交'
}
assembleData
()
})
}
const
assembleData
=
()
=>
{
questionList
.
value
=
questionData
.
value
.
questions
.
question_items
console
.
log
(
questionData
.
value
,
'questionData.value'
)
console
.
log
(
questionList
.
value
,
' questionList.value'
)
questionList
.
value
.
forEach
((
item
:
any
)
=>
{
const
score
=
questionData
.
value
.
score_item
[
item
.
question_item_id
]
// 用户答案
const
answer
=
questionData
.
value
.
answers
?
questionData
.
value
.
answers
[
item
.
question_item_id
]
||
{}
:
{}
item
.
question_list
.
value
.
forEach
((
subItem
:
any
)
=>
{
item
.
question_list
.
forEach
((
subItem
:
any
)
=>
{
if
(
subItem
.
group_id
)
{
subItem
.
list
.
forEach
((
it
:
any
)
=>
{
const
obj
=
score
[
it
.
id
]
...
...
@@ -50,11 +252,11 @@ const assembleData = () => {
</
script
>
<
template
>
<div>
<template
v-for=
"item in questionList"
:key=
"item.question_item_id"
>
<paper-question
:options=
"
{ item, sheet_id: questionData.sheet_id, question_item_id: item.question_item_id }"
:question_item_id="item.question_item_id"
:key="item.question_item_id"
v-for="item in questionList"
/>
</
template
>
</div>
</
template
>
vite.config.ts
浏览文件 @
bc8d8a5f
...
...
@@ -31,12 +31,7 @@ export default defineConfig(({ mode }) => ({
changeOrigin
:
true
,
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
qbs/
,
''
)
},
'/api/exam'
:
{
target
:
'https://x-exam-admin-api.ezijing.com'
,
// target: 'http://localhost-exam-admin.ezijing.com',
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
exam/
,
''
)
},
'/api'
:
'https://resource-center.ezijing.com'
}
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论