Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
c07399bf
Commit
c07399bf
authored
Sep 18, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
efc6234b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
322 additions
and
136 deletions
+322
-136
question.js
src/api/question/question.js
+15
-3
exampaperlist.vue
src/components/exam/exampaperlist.vue
+3
-3
exampublishlist.vue
src/components/exam/exampublishlist.vue
+2
-1
paperCreate.vue
src/pages/exam/paperCreate.vue
+209
-108
paperEdit.vue
src/pages/exam/paperEdit.vue
+93
-21
No files found.
src/api/question/question.js
View file @
c07399bf
...
@@ -243,12 +243,24 @@ export function saveBatchQuestionLevel(data) {
...
@@ -243,12 +243,24 @@ export function saveBatchQuestionLevel(data) {
}
}
/**
/**
* 根据题库编号获取题库题型
分类列表
【试卷组卷使用】
* 根据题库编号获取题库题型
列表(单选题、多选题、等)
【试卷组卷使用】
* @param {*} data
* @param {*} data
*/
*/
export
function
queryQuestion
Category
List
(
data
)
{
export
function
queryQuestion
TypeStatic
List
(
data
)
{
return
request
({
return
request
({
url
:
'/Question/GetQuestionCategoryList'
,
url
:
'/Question/GetQuestionTypeStaticList'
,
method
:
'post'
,
data
})
}
/**
* 根据题库编号获取题库题型分类列表(读音选择题、汉字选择题等)【试卷组卷使用】
* @param {*} data
*/
export
function
queryQuestionCategoryStaticList
(
data
)
{
return
request
({
url
:
'/Question/GetQuestionCategoryStaticList'
,
method
:
'post'
,
method
:
'post'
,
data
data
})
})
...
...
src/components/exam/exampaperlist.vue
View file @
c07399bf
...
@@ -314,9 +314,9 @@
...
@@ -314,9 +314,9 @@
methods
:
{
methods
:
{
//是否可修改
//是否可修改
isEdit
(
item
)
{
isEdit
(
item
)
{
//
if (this.currentUserInfo.Id == 1) {
if
(
this
.
currentUserInfo
.
Id
==
1
)
{
//
return true;
return
true
;
//
}
}
return
this
.
currentUserInfo
.
Id
==
item
.
CreateBy
&&
return
this
.
currentUserInfo
.
Id
==
item
.
CreateBy
&&
(
item
.
ExamineStatus
==
0
||
item
.
ExamineStatus
==
3
||
item
.
ExamineStatus
==
4
)
(
item
.
ExamineStatus
==
0
||
item
.
ExamineStatus
==
3
||
item
.
ExamineStatus
==
4
)
},
},
...
...
src/components/exam/exampublishlist.vue
View file @
c07399bf
...
@@ -20,7 +20,8 @@
...
@@ -20,7 +20,8 @@
</
template
>
</
template
>
<
template
v-slot:body-cell-optioned=
"props"
>
<
template
v-slot:body-cell-optioned=
"props"
>
<q-td
:props=
"props"
>
<q-td
:props=
"props"
>
<q-btn
flat
size=
"xs"
v-if=
"props.row.IsEdit==1"
color=
"accent"
style=
"font-weight: 400"
label=
"修改"
@
click=
"publishExam(props.row)"
/>
<!--v-if="props.row.IsEdit==1"-->
<q-btn
flat
size=
"xs"
color=
"accent"
style=
"font-weight: 400"
label=
"修改"
@
click=
"publishExam(props.row)"
/>
<q-btn-dropdown
flat
size=
"xs"
color=
"dark"
label=
"更多"
style=
"margin-left: 10px"
>
<q-btn-dropdown
flat
size=
"xs"
color=
"dark"
label=
"更多"
style=
"margin-left: 10px"
>
<q-list>
<q-list>
<q-item
clickable
v-close-popup
@
click=
"submitExamAudit(props.row)"
<q-item
clickable
v-close-popup
@
click=
"submitExamAudit(props.row)"
...
...
src/pages/exam/paperCreate.vue
View file @
c07399bf
...
@@ -98,77 +98,128 @@
...
@@ -98,77 +98,128 @@
<div
class=
"EmpLine_title"
>
<div
class=
"EmpLine_title"
>
<div
class=
"Emp_Line"
></div>
<div
class=
"Emp_Line"
></div>
<div>
试卷配置
</div>
<div>
试卷配置
</div>
<q-radio
v-model=
"templateMsg.GroupType"
:val=
"1"
label=
"问题类型"
@
input=
"getQuestionTypeStaticList"
/>
<q-radio
v-model=
"templateMsg.GroupType"
:val=
"2"
label=
"题目大类"
@
input=
"getQuestionCategoryStaticList"
/>
</div>
</div>
<!-- 分割线
<br
/>
-->
<template
v-if=
"templateMsg.GroupType==1"
>
<template
v-if=
"templateMsg&&templateMsg.TemplateData&&templateMsg.TemplateData.length>0"
>
<!-- 分割线
<br
/>
-->
<div
v-for=
"(item,index) in templateMsg.TemplateData"
:key=
"index"
class=
"examTi_List"
>
<template
v-if=
"templateMsg&&templateMsg.TemplateData&&templateMsg.TemplateData.length>0"
>
<div
class=
"examCreat_Top"
>
<div
v-for=
"(item,index) in templateMsg.TemplateData"
:key=
"index"
class=
"examTi_List"
>
<div>
{{
item
.
QuestionTypeName
}}
</div>
<div
class=
"examCreat_Top"
>
<div><i
@
click=
"delQuestion(templateMsg.TemplateData,index)"
class=
"iconfont icon-img_delete_small"
></i></div>
<div>
{{
item
.
QuestionTypeName
}}
</div>
</div>
<div><i
@
click=
"delQuestion(templateMsg.TemplateData,index)"
class=
"iconfont icon-img_delete_small"
></i>
<div
style=
"padding:0 20px 10px 20px;"
>
</div>
<div
class=
"row"
>
</div>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"item.QuestionScore"
<div
style=
"padding:0 20px 10px 20px;"
>
class=
"col-6 q-pb-lg q-pr-lg"
label=
"总分"
@
keyup
.
native=
"checkInteger(item,'QuestionScore')"
/>
<div
class=
"row"
>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"item.QuestionDesc"
class=
"col-6 q-pb-lg"
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"item.QuestionScore"
label=
"题干信息"
/>
class=
"col-6 q-pb-lg q-pr-lg"
label=
"总分"
@
keyup
.
native=
"checkInteger(item,'QuestionScore')"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"item.QuestionDesc"
class=
"col-6 q-pb-lg"
label=
"题干信息"
/>
</div>
<span>
<q-radio
v-model=
"item.ChooseType"
:val=
"1"
label=
"从题库选题"
/>
<template
v-if=
"item.ChooseType==1"
>
<span
style=
"position:relative;top:2px;"
>
共
{{
item
.
QuestionTypeNum
}}
道 抽
<el-input
style=
"width:100px;"
size=
"small"
:disabled=
"templateMsg.TemplateBankIds!=''&&item.QuestionTypeNum
<
=
0
"
@
input=
"getMaxInput(item)"
v-model=
"item.ChooseNum"
@
keyup
.
native=
"checkInteger(item,'ChooseNum')"
maxlength=
"5"
></el-input>
道
</span>
</
template
>
</span>
<br
/>
<span>
<q-radio
v-model=
"item.ChooseType"
:val=
"2"
label=
"从题库按照难易度选题"
/>
<
template
v-if=
"item.ChooseType==2"
>
<div
style=
"margin:0 0 20px 40px;"
v-for=
"(subItem,subIndex) in item.ChooseList"
:key=
"subIndex"
>
{{
subItem
.
DifficultyTypeName
}}
(共
{{
subItem
.
DifficultyTypeCount
}}
道) 抽
<el-input
style=
"width:100px;"
size=
"small"
:disabled=
"templateMsg.TemplateBankIds!=''&&subItem.DifficultyTypeCount
<
=
0
"
@
input=
"getMaxMiniInput(subItem)"
@
keyup
.
native=
"checkInteger(subItem,'ChooseNum')"
v-model=
"subItem.ChooseNum"
maxlength=
"5"
></el-input>
道
</div>
</
template
>
</span>
</div>
</div>
<span>
</div>
<q-radio
v-model=
"item.ChooseType"
:val=
"1"
label=
"从题库选题"
/>
</template>
<template
v-if=
"item.ChooseType==1"
>
<div
class=
"row"
>
<span
style=
"position:relative;top:2px;"
>
共
{{
item
.
QuestionTypeNum
}}
道 抽
<div
class=
"col-6"
>
<el-input
style=
"width:100px;"
size=
"small"
<q-btn-dropdown
color=
"primary"
label=
"添加题型"
>
:disabled=
"templateMsg.TemplateBankIds!=''&&item.QuestionTypeNum
<
=
0
"
@
input=
"getMaxInput(item)"
<q-list>
v-model=
"item.ChooseNum"
@
keyup
.
native=
"checkInteger(item,'ChooseNum')"
maxlength=
"5"
></el-input>
<q-item
clickable
v-close-popup
@
click=
"onItemClick(item)"
v-for=
"(item,index) in newQuestionTypeList"
道
</span>
:key=
"index"
>
</
template
>
<q-item-section>
</span>
<q-item-label>
{{item.Name}}
</q-item-label>
<br
/>
</q-item-section>
<span>
</q-item>
<q-radio
v-model=
"item.ChooseType"
:val=
"2"
label=
"从题库按照难易度选题"
/>
</q-list>
<
template
v-if=
"item.ChooseType==2"
>
</q-btn-dropdown>
<div
style=
"margin:0 0 20px 40px;"
v-for=
"(subItem,subIndex) in item.ChooseList"
:key=
"subIndex"
>
{{
subItem
.
DifficultyTypeName
}}
(共
{{
subItem
.
DifficultyTypeCount
}}
道) 抽
<el-input
style=
"width:100px;"
size=
"small"
:disabled=
"templateMsg.TemplateBankIds!=''&&subItem.DifficultyTypeCount
<
=
0
"
@
input=
"getMaxMiniInput(subItem)"
@
keyup
.
native=
"checkInteger(subItem,'ChooseNum')"
v-model=
"subItem.ChooseNum"
maxlength=
"5"
></el-input>
道
</div>
</
template
>
</span>
<br
/>
<span>
<q-radio
v-model=
"item.ChooseType"
:val=
"3"
label=
"从题库按照分类选题"
/>
<
template
v-if=
"item.ChooseType==3"
>
<div
style=
"margin:0 0 20px 40px;"
v-for=
"(subItem,subIndex) in item.CategoryList"
:key=
"subIndex"
>
{{
subItem
.
CategoryName
}}
(共
{{
subItem
.
QuestionTypeNum
}}
道) 抽
<el-input
style=
"width:100px;"
size=
"small"
@
input=
"getMaxMiniCategoryInput(subItem)"
@
keyup
.
native=
"checkInteger(subItem,'ChooseNum')"
v-model=
"subItem.ChooseNum"
maxlength=
"5"
>
</el-input>
道
</div>
</
template
>
</span>
</div>
</div>
</div>
</div>
</template>
</template>
<div
class=
"row"
>
<
template
v-if=
"templateMsg.GroupType==2"
>
<div
class=
"col-6"
>
<!-- 分割线
<br
/>
-->
<q-btn-dropdown
color=
"primary"
label=
"添加题型"
>
<template
v-if=
"templateMsg&&templateMsg.TemplateData&&templateMsg.TemplateData.length>0"
>
<q-list>
<div
v-for=
"(item,index) in templateMsg.TemplateData"
:key=
"index"
class=
"examTi_List"
>
<q-item
clickable
v-close-popup
@
click=
"onItemClick(item)"
v-for=
"(item,index) in questionTypeList"
<div
class=
"examCreat_Top"
>
:key=
"index"
>
<div>
{{
item
.
QuestionTypeName
}}
</div>
<q-item-section>
<div><i
@
click=
"delQuestion(templateMsg.TemplateData,index)"
class=
"iconfont icon-img_delete_small"
></i>
<q-item-label>
{{item.Name}}
</q-item-label>
</div>
</q-item-section>
</div>
</q-item>
<div
style=
"padding:0 20px 10px 20px;"
>
</q-list>
<div
class=
"row"
>
</q-btn-dropdown>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"item.QuestionScore"
class=
"col-6 q-pb-lg q-pr-lg"
label=
"总分"
@
keyup
.
native=
"checkInteger(item,'QuestionScore')"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"item.QuestionDesc"
class=
"col-6 q-pb-lg"
label=
"题干信息"
/>
</div>
<span>
<q-radio
v-model=
"item.ChooseType"
:val=
"1"
label=
"从题库选题"
/>
<template
v-if=
"item.ChooseType==1"
>
<span
style=
"position:relative;top:2px;"
>
共
{{
item
.
QuestionTypeNum
}}
道 抽
<el-input
style=
"width:100px;"
size=
"small"
:disabled=
"templateMsg.TemplateBankIds!=''&&item.QuestionTypeNum
<
=
0
"
@
input=
"getMaxInput(item)"
v-model=
"item.ChooseNum"
@
keyup
.
native=
"checkInteger(item,'ChooseNum')"
maxlength=
"5"
></el-input>
道
</span>
</
template
>
</span>
<br
/>
<span>
<q-radio
v-model=
"item.ChooseType"
:val=
"2"
label=
"从题库按照难易度选题"
/>
<
template
v-if=
"item.ChooseType==2"
>
<div
style=
"margin:0 0 20px 40px;"
v-for=
"(subItem,subIndex) in item.ChooseList"
:key=
"subIndex"
>
{{
subItem
.
DifficultyTypeName
}}
(共
{{
subItem
.
DifficultyTypeCount
}}
道) 抽
<el-input
style=
"width:100px;"
size=
"small"
:disabled=
"templateMsg.TemplateBankIds!=''&&subItem.DifficultyTypeCount
<
=
0
"
@
input=
"getMaxMiniInput(subItem)"
@
keyup
.
native=
"checkInteger(subItem,'ChooseNum')"
v-model=
"subItem.ChooseNum"
maxlength=
"5"
></el-input>
道
</div>
</
template
>
</span>
</div>
</div>
</template>
<div
class=
"row"
>
<div
class=
"col-6"
>
<q-btn-dropdown
color=
"primary"
label=
"添加分类"
>
<q-list>
<q-item
clickable
v-close-popup
@
click=
"onCategoryItemClick(item)"
v-for=
"(item,index) in newQuestionCategoryList"
:key=
"index"
>
<q-item-section>
<q-item-label>
{{item.QuestionTypeName}}
</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
</div>
</div>
</template>
<div
class=
"row q-mt-lg"
>
<div
class=
"row q-mt-lg"
>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
<span>
开放状态
</span>
<span>
开放状态
</span>
...
@@ -196,7 +247,8 @@
...
@@ -196,7 +247,8 @@
import
{
import
{
queryQuestionTypeList
,
queryQuestionTypeList
,
queryDifficultyType
,
queryDifficultyType
,
queryQuestionCategoryList
queryQuestionTypeStaticList
,
queryQuestionCategoryStaticList
}
from
'../../api/question/question'
}
from
'../../api/question/question'
import
{
import
{
savePaperInfo
,
savePaperInfo
,
...
@@ -220,6 +272,7 @@
...
@@ -220,6 +272,7 @@
questionDifficultyTypeList
:
[],
//难易程度列表
questionDifficultyTypeList
:
[],
//难易程度列表
//模板数据
//模板数据
templateMsg
:
{
templateMsg
:
{
GroupType
:
1
,
//类型(1-题目类型,2-题目大分类)'
TemplateId
:
0
,
//模板编号
TemplateId
:
0
,
//模板编号
TemplateName
:
""
,
//模板名称
TemplateName
:
""
,
//模板名称
TemplateScore
:
100
,
//模板分数
TemplateScore
:
100
,
//模板分数
...
@@ -234,9 +287,43 @@
...
@@ -234,9 +287,43 @@
ShowBankName
:
""
,
//显示题库名称
ShowBankName
:
""
,
//显示题库名称
BankList
:
[],
BankList
:
[],
questionTypeList
:
[],
//问题列表
questionTypeList
:
[],
//问题列表
quastionCategory
:
[],
//问题大类
saveLoading
:
false
,
saveLoading
:
false
,
QuestionArray
:
[],
QuestionArray
:
[],
AllquestionTypeList
:
[]
}
},
computed
:
{
//获取计算后的问题类型(单选题、多选他)
newQuestionTypeList
()
{
let
newArray
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
questionTypeList
));
if
(
newArray
&&
newArray
.
length
>
0
)
{
if
(
this
.
templateMsg
.
TemplateData
&&
this
.
templateMsg
.
TemplateData
.
length
>
0
)
{
this
.
templateMsg
.
TemplateData
.
forEach
(
x
=>
{
newArray
.
forEach
((
qItem
,
index
)
=>
{
if
(
x
.
QuestionTypeId
==
qItem
.
QId
)
{
newArray
.
splice
(
index
,
1
);
}
})
})
}
}
return
newArray
;
},
//获取计算后的问题分类(读音选择题、汉字选择题等)
newQuestionCategoryList
()
{
let
newArray
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
quastionCategory
));
if
(
newArray
&&
newArray
.
length
>
0
)
{
if
(
this
.
templateMsg
.
TemplateData
&&
this
.
templateMsg
.
TemplateData
.
length
>
0
)
{
this
.
templateMsg
.
TemplateData
.
forEach
(
x
=>
{
newArray
.
forEach
((
qItem
,
index
)
=>
{
if
(
x
.
QuestionTypeId
==
qItem
.
QuestionTypeId
)
{
newArray
.
splice
(
index
,
1
);
}
})
})
}
}
return
newArray
;
}
}
},
},
created
()
{
created
()
{
...
@@ -247,7 +334,8 @@
...
@@ -247,7 +334,8 @@
}
}
this
.
getQuestionType
();
this
.
getQuestionType
();
this
.
getDifficultyType
();
this
.
getDifficultyType
();
this
.
getQuestionCategoryList
();
this
.
getQuestionCategoryStaticList
();
this
.
getQuestionTypeStaticList
();
},
},
mounted
()
{
mounted
()
{
var
timeStr
=
date
.
formatDate
(
Date
.
now
(),
"YYYYMMDDHHmmss"
);
var
timeStr
=
date
.
formatDate
(
Date
.
now
(),
"YYYYMMDDHHmmss"
);
...
@@ -266,18 +354,11 @@
...
@@ -266,18 +354,11 @@
item
.
ChooseNum
=
item
.
DifficultyTypeCount
;
item
.
ChooseNum
=
item
.
DifficultyTypeCount
;
}
}
},
},
//分类
getMaxMiniCategoryInput
(
item
)
{
if
(
item
.
ChooseNum
>
item
.
QuestionTypeNum
)
{
item
.
ChooseNum
=
item
.
QuestionTypeNum
;
}
},
//获取题型列表
//获取题型列表
getQuestionType
()
{
getQuestionType
()
{
queryQuestionTypeList
({}).
then
(
res
=>
{
queryQuestionTypeList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
if
(
res
.
Code
==
1
)
{
this
.
questionTypeList
=
res
.
Data
;
this
.
questionTypeList
=
res
.
Data
;
this
.
AllquestionTypeList
=
res
.
Data
;
}
}
});
});
},
},
...
@@ -314,28 +395,35 @@
...
@@ -314,28 +395,35 @@
})
})
}
}
}
}
this
.
filterChecked
();
},
},
//
过滤已经选中
//
添加分类
filterChecked
(
type
)
{
onCategoryItemClick
(
myObj
)
{
var
NewData
=
[]
;
var
newObj
=
this
.
createdTempObj
()
;
if
(
type
==
1
)
{
if
(
myObj
)
{
NewData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllquestionTypeList
))
;
newObj
.
QuestionTypeId
=
myObj
.
QuestionTypeId
;
}
else
{
newObj
.
QuestionTypeKey
=
myObj
.
QuestionTypeKey
;
NewData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
questionTypeList
))
;
newObj
.
QuestionTypeName
=
myObj
.
QuestionTypeName
;
}
}
let
newArray
=
[];
//获取题库中的题型
if
((
this
.
templateMsg
.
TemplateData
&&
this
.
templateMsg
.
TemplateData
.
length
>
0
)
&&
(
NewData
&&
NewData
.
length
>
var
chooseQuestion
=
this
.
BankList
.
find
((
item
)
=>
{
0
))
{
return
item
.
QuestionTypeId
===
myObj
.
QuestionTypeId
;
this
.
templateMsg
.
TemplateData
.
forEach
(
x
=>
{
});
NewData
.
forEach
((
y
,
index
)
=>
{
//题库中有此题型
if
(
x
.
QuestionTypeId
==
y
.
QId
)
{
if
(
chooseQuestion
)
{
NewData
.
splice
(
index
,
1
);
newObj
.
QuestionTypeNum
=
chooseQuestion
.
QuestionTypeNum
;
}
newObj
.
ChooseList
=
chooseQuestion
.
ChooseList
;
}
if
(
newObj
&&
newObj
.
QuestionTypeId
>
0
)
{
if
(
!
this
.
checkExists
(
newObj
.
QuestionTypeId
))
{
this
.
templateMsg
.
TemplateData
.
push
(
newObj
);
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`已存在此题型,请勿重复选择!`
})
})
}
)
}
}
}
this
.
questionTypeList
=
NewData
;
},
},
//创建模板对象
//创建模板对象
createdTempObj
()
{
createdTempObj
()
{
...
@@ -367,7 +455,6 @@
...
@@ -367,7 +455,6 @@
ChooseNum
:
0
ChooseNum
:
0
}
}
],
],
CategoryList
:
[]
}
}
return
newObj
;
return
newObj
;
},
},
...
@@ -385,12 +472,37 @@
...
@@ -385,12 +472,37 @@
}
}
return
isExists
;
return
isExists
;
},
},
//获取题库题目分类列表
//获取题目(汉字选择题、读音选择题等)列表
getQuestionCategoryList
()
{
getQuestionCategoryStaticList
()
{
var
qMsg
=
{
QBankIds
:
this
.
templateMsg
.
TemplateBankIds
}
this
.
BankList
=
[];
this
.
templateMsg
.
TemplateData
=
[];
queryQuestionCategoryStaticList
(
qMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
var
tempArray
=
res
.
Data
;
if
(
tempArray
&&
tempArray
.
length
>
0
)
{
this
.
quastionCategory
=
tempArray
;
this
.
BankList
=
tempArray
;
tempArray
.
forEach
(
item
=>
{
//默认添加【单选题,多选题、填空题,单选题(数字)】
if
(
item
.
QuestionTypeId
==
1
||
item
.
QuestionTypeKey
==
2
)
{
this
.
templateMsg
.
TemplateData
.
push
(
item
);
}
})
}
}
});
},
//获取题库题目题型(单选题、多选题等)列表
getQuestionTypeStaticList
()
{
var
qMsg
=
{
var
qMsg
=
{
QBankIds
:
this
.
templateMsg
.
TemplateBankIds
QBankIds
:
this
.
templateMsg
.
TemplateBankIds
}
}
queryQuestionCategoryList
(
qMsg
).
then
(
res
=>
{
this
.
BankList
=
[];
this
.
templateMsg
.
TemplateData
=
[];
queryQuestionTypeStaticList
(
qMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
if
(
res
.
Code
==
1
)
{
var
tempArray
=
res
.
Data
;
var
tempArray
=
res
.
Data
;
if
(
tempArray
&&
tempArray
.
length
>
0
)
{
if
(
tempArray
&&
tempArray
.
length
>
0
)
{
...
@@ -421,14 +533,6 @@
...
@@ -421,14 +533,6 @@
},
},
//显示试卷模板
//显示试卷模板
showExamTemplate
()
{
showExamTemplate
()
{
// if (this.templateMsg.TemplateBankIds == '') {
// this.$q.notify({
// type: 'negative',
// position: "top",
// message: `请先选择题库`
// })
// return;
// }
this
.
isShowExamTemplate
=
true
;
this
.
isShowExamTemplate
=
true
;
},
},
//关闭题库
//关闭题库
...
@@ -456,7 +560,6 @@
...
@@ -456,7 +560,6 @@
}
}
this
.
templateMsg
.
TemplateBankIds
=
qBankIds
;
this
.
templateMsg
.
TemplateBankIds
=
qBankIds
;
this
.
ShowBankName
=
sBankName
;
this
.
ShowBankName
=
sBankName
;
this
.
getQuestionCategoryList
();
},
},
//获取模板数据
//获取模板数据
getTemplateData
(
tempObj
)
{
getTemplateData
(
tempObj
)
{
...
@@ -489,7 +592,6 @@
...
@@ -489,7 +592,6 @@
newObj
.
ChooseList
=
chooseQuestion
.
ChooseList
;
newObj
.
ChooseList
=
chooseQuestion
.
ChooseList
;
}
}
this
.
templateMsg
.
TemplateData
.
push
(
newObj
);
this
.
templateMsg
.
TemplateData
.
push
(
newObj
);
this
.
filterChecked
();
});
});
}
}
}
}
...
@@ -598,7 +700,6 @@
...
@@ -598,7 +700,6 @@
cancel
:
"取消"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
}).
onOk
(()
=>
{
item
.
splice
(
index
,
1
);
item
.
splice
(
index
,
1
);
this
.
filterChecked
(
1
);
}).
onCancel
(()
=>
{});
}).
onCancel
(()
=>
{});
}
}
}
}
...
...
src/pages/exam/paperEdit.vue
View file @
c07399bf
...
@@ -280,6 +280,11 @@
...
@@ -280,6 +280,11 @@
<q-radio
v-model=
"DataObj.IsOpen"
:val=
"1"
label=
"私有"
/>
<q-radio
v-model=
"DataObj.IsOpen"
:val=
"1"
label=
"私有"
/>
<q-radio
v-model=
"DataObj.IsOpen"
:val=
"2"
label=
"公开"
/>
<q-radio
v-model=
"DataObj.IsOpen"
:val=
"2"
label=
"公开"
/>
</div>
</div>
<div
style=
"margin:8px 0 0 20px"
>
组卷类型:
<q-radio
v-model=
"DataObj.GroupType"
:val=
"1"
label=
"问题类型"
/>
<q-radio
v-model=
"DataObj.GroupType"
:val=
"2"
label=
"题目大类"
/>
</div>
</div>
</div>
<div
style=
"width:20%;text-align:right;"
>
<div
style=
"width:20%;text-align:right;"
>
<q-btn
color=
"accent"
size=
"sm"
class=
"q-mr-md"
label=
"预览"
style=
"display:none;"
/>
<q-btn
color=
"accent"
size=
"sm"
class=
"q-mr-md"
label=
"预览"
style=
"display:none;"
/>
...
@@ -292,6 +297,16 @@
...
@@ -292,6 +297,16 @@
<p
class=
"Left-ptitel"
>
<p
class=
"Left-ptitel"
>
<span>
题量:
<i>
{{
examNum
}}
</i></span>
<span>
题量:
<i>
{{
examNum
}}
</i></span>
<span>
总分:
<i>
{{
examScore
.
toFixed
(
2
)
}}
</i></span>
<span>
总分:
<i>
{{
examScore
.
toFixed
(
2
)
}}
</i></span>
<q-btn-dropdown
color=
"primary"
label=
"添加分类"
>
<q-list>
<q-item
clickable
v-close-popup
@
click=
"onCategoryItemClick(item)"
v-for=
"(item,index) in newQuestionCategoryList"
:key=
"index"
>
<q-item-section>
<q-item-label>
{{
item
.
Name
}}
</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</p>
</p>
<div
class=
"Left-list"
>
<div
class=
"Left-list"
>
<template
v-if=
"DataObj&&DataObj.GroupList&&DataObj.GroupList.length>0"
>
<template
v-if=
"DataObj&&DataObj.GroupList&&DataObj.GroupList.length>0"
>
...
@@ -299,9 +314,11 @@
...
@@ -299,9 +314,11 @@
<div
class=
"List-bt"
>
<div
class=
"List-bt"
>
<div
class=
"paperEdit_Top"
>
<div
class=
"paperEdit_Top"
>
<template
v-if=
"!gItem.isShowEdit"
>
<template
v-if=
"!gItem.isShowEdit"
>
<div>
{{
gIndex
+
1
}}
</div>
<div
@
click=
"GetGroupItem(gItem)"
>
<div
class=
"paper_GroupName"
:title=
"gItem.GroupName"
>
{{
gItem
.
GroupName
}}
</div>
<div>
{{
gIndex
+
1
}}
</div>
<div>
(共
{{
gItem
.
DetailsList
?
gItem
.
DetailsList
.
length
:
0
}}
题,
{{
gItem
.
GScore
}}
分)
</div>
<div
class=
"paper_GroupName"
:title=
"gItem.GroupName"
>
{{
gItem
.
GroupName
}}
</div>
<div>
(共
{{
gItem
.
DetailsList
?
gItem
.
DetailsList
.
length
:
0
}}
题,
{{
gItem
.
GScore
}}
分)
</div>
</div>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<el-input
v-model=
"gItem.GroupName"
size=
"small"
maxlength=
"50"
<el-input
v-model=
"gItem.GroupName"
size=
"small"
maxlength=
"50"
...
@@ -575,7 +592,9 @@
...
@@ -575,7 +592,9 @@
PaperType
:
2
,
//试卷类型(1-文件夹,2-试卷)
PaperType
:
2
,
//试卷类型(1-文件夹,2-试卷)
ParentId
:
0
,
//父节点编号,
ParentId
:
0
,
//父节点编号,
GroupList
:
[],
//试卷答题分类
GroupList
:
[],
//试卷答题分类
IsOpen
:
1
//(1-私有,2-开放)
IsOpen
:
1
,
//(1-私有,2-开放)
GroupType
:
1
,
//组卷类型
PaperScore
:
0
,
//试卷总分数
},
},
//点击问题对象
//点击问题对象
ChooseItem
:
null
,
ChooseItem
:
null
,
...
@@ -594,6 +613,25 @@
...
@@ -594,6 +613,25 @@
ComCheckIndex
:
-
1
,
ComCheckIndex
:
-
1
,
savePaperLoading
:
false
,
savePaperLoading
:
false
,
isShowPoint
:
false
,
//选择知识点
isShowPoint
:
false
,
//选择知识点
clickGroupItem
:
null
,
//选择的分组
}
},
computed
:
{
//获取计算后的问题分类(读音选择题、汉字选择题等)
newQuestionCategoryList
()
{
let
newArray
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
questionCategoryList
));
if
(
newArray
&&
newArray
.
length
>
0
)
{
if
(
this
.
DataObj
.
GroupList
&&
this
.
DataObj
.
GroupList
.
length
>
0
)
{
this
.
DataObj
.
GroupList
.
forEach
(
x
=>
{
newArray
.
forEach
((
qItem
,
index
)
=>
{
if
(
x
.
QuestionTypeId
==
qItem
.
Id
)
{
newArray
.
splice
(
index
,
1
);
}
})
})
}
}
return
newArray
;
}
}
},
},
created
()
{
created
()
{
...
@@ -619,6 +657,22 @@
...
@@ -619,6 +657,22 @@
}
}
},
},
methods
:
{
methods
:
{
GetGroupItem
(
gItem
)
{
this
.
clickGroupItem
=
gItem
;
},
//添加分类
onCategoryItemClick
(
qObj
)
{
this
.
DataObj
.
GroupList
.
push
({
GId
:
0
,
//大题分组编号
PaperId
:
0
,
//试卷编号
GroupName
:
qObj
.
Name
,
QuestionTypeId
:
qObj
.
Id
,
QuestionTypeKey
:
""
,
GSortNum
:
0
,
GScore
:
0
,
//分数
DetailsList
:
[],
//问题列表
});
},
//关闭知识点弹窗
//关闭知识点弹窗
closeQuestionPoint
()
{
closeQuestionPoint
()
{
this
.
isShowPoint
=
false
;
this
.
isShowPoint
=
false
;
...
@@ -840,26 +894,42 @@
...
@@ -840,26 +894,42 @@
}
}
if
(
qArray
&&
qArray
.
length
>
0
)
{
if
(
qArray
&&
qArray
.
length
>
0
)
{
qArray
.
forEach
(
qItem
=>
{
qArray
.
forEach
(
qItem
=>
{
if
(
!
this
.
checkGroupExists
(
qItem
.
QuestionTypeId
))
{
var
gObj
=
{
this
.
DataObj
.
GroupList
.
push
({
GId
:
0
,
//大题分组编号
GId
:
0
,
//大题分组编号
PaperId
:
0
,
//试卷编号
PaperId
:
0
,
//试卷编号
GroupName
:
qItem
.
GroupName
,
GroupName
:
qItem
.
GroupName
,
QuestionTypeId
:
qItem
.
QuestionTypeId
,
QuestionTypeId
:
qItem
.
QuestionTypeId
,
QuestionTypeKey
:
qItem
.
QuestionTypeKey
,
QuestionTypeKey
:
qItem
.
QuestionTypeKey
,
GSortNum
:
0
,
GSortNum
:
0
,
GScore
:
0
,
//分数
GScore
:
0
,
//分数
DetailsList
:
[],
//问题列表
DetailsList
:
[],
//问题列表
});
}
}
this
.
DataObj
.
GroupList
.
forEach
((
gItem
,
gIndex
)
=>
{
//题目类型
if
(
gItem
.
QuestionTypeId
==
qItem
.
QuestionTypeId
)
{
if
(
!
this
.
checkGroupExists
(
qItem
.
QuestionTypeId
)
&&
this
.
DataObj
.
GroupType
==
1
)
{
if
(
!
gItem
.
DetailsList
)
{
this
.
DataObj
.
GroupList
.
push
(
gObj
);
gItem
.
DetailsList
=
[];
}
if
(
this
.
DataObj
.
GroupType
==
1
)
{
this
.
DataObj
.
GroupList
.
forEach
((
gItem
,
gIndex
)
=>
{
if
(
gItem
.
QuestionTypeId
==
qItem
.
QuestionTypeId
)
{
if
(
!
gItem
.
DetailsList
)
{
gItem
.
DetailsList
=
[];
}
gItem
.
DetailsList
.
push
(
qItem
);
}
}
gItem
.
DetailsList
.
push
(
qItem
);
})
}
//题目分类
else
if
(
this
.
DataObj
.
GroupType
==
2
)
{
if
(
!
this
.
clickGroupItem
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`请选择左侧分类!`
})
}
else
{
this
.
clickGroupItem
.
DetailsList
.
push
(
qItem
);
}
}
}
)
}
})
})
}
}
}
}
...
@@ -940,6 +1010,7 @@
...
@@ -940,6 +1010,7 @@
this
.
DataObj
.
PaperType
=
tempData
.
PaperType
;
this
.
DataObj
.
PaperType
=
tempData
.
PaperType
;
this
.
DataObj
.
ParentId
=
tempData
.
ParentId
;
this
.
DataObj
.
ParentId
=
tempData
.
ParentId
;
this
.
DataObj
.
IsOpen
=
tempData
.
IsOpen
;
this
.
DataObj
.
IsOpen
=
tempData
.
IsOpen
;
this
.
DataObj
.
GroupType
=
tempData
.
GroupType
;
if
(
tempData
.
GroupList
&&
tempData
.
GroupList
.
length
>
0
)
{
if
(
tempData
.
GroupList
&&
tempData
.
GroupList
.
length
>
0
)
{
this
.
DataObj
.
GroupList
=
tempData
.
GroupList
;
this
.
DataObj
.
GroupList
=
tempData
.
GroupList
;
}
}
...
@@ -1025,6 +1096,7 @@
...
@@ -1025,6 +1096,7 @@
//保存题目
//保存题目
SavePaper
()
{
SavePaper
()
{
if
(
this
.
validateType
())
{
if
(
this
.
validateType
())
{
this
.
DataObj
.
PaperScore
=
this
.
examScore
;
this
.
savePaperLoading
=
true
;
this
.
savePaperLoading
=
true
;
savePaperInfo
(
this
.
DataObj
).
then
(
res
=>
{
savePaperInfo
(
this
.
DataObj
).
then
(
res
=>
{
this
.
savePaperLoading
=
false
;
this
.
savePaperLoading
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment