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
fc1c9fec
Commit
fc1c9fec
authored
Aug 12, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
d6036b62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
18 deletions
+72
-18
examCreate.vue
src/pages/exam/examCreate.vue
+72
-18
No files found.
src/pages/exam/examCreate.vue
View file @
fc1c9fec
...
...
@@ -77,14 +77,13 @@
</div>
</div>
</template>
<
template
v-if=
"BankList&&BankList.length>0"
>
<div
class=
"row"
>
<q-select
filled
option-value=
"QuestionTypeId"
option-label=
"QuestionTypeName"
:options=
"BankList"
emit-value
map-options
label=
"更多题型"
class=
"col-6 q-pr-lg"
use-input
clearable
v-model=
"MoreQuestionTypeId"
@
input=
"changeQuestion"
/>
<q-checkbox
v-model=
"templateMsg.IsSaveTemplate"
label=
"同时保存为组卷模板"
/>
</div>
</
template
>
<div
class=
"row"
>
<q-select
filled
option-value=
"QId"
option-label=
"Name"
:options=
"questionTypeList"
emit-value
map-options
label=
"更多题型"
class=
"col-6 q-pr-lg"
use-input
clearable
v-model=
"MoreQuestionTypeId"
@
input=
"changeQuestion"
/>
<q-checkbox
v-model=
"templateMsg.IsSaveTemplate"
label=
"同时保存为组卷模板"
/>
</div>
<br
/>
<div
class=
"row"
>
<q-btn
color=
"accent"
size=
"sm"
@
click=
"setPaperTemplate"
class=
"q-mr-md"
label=
"保存"
/>
...
...
@@ -101,8 +100,6 @@
import
{
queryQuestionTypeList
,
queryDifficultyType
,
queryQuestionCategory
,
queryQuestionLevelType
,
queryQuestionCategoryList
}
from
'../../api/question/question'
import
{
...
...
@@ -136,24 +133,76 @@
ShowBankName
:
""
,
//显示题库名称
BankList
:
[],
MoreQuestionTypeId
:
""
,
//更多题型
questionTypeList
:
[],
//问题列表
}
},
created
()
{
this
.
getQuestionType
();
this
.
getDifficultyType
();
},
mounted
()
{
},
methods
:
{
//获取题型列表
getQuestionType
()
{
queryQuestionTypeList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
questionTypeList
=
res
.
Data
;
}
});
},
//选择添加题型
changeQuestion
()
{
if
(
this
.
MoreQuestionTypeId
&&
this
.
MoreQuestionTypeId
!=
''
)
{
//获取问题类型
var
qTypeObj
=
this
.
questionTypeList
.
find
((
item
)
=>
{
return
item
.
QId
===
this
.
MoreQuestionTypeId
;
});
var
newObj
=
{};
if
(
qTypeObj
)
{
newObj
=
{
ChooseNum
:
0
,
ChooseType
:
1
,
QuestionDesc
:
""
,
QuestionScore
:
0
,
QuestionTypeId
:
qTypeObj
.
QId
,
QuestionTypeKey
:
qTypeObj
.
Key
,
QuestionTypeName
:
qTypeObj
.
Name
,
QuestionTypeNum
:
0
,
ChooseList
:
[{
DifficultyType
:
1
,
DifficultyTypeName
:
"易"
,
DifficultyTypeCount
:
0
,
ChooseNum
:
0
},
{
DifficultyType
:
2
,
DifficultyTypeName
:
"中"
,
DifficultyTypeCount
:
35
,
ChooseNum
:
0
},
{
DifficultyType
:
3
,
DifficultyTypeName
:
"难"
,
DifficultyTypeCount
:
36
,
ChooseNum
:
0
}
]
}
}
//获取题库中的题型
var
chooseQuestion
=
this
.
BankList
.
find
((
item
)
=>
{
return
item
.
QuestionTypeId
===
this
.
MoreQuestionTypeId
;
});
if
(
chooseQuestion
&&
chooseQuestion
.
QuestionTypeId
>
0
)
{
if
(
!
this
.
checkExists
(
chooseQuestion
.
QuestionTypeId
))
{
this
.
templateMsg
.
TemplateData
.
push
(
chooseQuestion
);
//题库中有此题型
if
(
chooseQuestion
)
{
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'
,
...
...
@@ -243,13 +292,19 @@
this
.
getQuestionCategoryList
();
},
//获取模板数据
getTemplateData
(
tempArray
)
{
console
.
log
(
"tempArray"
,
tempArray
);
getTemplateData
(
tempObj
)
{
if
(
tempObj
)
{
this
.
templateMsg
.
TemplateId
=
tempObj
.
TemplateId
;
this
.
templateMsg
.
TemplateName
=
tempObj
.
TemplateName
;
this
.
templateMsg
.
TemplateNum
=
tempObj
.
TemplateNum
;
this
.
templateMsg
.
TemplateScore
=
tempObj
.
TemplateScore
;
this
.
templateMsg
.
TemplateDifficultyType
=
tempObj
.
TemplateDifficultyType
;
this
.
templateMsg
.
TemplateData
=
tempObj
.
TemplateData
;
}
},
//根据模板生成试卷
setPaperTemplate
()
{
savePaperTemplate
(
this
.
templateMsg
).
then
(
res
=>
{
console
.
log
(
"res=>"
,
res
);
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
...
...
@@ -260,8 +315,7 @@
})
this
.
$router
.
push
({
path
:
'/exam/examManagement'
,
query
:
{
}
query
:
{}
});
}
else
{
this
.
$q
.
notify
({
...
...
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