Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
4754fc0c
提交
4754fc0c
authored
11月 13, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 修改试卷总分和平均分的编辑位置
上级
72839c57
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
171 行增加
和
109 行删除
+171
-109
AddPaper.vue
src/modules/paper/components/AddPaper.vue
+52
-20
AutomaticPaper.vue
src/modules/paper/components/AutomaticPaper.vue
+57
-29
OnceAutomaticPaper.vue
src/modules/paper/components/OnceAutomaticPaper.vue
+54
-39
PaperQuestions.vue
src/modules/paper/components/PaperQuestions.vue
+5
-18
Update.vue
src/modules/paper/views/Update.vue
+3
-3
没有找到文件。
src/modules/paper/components/AddPaper.vue
浏览文件 @
4754fc0c
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</div>
</div>
<!-- 选题组卷添加试卷第二步 -->
<!-- 选题组卷添加试卷第二步 -->
<div
v-show=
"step === 2"
>
<div
v-show=
"step === 2"
>
<el-form
label-width=
"170px"
>
<el-form
label-width=
"170px"
ref=
"form"
:model=
"data"
:rules=
"rules"
>
<el-form-item
label=
"试题分值设置方式:"
>
<el-form-item
label=
"试题分值设置方式:"
>
<el-radio-group
v-model=
"setMethod"
>
<el-radio-group
v-model=
"setMethod"
>
<el-radio
:label=
"1"
>
批量设置
</el-radio>
<el-radio
:label=
"1"
>
批量设置
</el-radio>
...
@@ -20,23 +20,43 @@
...
@@ -20,23 +20,43 @@
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item
label=
"您此次选择的试题总数:"
>
{{
multipleSelection
.
length
}}
</el-form-item>
<el-form-item
label=
"您此次选择的试题总数:"
>
{{
multipleSelection
.
length
}}
</el-form-item>
<el-form-item
label=
"此次试卷总分:"
>
{{
data
.
paper_total_score
-
addedQuestionsScore
}}
</el-form-item>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"试卷总分:"
prop=
"paper_total_score"
>
<el-input-number
:controls=
"false"
v-model=
"data.paper_total_score"
:min=
"0"
:max=
"200"
placeholder=
"请输入试卷总分"
style=
"width: 100%"
:precision=
"0"
></el-input-number>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"及格分数:"
prop=
"pass_score"
>
<el-input-number
:controls=
"false"
v-model=
"data.pass_score"
:min=
"0"
:max=
"data.paper_total_score || 200"
placeholder=
"请输入及格分数"
style=
"width: 100%"
:precision=
"0"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
"此次试卷总分:"
v-if=
"false"
>
{{
data
.
paper_total_score
-
addedQuestionsScore
}}
</el-form-item>
<el-form-item
label=
"已设置试题总分:"
>
{{
addedQuestionsScore
}}
</el-form-item>
<el-form-item
label=
"已设置试题总分:"
>
{{
addedQuestionsScore
}}
</el-form-item>
<el-divider></el-divider>
<el-divider></el-divider>
<template
v-if=
"setMethod === 1"
>
<template
v-if=
"setMethod === 1"
>
<el-form-item
<el-form-item
:label=
"item.question_type_name + ':'"
:key=
"index"
v-for=
"(item, index) in questionTypeGroups"
>
:label=
"item.question_type_name + ':'"
:key=
"index"
v-for=
"(item, index) in questionTypeGroups"
>
<ul>
<ul>
<li>
数量:
{{
item
.
total
}}
</li>
<li>
数量:
{{
item
.
total
}}
</li>
<li>
分值:
{{
item
.
score
}}
</li>
<li>
分值:
{{
item
.
score
}}
</li>
<li>
<li>
<template
v-if=
"canBatchSetting(item.question_type)"
>
<template
v-if=
"canBatchSetting(item.question_type)"
>
<el-button
type=
"primary"
class=
"settingScore"
@
click=
"showBatchSetting(item)"
<el-button
type=
"primary"
class=
"settingScore"
@
click=
"showBatchSetting(item)"
>
批量设置分数
</el-button>
>
批量设置分数
</el-button
>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<span
class=
"settingScore"
>
此题型只能在试卷详情页面逐一设置
</span>
<span
class=
"settingScore"
>
此题型只能在试卷详情页面逐一设置
</span>
...
@@ -53,12 +73,7 @@
...
@@ -53,12 +73,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<BatchSetting
<BatchSetting
:visible
.
sync=
"visible"
:data=
"questionTypeGroups[batchSettingQuestionType]"
@
update=
"handleUpdateScore"
v-if=
"visible"
/>
:visible
.
sync=
"visible"
:data=
"questionTypeGroups[batchSettingQuestionType]"
@
update=
"handleUpdateScore"
v-if=
"visible"
/>
</div>
</div>
</el-drawer>
</el-drawer>
</template>
</template>
...
@@ -74,6 +89,13 @@ export default {
...
@@ -74,6 +89,13 @@ export default {
},
},
components
:
{
QuestionSelect
,
BatchSetting
},
components
:
{
QuestionSelect
,
BatchSetting
},
data
()
{
data
()
{
const
checkPassScore
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
>
this
.
data
.
paper_total_score
)
{
callback
(
new
Error
(
'及格分数不能大于试卷总分'
))
}
else
{
callback
()
}
}
return
{
return
{
multipleSelection
:
[],
// 选择的试题,不包含子题
multipleSelection
:
[],
// 选择的试题,不包含子题
setMethod
:
1
,
// 设置方式
setMethod
:
1
,
// 设置方式
...
@@ -82,9 +104,17 @@ export default {
...
@@ -82,9 +104,17 @@ export default {
questionTypeGroups
:
{},
// 试题类型组
questionTypeGroups
:
{},
// 试题类型组
visible
:
false
,
visible
:
false
,
batchSettingQuestionType
:
null
,
// 批量设置试题类型
batchSettingQuestionType
:
null
,
// 批量设置试题类型
loading
:
false
loading
:
false
,
rules
:
{
paper_total_score
:
[{
message
:
'请输入试卷总分'
,
required
:
true
,
trigger
:
'blur'
}],
pass_score
:
[
{
message
:
'请输入及格分数'
,
required
:
true
,
trigger
:
'blur'
},
{
validator
:
checkPassScore
,
trigger
:
'blur'
}
]
}
}
}
},
},
computed
:
{
computed
:
{
// 已添加的试题
// 已添加的试题
addedQuestions
()
{
addedQuestions
()
{
...
@@ -157,7 +187,8 @@ export default {
...
@@ -157,7 +187,8 @@ export default {
this
.
questionTypeGroups
[
questionType
].
score
=
score
this
.
questionTypeGroups
[
questionType
].
score
=
score
},
},
// 保存
// 保存
handleSave
()
{
async
handleSave
()
{
await
this
.
$refs
.
form
.
validate
()
// 批量设置分数
// 批量设置分数
if
(
this
.
setMethod
===
1
)
{
if
(
this
.
setMethod
===
1
)
{
this
.
questions
=
this
.
questions
.
map
(
item
=>
{
this
.
questions
=
this
.
questions
.
map
(
item
=>
{
...
@@ -177,7 +208,8 @@ export default {
...
@@ -177,7 +208,8 @@ export default {
this
.
$emit
(
'update:visible'
,
false
)
this
.
$emit
(
'update:visible'
,
false
)
},
},
// 保存,更新试卷规则
// 保存,更新试卷规则
handleSubmit
()
{
async
handleSubmit
()
{
await
this
.
$refs
.
form
.
validate
()
const
rules
=
[]
const
rules
=
[]
Object
.
values
(
this
.
questionTypeGroups
).
forEach
(
item
=>
{
Object
.
values
(
this
.
questionTypeGroups
).
forEach
(
item
=>
{
item
.
questions
.
forEach
(
question
=>
{
item
.
questions
.
forEach
(
question
=>
{
...
@@ -189,7 +221,7 @@ export default {
...
@@ -189,7 +221,7 @@ export default {
}
}
})
})
})
})
const
parmas
=
{
id
:
this
.
data
.
id
,
rules
}
const
parmas
=
{
id
:
this
.
data
.
id
,
rules
,
paper_total_score
:
this
.
data
.
paper_total_score
,
pass_score
:
this
.
data
.
pass_score
}
updatePaperRules
(
parmas
).
then
(()
=>
{
updatePaperRules
(
parmas
).
then
(()
=>
{
this
.
$message
.
success
(
'保存成功'
)
this
.
$message
.
success
(
'保存成功'
)
this
.
$emit
(
'update'
)
this
.
$emit
(
'update'
)
...
...
src/modules/paper/components/AutomaticPaper.vue
浏览文件 @
4754fc0c
<
template
>
<
template
>
<el-drawer
title=
"自动组卷"
size=
"80%"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<el-drawer
title=
"自动组卷"
size=
"80%"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<div
style=
"margin: 0 20px"
>
<div
style=
"margin: 0 20px"
>
<el-form
:model=
"form"
>
<el-form
:model=
"
data"
:rules=
"rules"
ref=
"
form"
>
<!-- 组卷题库 -->
<!-- 组卷题库 -->
<el-form-item
label=
"组卷题库:"
>
<el-form-item
label=
"组卷题库:"
>
<el-radio-group
v-model=
"form.permission"
@
change=
"onChangePermission"
>
<el-radio-group
v-model=
"form.permission"
@
change=
"onChangePermission"
>
...
@@ -15,11 +15,7 @@
...
@@ -15,11 +15,7 @@
<el-table-column
align=
"center"
label=
"题目类型"
width=
"140"
>
<el-table-column
align=
"center"
label=
"题目类型"
width=
"140"
>
<template
slot-scope=
"
{ row, $index }">
<template
slot-scope=
"
{ row, $index }">
<el-select
v-model=
"row.question_type"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-select
v-model=
"row.question_type"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-option
<el-option
v-for=
"item in questionTypeMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
v-for=
"item in questionTypeMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-select>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -27,11 +23,7 @@
...
@@ -27,11 +23,7 @@
<el-table-column
align=
"center"
label=
"难度"
width=
"140"
>
<el-table-column
align=
"center"
label=
"难度"
width=
"140"
>
<
template
slot-scope=
"{ row, $index }"
>
<
template
slot-scope=
"{ row, $index }"
>
<el-select
v-model=
"row.question_difficulty"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-select
v-model=
"row.question_difficulty"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-option
<el-option
v-for=
"item in questionDifficultyMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
v-for=
"item in questionDifficultyMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-select>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -50,12 +42,7 @@
...
@@ -50,12 +42,7 @@
<el-table-column
align=
"center"
label=
"数量"
width=
"140"
>
<el-table-column
align=
"center"
label=
"数量"
width=
"140"
>
<
template
slot-scope=
"{ row }"
>
<
template
slot-scope=
"{ row }"
>
<el-input-number
<el-input-number
v-model=
"row.question_num"
:min=
"0"
:max=
"row.max_question_num"
step-strictly
style=
"width: 100%"
></el-input-number>
v-model=
"row.question_num"
:min=
"0"
:max=
"row.max_question_num"
step-strictly
style=
"width: 100%"
></el-input-number>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -89,12 +76,38 @@
...
@@ -89,12 +76,38 @@
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-form-item>
</el-form-item>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"试卷总分:"
prop=
"paper_total_score"
label-width=
"94px"
>
<el-input-number
:controls=
"false"
v-model=
"data.paper_total_score"
:min=
"0"
:max=
"200"
placeholder=
"请输入试卷总分"
style=
"width: 100%"
:precision=
"0"
></el-input-number>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"及格分数:"
prop=
"pass_score"
label-width=
"94px"
>
<el-input-number
:controls=
"false"
v-model=
"data.pass_score"
:min=
"0"
:max=
"data.paper_total_score || 200"
placeholder=
"请输入及格分数"
style=
"width: 100%"
:precision=
"0"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<!-- 您计划自动组卷的试题情况: -->
<!-- 您计划自动组卷的试题情况: -->
<el-form-item
label=
"您计划自动组卷的试题情况:"
>
<el-form-item
label=
"您计划自动组卷的试题情况:"
>
<!-- 您计划自动组卷的试题情况 -->
<!-- 您计划自动组卷的试题情况 -->
<div
class=
"automatic"
>
<div
class=
"automatic"
>
<div
class=
"automatic_questionNum"
>
试题数量总数:{{ questionTotalNum }}
</div>
<div
class=
"automatic_questionNum"
>
试题数量总数:{{ questionTotalNum }}
</div>
<div
class=
"automatic_totalScore"
>
试卷
总分:{{ questionTotalScore }}
</div>
<div
class=
"automatic_totalScore"
>
已设置试题
总分:{{ questionTotalScore }}
</div>
</div>
</div>
<el-table
ref=
"mytable"
:data=
"totalQuestionList"
style=
"width: 100%"
>
<el-table
ref=
"mytable"
:data=
"totalQuestionList"
style=
"width: 100%"
>
<el-table-column
align=
"center"
label=
"题目类型"
prop=
"question_type_name"
></el-table-column>
<el-table-column
align=
"center"
label=
"题目类型"
prop=
"question_type_name"
></el-table-column>
...
@@ -128,6 +141,13 @@ export default {
...
@@ -128,6 +141,13 @@ export default {
},
},
components
:
{
QuestionTypeTreeselect
},
components
:
{
QuestionTypeTreeselect
},
data
()
{
data
()
{
const
checkPassScore
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
>
this
.
data
.
paper_total_score
)
{
callback
(
new
Error
(
'及格分数不能大于试卷总分'
))
}
else
{
callback
()
}
}
const
questionTypeMap
=
[
const
questionTypeMap
=
[
{
value
:
'1'
,
label
:
'单选题'
},
{
value
:
'1'
,
label
:
'单选题'
},
{
value
:
'2'
,
label
:
'多选题'
},
{
value
:
'2'
,
label
:
'多选题'
},
...
@@ -158,7 +178,14 @@ export default {
...
@@ -158,7 +178,14 @@ export default {
defaultItem
,
defaultItem
,
// 组卷题库
// 组卷题库
form
:
{
permission
},
form
:
{
permission
},
questionList
:
[{
...
defaultItem
}]
questionList
:
[{
...
defaultItem
}],
rules
:
{
paper_total_score
:
[{
message
:
'请输入试卷总分'
,
required
:
true
,
trigger
:
'blur'
}],
pass_score
:
[
{
message
:
'请输入及格分数'
,
required
:
true
,
trigger
:
'blur'
},
{
validator
:
checkPassScore
,
trigger
:
'blur'
}
]
}
}
}
},
},
watch
:
{
watch
:
{
...
@@ -187,20 +214,14 @@ export default {
...
@@ -187,20 +214,14 @@ export default {
totalQuestionList
()
{
totalQuestionList
()
{
const
result
=
[]
const
result
=
[]
this
.
questionList
.
forEach
(
item
=>
{
this
.
questionList
.
forEach
(
item
=>
{
if
(
if
(
item
.
question_type
&&
item
.
question_num
&&
!
result
.
find
(
item2
=>
item2
.
question_type
===
item
.
question_type
))
{
item
.
question_type
&&
item
.
question_num
&&
!
result
.
find
(
item2
=>
item2
.
question_type
===
item
.
question_type
)
)
{
// 当前类型的试题列表
// 当前类型的试题列表
const
currentTypeQuestionList
=
this
.
questionList
.
filter
(
item2
=>
item2
.
question_type
===
item
.
question_type
)
const
currentTypeQuestionList
=
this
.
questionList
.
filter
(
item2
=>
item2
.
question_type
===
item
.
question_type
)
// 难度列表
// 难度列表
const
questionDifficultyList
=
this
.
questionDifficultyMap
.
map
(
item
=>
{
const
questionDifficultyList
=
this
.
questionDifficultyMap
.
map
(
item
=>
{
// 当前难度的试题列表
// 当前难度的试题列表
const
currentDifficultyQuestionList
=
currentTypeQuestionList
.
filter
(
const
currentDifficultyQuestionList
=
currentTypeQuestionList
.
filter
(
item2
=>
item2
.
question_difficulty
===
item
.
value
)
item2
=>
item2
.
question_difficulty
===
item
.
value
)
return
{
return
{
question_difficulty
:
item
.
value
,
question_difficulty
:
item
.
value
,
question_difficulty_name
:
item
.
label
,
question_difficulty_name
:
item
.
label
,
...
@@ -254,7 +275,8 @@ export default {
...
@@ -254,7 +275,8 @@ export default {
row
.
edit
=
false
row
.
edit
=
false
},
},
// 自动组卷
// 自动组卷
handleSubmit
()
{
async
handleSubmit
()
{
await
this
.
$refs
.
form
.
validate
()
const
rules
=
[]
const
rules
=
[]
this
.
questionList
.
forEach
(
question
=>
{
this
.
questionList
.
forEach
(
question
=>
{
rules
.
push
(
Object
.
assign
({},
question
))
rules
.
push
(
Object
.
assign
({},
question
))
...
@@ -266,7 +288,13 @@ export default {
...
@@ -266,7 +288,13 @@ export default {
return
return
}
}
}
}
const
params
=
{
id
:
this
.
data
.
id
,
permission
:
this
.
form
.
permission
,
rules
}
const
params
=
{
id
:
this
.
data
.
id
,
permission
:
this
.
form
.
permission
,
rules
,
paper_total_score
:
this
.
data
.
paper_total_score
,
pass_score
:
this
.
data
.
pass_score
}
updatePaperRules
(
params
).
then
(()
=>
{
updatePaperRules
(
params
).
then
(()
=>
{
this
.
$message
.
success
(
'保存成功'
)
this
.
$message
.
success
(
'保存成功'
)
this
.
$emit
(
'update'
)
this
.
$emit
(
'update'
)
...
...
src/modules/paper/components/OnceAutomaticPaper.vue
浏览文件 @
4754fc0c
<
template
>
<
template
>
<el-drawer
title=
"自动组卷"
size=
"80%"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<el-drawer
title=
"自动组卷"
size=
"80%"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<div
style=
"margin: 0 20px"
>
<div
style=
"margin: 0 20px"
>
<el-form
:model=
"form"
>
<el-form
:model=
"
data"
:rules=
"rules"
ref=
"
form"
>
<!-- 组卷题库 -->
<!-- 组卷题库 -->
<el-form-item
label=
"组卷题库:"
>
<el-form-item
label=
"组卷题库:"
>
<el-radio-group
v-model=
"form.permission"
@
change=
"onChangePermission"
>
<el-radio-group
v-model=
"form.permission"
@
change=
"onChangePermission"
>
...
@@ -15,12 +15,7 @@
...
@@ -15,12 +15,7 @@
<el-table-column
align=
"center"
label=
"题目类型"
width=
"140"
>
<el-table-column
align=
"center"
label=
"题目类型"
width=
"140"
>
<template
slot-scope=
"
{ row, $index }">
<template
slot-scope=
"
{ row, $index }">
<el-select
v-model=
"row.question_type"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-select
v-model=
"row.question_type"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-option
<el-option
v-for=
"item in questionTypeMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
v-for=
"item in questionTypeMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-select>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -28,12 +23,7 @@
...
@@ -28,12 +23,7 @@
<el-table-column
align=
"center"
label=
"难度"
width=
"140"
>
<el-table-column
align=
"center"
label=
"难度"
width=
"140"
>
<
template
slot-scope=
"{ row, $index }"
>
<
template
slot-scope=
"{ row, $index }"
>
<el-select
v-model=
"row.question_difficulty"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-select
v-model=
"row.question_difficulty"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-option
<el-option
v-for=
"item in questionDifficultyMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
v-for=
"item in questionDifficultyMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-select>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -46,20 +36,13 @@
...
@@ -46,20 +36,13 @@
:isRequestRemote=
"false"
:isRequestRemote=
"false"
v-model=
"row.question_categories"
v-model=
"row.question_categories"
@
change=
"getQuestionMaxCount($index, row)"
@
change=
"getQuestionMaxCount($index, row)"
style=
"width: 100%"
style=
"width: 100%"
></question-type-treeselect>
></question-type-treeselect>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"数量"
width=
"140"
>
<el-table-column
align=
"center"
label=
"数量"
width=
"140"
>
<
template
slot-scope=
"{ row }"
>
<
template
slot-scope=
"{ row }"
>
<el-input-number
<el-input-number
v-model=
"row.question_num"
:min=
"0"
:max=
"row.max_question_num"
step-strictly
style=
"width: 100%"
></el-input-number>
v-model=
"row.question_num"
:min=
"0"
:max=
"row.max_question_num"
step-strictly
style=
"width: 100%"
></el-input-number>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -70,8 +53,7 @@
...
@@ -70,8 +53,7 @@
:min=
"0"
:min=
"0"
:max=
"30"
:max=
"30"
:disabled=
"['5', '7', '8'].includes(row.question_type)"
:disabled=
"['5', '7', '8'].includes(row.question_type)"
style=
"width: 100%"
style=
"width: 100%"
></el-input-number>
></el-input-number>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -84,8 +66,7 @@
...
@@ -84,8 +66,7 @@
size=
"mini"
size=
"mini"
:plain=
"true"
:plain=
"true"
type=
"danger"
type=
"danger"
@
click=
"handleAdd(scope.$index, scope.row)"
@
click=
"handleAdd(scope.$index, scope.row)"
></el-button>
></el-button>
<el-button
<el-button
style=
"margin-left: 10px"
style=
"margin-left: 10px"
...
@@ -95,18 +76,43 @@
...
@@ -95,18 +76,43 @@
:plain=
"true"
:plain=
"true"
type=
"danger"
type=
"danger"
@
click=
"handleDelete(scope.$index, scope.row)"
@
click=
"handleDelete(scope.$index, scope.row)"
v-if=
"questionList.length > 1"
v-if=
"questionList.length > 1"
></el-button>
></el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-form-item>
</el-form-item>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"试卷总分:"
prop=
"paper_total_score"
label-width=
"94px"
>
<el-input-number
:controls=
"false"
v-model=
"data.paper_total_score"
:min=
"0"
:max=
"200"
placeholder=
"请输入试卷总分"
style=
"width: 100%"
:precision=
"0"
></el-input-number>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"及格分数:"
prop=
"pass_score"
label-width=
"94px"
>
<el-input-number
:controls=
"false"
v-model=
"data.pass_score"
:min=
"0"
:max=
"data.paper_total_score || 200"
placeholder=
"请输入及格分数"
style=
"width: 100%"
:precision=
"0"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
<!-- 您计划自动组卷的试题情况: -->
<!-- 您计划自动组卷的试题情况: -->
<el-form-item
label=
"您计划自动组卷的试题情况:"
>
<el-form-item
label=
"您计划自动组卷的试题情况:"
>
<!-- 您计划自动组卷的试题情况 -->
<!-- 您计划自动组卷的试题情况 -->
<div
class=
"automatic"
>
<div
class=
"automatic"
>
<div
class=
"automatic_questionNum"
>
试题数量总数:{{ questionTotalNum }}
</div>
<div
class=
"automatic_questionNum"
>
试题数量总数:{{ questionTotalNum }}
</div>
<div
class=
"automatic_totalScore"
>
试卷
总分:{{ questionTotalScore }}
</div>
<div
class=
"automatic_totalScore"
>
已设置试题
总分:{{ questionTotalScore }}
</div>
</div>
</div>
<el-table
ref=
"mytable"
:data=
"totalQuestionList"
style=
"width: 100%"
>
<el-table
ref=
"mytable"
:data=
"totalQuestionList"
style=
"width: 100%"
>
<el-table-column
align=
"center"
label=
"题目类型"
prop=
"question_type_name"
></el-table-column>
<el-table-column
align=
"center"
label=
"题目类型"
prop=
"question_type_name"
></el-table-column>
...
@@ -140,6 +146,13 @@ export default {
...
@@ -140,6 +146,13 @@ export default {
},
},
components
:
{
QuestionTypeTreeselect
},
components
:
{
QuestionTypeTreeselect
},
data
()
{
data
()
{
const
checkPassScore
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
>
this
.
data
.
paper_total_score
)
{
callback
(
new
Error
(
'及格分数不能大于试卷总分'
))
}
else
{
callback
()
}
}
const
questionTypeMap
=
[
const
questionTypeMap
=
[
{
value
:
'1'
,
label
:
'单选题'
},
{
value
:
'1'
,
label
:
'单选题'
},
{
value
:
'2'
,
label
:
'多选题'
},
{
value
:
'2'
,
label
:
'多选题'
},
...
@@ -170,7 +183,14 @@ export default {
...
@@ -170,7 +183,14 @@ export default {
defaultItem
,
defaultItem
,
// 组卷题库
// 组卷题库
form
:
{
permission
},
form
:
{
permission
},
questionList
:
[{
...
defaultItem
}]
questionList
:
[{
...
defaultItem
}],
rules
:
{
paper_total_score
:
[{
message
:
'请输入试卷总分'
,
required
:
true
,
trigger
:
'blur'
}],
pass_score
:
[
{
message
:
'请输入及格分数'
,
required
:
true
,
trigger
:
'blur'
},
{
validator
:
checkPassScore
,
trigger
:
'blur'
}
]
}
}
}
},
},
watch
:
{
watch
:
{
...
@@ -199,20 +219,14 @@ export default {
...
@@ -199,20 +219,14 @@ export default {
totalQuestionList
()
{
totalQuestionList
()
{
const
result
=
[]
const
result
=
[]
this
.
questionList
.
forEach
(
item
=>
{
this
.
questionList
.
forEach
(
item
=>
{
if
(
if
(
item
.
question_type
&&
item
.
question_num
&&
!
result
.
find
(
item2
=>
item2
.
question_type
===
item
.
question_type
))
{
item
.
question_type
&&
item
.
question_num
&&
!
result
.
find
(
item2
=>
item2
.
question_type
===
item
.
question_type
)
)
{
// 当前类型的试题列表
// 当前类型的试题列表
const
currentTypeQuestionList
=
this
.
questionList
.
filter
(
item2
=>
item2
.
question_type
===
item
.
question_type
)
const
currentTypeQuestionList
=
this
.
questionList
.
filter
(
item2
=>
item2
.
question_type
===
item
.
question_type
)
// 难度列表
// 难度列表
const
questionDifficultyList
=
this
.
questionDifficultyMap
.
map
(
item
=>
{
const
questionDifficultyList
=
this
.
questionDifficultyMap
.
map
(
item
=>
{
// 当前难度的试题列表
// 当前难度的试题列表
const
currentDifficultyQuestionList
=
currentTypeQuestionList
.
filter
(
const
currentDifficultyQuestionList
=
currentTypeQuestionList
.
filter
(
item2
=>
item2
.
question_difficulty
===
item
.
value
)
item2
=>
item2
.
question_difficulty
===
item
.
value
)
return
{
return
{
question_difficulty
:
item
.
value
,
question_difficulty
:
item
.
value
,
question_difficulty_name
:
item
.
label
,
question_difficulty_name
:
item
.
label
,
...
@@ -266,7 +280,8 @@ export default {
...
@@ -266,7 +280,8 @@ export default {
row
.
edit
=
false
row
.
edit
=
false
},
},
// 自动组卷
// 自动组卷
handleSubmit
()
{
async
handleSubmit
()
{
await
this
.
$refs
.
form
.
validate
()
const
rules
=
[]
const
rules
=
[]
this
.
questionList
.
forEach
(
question
=>
{
this
.
questionList
.
forEach
(
question
=>
{
rules
.
push
(
Object
.
assign
({},
question
,
{
question_count
:
question
.
question_num
}))
rules
.
push
(
Object
.
assign
({},
question
,
{
question_count
:
question
.
question_num
}))
...
...
src/modules/paper/components/PaperQuestions.vue
浏览文件 @
4754fc0c
...
@@ -8,9 +8,7 @@
...
@@ -8,9 +8,7 @@
<!-- 选题组卷 -->
<!-- 选题组卷 -->
<template
v-if=
"data.paper_type === 1"
>
<template
v-if=
"data.paper_type === 1"
>
<el-button
type=
"primary"
@
click=
"showSelectQuestion"
v-if=
"hasUpdate"
>
添加试题
</el-button>
<el-button
type=
"primary"
@
click=
"showSelectQuestion"
v-if=
"hasUpdate"
>
添加试题
</el-button>
<el-button
type=
"primary"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemove"
<el-button
type=
"primary"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemove"
>
删除选中试题
</el-button>
>
删除选中试题
</el-button
>
</
template
>
</
template
>
<!-- 自动组卷 -->
<!-- 自动组卷 -->
<
template
v-if=
"data.paper_type === 2"
>
<
template
v-if=
"data.paper_type === 2"
>
...
@@ -20,16 +18,10 @@
...
@@ -20,16 +18,10 @@
<
template
v-if=
"data.paper_type === 3"
>
<
template
v-if=
"data.paper_type === 3"
>
<el-button
type=
"primary"
@
click=
"handleAutoPaper"
v-if=
"hasUpdate"
>
自动组卷
</el-button>
<el-button
type=
"primary"
@
click=
"handleAutoPaper"
v-if=
"hasUpdate"
>
自动组卷
</el-button>
<el-button
type=
"primary"
@
click=
"paperVisible = true"
v-if=
"hasUpdate"
>
添加试题
</el-button>
<el-button
type=
"primary"
@
click=
"paperVisible = true"
v-if=
"hasUpdate"
>
添加试题
</el-button>
<el-button
type=
"primary"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemove"
<el-button
type=
"primary"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemove"
>
删除选中试题
</el-button>
>
删除选中试题
</el-button
>
</
template
>
</
template
>
</template>
</template>
<question-list
<question-list
:list=
"currentQuestions"
:disableScore=
"data.paper_type === 2"
style=
"margin-top: 20px"
v-if=
"currentQuestions.length"
>
:list=
"currentQuestions"
:disableScore=
"data.paper_type === 2"
style=
"margin-top: 20px"
v-if=
"currentQuestions.length"
>
<
template
v-slot:selection=
"item"
v-if=
"hasSelection"
>
<
template
v-slot:selection=
"item"
v-if=
"hasSelection"
>
<el-checkbox
@
change=
"handleSelectionChange(arguments[0], item)"
></el-checkbox>
<el-checkbox
@
change=
"handleSelectionChange(arguments[0], item)"
></el-checkbox>
</
template
>
</
template
>
...
@@ -75,12 +67,7 @@
...
@@ -75,12 +67,7 @@
<!-- 自由组卷-自动组卷 -->
<!-- 自由组卷-自动组卷 -->
<OnceAutomaticPaper
:visible
.
sync=
"visible"
:data=
"data"
@
update=
"handleUpdate"
v-if=
"visible"
/>
<OnceAutomaticPaper
:visible
.
sync=
"visible"
:data=
"data"
@
update=
"handleUpdate"
v-if=
"visible"
/>
<!-- 自由组卷-选题组卷 -->
<!-- 自由组卷-选题组卷 -->
<addPaper
<addPaper
:visible
.
sync=
"paperVisible"
:data=
"data"
:list=
"questions"
@
update=
"handleUpdate"
v-if=
"paperVisible"
/>
:visible
.
sync=
"paperVisible"
:data=
"data"
:list=
"questions"
@
update=
"handleUpdate"
v-if=
"paperVisible"
/>
</
template
>
</
template
>
</div>
</div>
</template>
</template>
...
@@ -211,7 +198,7 @@ export default {
...
@@ -211,7 +198,7 @@ export default {
return
return
}
}
}
}
const
params
=
{
id
:
this
.
data
.
id
,
rules
}
const
params
=
{
id
:
this
.
data
.
id
,
rules
,
paper_total_score
:
this
.
data
.
paper_total_score
,
pass_score
:
this
.
data
.
pass_score
}
updatePaperRules
(
params
).
then
(()
=>
{
updatePaperRules
(
params
).
then
(()
=>
{
this
.
$message
.
success
(
'保存成功'
)
this
.
$message
.
success
(
'保存成功'
)
this
.
$emit
(
'update'
)
this
.
$emit
(
'update'
)
...
...
src/modules/paper/views/Update.vue
浏览文件 @
4754fc0c
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
<el-row>
<el-row
v-if=
"false"
>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"试卷总分"
prop=
"paper_total_score"
>
<el-form-item
label=
"试卷总分"
prop=
"paper_total_score"
>
<el-input-number
<el-input-number
...
@@ -166,8 +166,8 @@ export default {
...
@@ -166,8 +166,8 @@ export default {
paper_category
:
undefined
,
// 试卷分类
paper_category
:
undefined
,
// 试卷分类
paper_type
:
undefined
,
// 组卷模式
paper_type
:
undefined
,
// 组卷模式
paper_question_order
:
1
,
// 试题顺序
paper_question_order
:
1
,
// 试题顺序
paper_total_score
:
100
,
// 试卷总分
//
paper_total_score: 100, // 试卷总分
pass_score
:
60
,
// 及格分数
//
pass_score: 60, // 及格分数
paper_times
:
90
,
// 考试时长
paper_times
:
90
,
// 考试时长
minimum_paper_handing_time
:
15
,
// 最短交卷时长
minimum_paper_handing_time
:
15
,
// 最短交卷时长
is_multiple_exams
:
0
,
// 多次考试
is_multiple_exams
:
0
,
// 多次考试
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论