Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
7959c587
提交
7959c587
authored
4月 24, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
未作答报错问题修改
上级
34690d24
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
54 行增加
和
316 行删除
+54
-316
PaperQuestion.vue
src/modules/exam/components/PaperQuestion.vue
+34
-24
QuestionItem.vue
src/modules/exam/components/QuestionItem.vue
+3
-4
MarkingPaper.vue
src/modules/exam/views/MarkingPaper.vue
+17
-288
没有找到文件。
src/modules/exam/components/PaperQuestion.vue
浏览文件 @
7959c587
<
template
>
<el-card
class=
"container"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
questionItem
.
question_item_title
}}
</span>
<span>
{{
questionItem
.
question_item_title
}}
</span>
</div>
<div
class=
"content"
>
<template
v-for=
"item in questionItem.question_list"
>
<div
class=
"sub-content"
v-if=
"item.group_id"
:key=
"item.id"
>
<div
class=
"title"
v-html=
"item.common_content"
></div>
<div
class=
"sub-container"
>
<question-item
v-for=
"subItem in item.list"
:key=
"subItem.id"
:question=
"
{item: subItem, question_item_id, questionType, sheet_id}" :question_item_id="question_item_id" />
<question-item
v-for=
"subItem in item.list"
:key=
"subItem.id"
:question=
"
{ item: subItem, question_item_id, questionType, sheet_id }"
:question_item_id="question_item_id"
/>
</div>
</div>
<question-item
v-else
:question=
"
{item, question_item_id, questionType, sheet_id}" :question_item_id="question_item_id" :key="item.id" />
<question-item
v-else
:question=
"
{ item, question_item_id, questionType, sheet_id }"
:question_item_id="question_item_id"
:key="item.id"
/>
</
template
>
</div>
</el-card>
...
...
@@ -51,36 +61,36 @@ export default {
}
},
created
()
{
// console.log(this.
options
)
// console.log(this.
questionItem, '00000'
)
}
}
</
script
>
<
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
;
.container
{
background
:
#fff
;
border
:
1px
solid
#f3f3f3
;
margin-bottom
:
20px
;
border-radius
:
6px
;
::v-deep
.el-card__body
{
padding
:
10px
20px
;
}
.content
{
.content
{
// border:1px solid #f3f3f3;
padding
:
10px
;
.title
{
line-height
:
40px
;
font-size
:
16px
;
padding
:
10px
;
.title
{
line-height
:
40px
;
font-size
:
16px
;
}
.sub-container
{
border
:
1px
solid
#e3e3e3
;
padding
:
15px
15px
0
;
border-radius
:
4px
;
.sub-container
{
border
:
1px
solid
#e3e3e3
;
padding
:
15px
15px
0
;
border-radius
:
4px
;
}
.sub-content
{
margin-bottom
:
20px
;
.sub-content
{
margin-bottom
:
20px
;
}
.question-item
:last-child
{
border
:none
;
.question-item
:last-child
{
border
:
none
;
}
}
}
...
...
src/modules/exam/components/QuestionItem.vue
浏览文件 @
7959c587
...
...
@@ -2,9 +2,9 @@
<div
class=
"question-item"
>
<div
class=
"question-item-title"
v-html=
"questionData.content"
></div>
<template
v-if=
"questionType === 1 || questionType === 6"
>
<el-radio-group
v-model=
"questionData.user_answer
[0]
"
: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 questionData.options"
:key=
"subItem.id"
>
<el-radio
:label=
"subItem.id"
>
{{
subItem
.
option
}}
</el-radio>
<el-radio
:label=
"subItem.id"
></el-radio>
</div>
</el-radio-group>
</
template
>
...
...
@@ -16,7 +16,7 @@
</el-checkbox-group>
</
template
>
<
template
v-if=
"questionType === 3"
>
<div
class=
"SAQ"
>
{{
questionData
.
user_answer
[
0
]
||
''
}}
</div>
<div
class=
"SAQ"
>
{{
questionData
.
user_answer
}}
</div>
<div
style=
"text-align: right"
>
<el-button
type=
"primary"
...
...
@@ -97,7 +97,6 @@ export default {
},
created
()
{
this
.
questionData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
question
.
item
))
// if (this.questionType === 3) console.log(this.questionData)
},
destroyed
()
{
this
.
bc
&&
this
.
bc
.
close
()
...
...
src/modules/exam/views/MarkingPaper.vue
浏览文件 @
7959c587
<
template
>
<div>
<template
v-for=
"item in questionList"
>
<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" />
<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"
/>
</
template
>
</div>
</template>
...
...
@@ -15,290 +19,6 @@ export default {
data
()
{
return
{
questionData
:
{},
// questionData: {
// sheet_id: '6861980331549917184',
// student_id: '6861979726374764544',
// exam_id: '6861979663460204544',
// paper_id: '6859369609758244864',
// questions: {
// paper_id: '6859369609758244864',
// total_question_count: 14,
// total_score: 100,
// question_items: [
// {
// question_item_id: '6859397281477558272',
// question_item_title: '案例题1',
// question_item_type: '5',
// question_list: [
// {
// common_content: '
<
p
>
(示例)这个是案例题的公共题干
111111
<
/p>'
,
// group_id: '6852817215452872713',
// list: [
// {
// id: '6852817215452872719',
// content: '
<
p
>
这个是案例题的题干
001111111111111
<
/p>'
,
// options: '[]',
// answer: '[]',
// type: 3,
// question_order: '10',
// score: 22,
// q_order: 1
// },
// {
// id: '6852817215452872724',
// content: '
<
p
>
这个是案例题的题干
002
<
/p>'
,
// options:
// '[{"id":"6858588277927051264","option":"E(true)"},{"id":"6852817215452872723","option":"D选项"},{"id":"6852817215452872720","option":"A选项"},{"id":"6852817215452872721","option":"B选项"}]',
// answer: '["6852817215452872720","6858588277927051264"]',
// type: 2,
// question_order: '20',
// score: 18,
// q_order: 2
// }
// ]
// },
// {
// common_content: '历史案例题1',
// group_id: '6856826400016433179',
// list: [
// {
// id: '6856826400016433180',
// content: '(问答)扁鹊本名叫什么?',
// options: '[]',
// answer: null,
// type: 3,
// question_order: '1',
// score: 1,
// q_order: 3
// },
// {
// id: '6856826400016433185',
// content: '(单选)北京猿人属于()?',
// options:
// '[{"id":"6856826400016433183","option":"尼格罗人种"},{"id":"6856826400016433184","option":"澳大利亚人种"},{"id":"6856826400016433182","option":"蒙古人种1"},{"id":"6856826400016433181","option":"欧罗巴人种"}]',
// answer: '["6856826400016433182"]',
// type: 1,
// question_order: '2',
// score: 1,
// q_order: 4
// },
// {
// id: '6856826400016433190',
// content: '(单选)佛教从()从印度传入中国。',
// options:
// '[{"id":"6856826400016433187","option":"西汉末年到东汉初期"},{"id":"6856826400016433188","option":"东汉末期"},{"id":"6856826400016433186","option":"西汉初年"},{"id":"6856826400016433189","option":"隋朝初期"}]',
// answer: '["6856826400016433187"]',
// type: 1,
// question_order: '3',
// score: 1,
// q_order: 5
// },
// {
// id: '6856826400016433195',
// content: '(多选)帝国主义列强对中国进行经济侵略的方式是()。',
// options:
// '[{"id":"6856826400016433194","option":"操纵中国的经济命脉1"},{"id":"6856826400016433192","option":"剥夺中国的关税自主权1"},{"id":"6856826400016433191","option":"控制中国的通商口岸1"},{"id":"6856826400016433193","option":"实行商品倾销和资本输出1"}]',
// answer: '["6856826400016433191","6856826400016433192","6856826400016433193","6856826400016433194"]',
// type: 2,
// question_order: '4',
// score: 1,
// q_order: 6
// },
// {
// id: '6856826400016433198',
// content: '(判断)秦汉时期,金是王朝礼法的象征。',
// options:
// '[{"id":"6856826400016433196","option":"错误"},{"id":"6856826400016433197","option":"正确"}]',
// answer: '["6856826400016433196"]',
// type: 6,
// question_order: '5',
// score: 1,
// q_order: 7
// }
// ]
// }
// ]
// },
// {
// question_item_id: '6859397358354956288',
// question_item_title: '案例题2',
// question_item_type: '5',
// question_list: [
// {
// common_content: '历史案例题1',
// group_id: '6856826400016433179',
// list: [
// {
// id: '6856826400016433180',
// content: '(问答)扁鹊本名叫什么?',
// options: '[]',
// answer: null,
// type: 3,
// question_order: '1',
// score: 19,
// q_order: 8
// },
// {
// id: '6856826400016433185',
// content: '(单选)北京猿人属于()?',
// options:
// '[{"id":"6856826400016433181","option":"欧罗巴人种"},{"id":"6856826400016433182","option":"蒙古人种1"},{"id":"6856826400016433183","option":"尼格罗人种"},{"id":"6856826400016433184","option":"澳大利亚人种"}]',
// answer: '["6856826400016433182"]',
// type: 1,
// question_order: '2',
// score: 9,
// q_order: 9
// },
// {
// id: '6856826400016433190',
// content: '(单选)佛教从()从印度传入中国。',
// options:
// '[{"id":"6856826400016433186","option":"西汉初年"},{"id":"6856826400016433187","option":"西汉末年到东汉初期"},{"id":"6856826400016433188","option":"东汉末期"},{"id":"6856826400016433189","option":"隋朝初期"}]',
// answer: '["6856826400016433187"]',
// type: 1,
// question_order: '3',
// score: 5,
// q_order: 10
// },
// {
// id: '6856826400016433195',
// content: '(多选)帝国主义列强对中国进行经济侵略的方式是()。',
// options:
// '[{"id":"6856826400016433191","option":"控制中国的通商口岸1"},{"id":"6856826400016433192","option":"剥夺中国的关税自主权1"},{"id":"6856826400016433193","option":"实行商品倾销和资本输出1"},{"id":"6856826400016433194","option":"操纵中国的经济命脉1"}]',
// answer: '["6856826400016433191","6856826400016433192","6856826400016433193","6856826400016433194"]',
// type: 2,
// question_order: '4',
// score: 11,
// q_order: 11
// },
// {
// id: '6856826400016433198',
// content: '(判断)秦汉时期,金是王朝礼法的象征。',
// options:
// '[{"id":"6856826400016433196","option":"错误"},{"id":"6856826400016433197","option":"正确"}]',
// answer: '["6856826400016433196"]',
// type: 6,
// question_order: '5',
// score: 1,
// q_order: 12
// }
// ]
// }
// ]
// },
// {
// question_item_id: '6860831598460272640',
// question_item_title: '单选题',
// question_item_type: '1',
// question_list: [
// {
// id: '6860750544940564490',
// content: '(示例)这个是单选题的题干002 张传梁211014',
// options:
// '[{"id":"6860750544940564488","option":"C选项"},{"id":"6860750544940564489","option":"D选项"},{"id":"6860750544940564486","option":"A选项"},{"id":"6860750544940564487","option":"B选项11"}]',
// answer: '["6860750544940564487"]',
// score: 4,
// q_order: 13
// },
// {
// id: '6860750544940564485',
// content: '(示例)这个是单选题的题干001 张传梁211014',
// options:
// '[{"id":"6860750544940564484","option":"E选项"},{"id":"6860750544940564480","option":"A选项11"},{"id":"6860750544940564482","option":"C选项"},{"id":"6860750544940564483","option":"D选项"},{"id":"6860750544940564481","option":"B选项"}]',
// answer: '["6860750544940564480"]',
// score: 6,
// q_order: 14
// }
// ]
// }
// ]
// },
// answers: {
// '6859397281477558272': {
// '6852817215452872724': {
// answer: ['6858588277927051264'],
// sign: false
// },
// '6852817215452872719': {
// answer: ['sdf'],
// sign: false
// }
// }
// },
// status: 1,
// score: '21.00',
// score_item: {
// '6859397281477558272': {
// '6852817215452872719': {
// score: 21,
// checked_flag: true,
// comment: '111'
// },
// '6852817215452872724': {
// score: 0,
// checked_flag: true
// },
// '6856826400016433180': {
// score: 0,
// checked_flag: false
// },
// '6856826400016433185': {
// score: 0,
// checked_flag: true
// },
// '6856826400016433190': {
// score: 0,
// checked_flag: true
// },
// '6856826400016433195': {
// score: 0,
// checked_flag: true
// },
// '6856826400016433198': {
// score: 0,
// checked_flag: true
// }
// },
// '6859397358354956288': {
// '6856826400016433180': {
// score: 0,
// checked_flag: false
// },
// '6856826400016433185': {
// score: 0,
// checked_flag: true
// },
// '6856826400016433190': {
// score: 0,
// checked_flag: true
// },
// '6856826400016433195': {
// score: 0,
// checked_flag: true
// },
// '6856826400016433198': {
// score: 0,
// checked_flag: true
// }
// },
// '6860831598460272640': {
// '6860750544940564490': {
// score: 0,
// checked_flag: true
// },
// '6860750544940564485': {
// score: 0,
// checked_flag: true
// }
// }
// },
// commit_time: '2021-11-04 18:59:14',
// checker_id: '6592683672086773760',
// checked_time: '2021-11-04 19:00:22',
// created_time: '2021-11-04 19:00:00',
// updated_time: '2021-11-04 19:00:22',
// status_text: '已提交'
// },
questionList
:
[]
}
},
...
...
@@ -321,17 +41,22 @@ export default {
if
(
res
.
code
===
0
)
{
// console.log(res.data)
this
.
questionData
=
res
.
data
.
sheet
// console.log(this.questionData, 'this.questionData111')
this
.
assembleData
()
}
})
},
assembleData
()
{
this
.
questionList
=
this
.
questionData
.
questions
.
question_items
// console.log(this.questionList, '2222')
this
.
questionList
.
forEach
(
item
=>
{
const
score
=
this
.
questionData
.
score_item
[
item
.
question_item_id
]
// 用户答案
const
answer
=
this
.
questionData
.
answers
[
item
.
question_item_id
]
const
answer
=
this
.
questionData
.
answers
[
item
.
question_item_id
]
||
[]
console
.
log
(
answer
,
'answwer'
)
item
.
question_list
.
forEach
(
subItem
=>
{
console
.
log
(
subItem
,
'subItem'
)
if
(
subItem
.
group_id
)
{
subItem
.
list
.
forEach
(
it
=>
{
const
obj
=
score
[
it
.
id
]
...
...
@@ -340,7 +65,9 @@ export default {
if
(
obj
.
comment
)
it
.
comment
=
obj
.
comment
if
(
it
.
answer
)
it
.
answer
=
JSON
.
parse
(
it
.
answer
)
if
(
it
.
options
)
it
.
options
=
JSON
.
parse
(
it
.
options
)
it
.
user_answer
=
answer
[
it
.
id
]?.
answer
||
[]
if
(
answer
.
length
)
{
it
.
user_answer
=
answer
[
it
.
id
].
answer
||
[]
}
})
}
else
{
const
obj
=
score
[
subItem
.
id
]
...
...
@@ -349,7 +76,9 @@ export default {
if
(
obj
.
comment
)
subItem
.
comment
=
obj
.
comment
if
(
subItem
.
answer
)
subItem
.
answer
=
JSON
.
parse
(
subItem
.
answer
)
if
(
subItem
.
options
)
subItem
.
options
=
JSON
.
parse
(
subItem
.
options
)
subItem
.
user_answer
=
answer
[
subItem
.
id
]?.
answer
||
[]
if
(
answer
.
length
)
{
subItem
.
user_answer
=
answer
[
subItem
].
answer
||
[]
}
}
})
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论