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
826ac2ec
Commit
826ac2ec
authored
Aug 16, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
11dd04c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
25 deletions
+50
-25
examCreate.vue
src/pages/exam/examCreate.vue
+49
-24
examManagement.vue
src/pages/exam/examManagement.vue
+1
-1
No files found.
src/pages/exam/examCreate.vue
View file @
826ac2ec
...
...
@@ -23,17 +23,19 @@
<
template
>
<div
class=
"page-body"
>
组卷题库(
<span
style=
"color:red;"
>
*
</span>
):
{{
ShowBankName
}}
<br
/>
<a
style=
"cursor:pointer;color:blue;margin:10px 0 10px 0;display:inline-block;"
@
click=
"showQuestionBank"
>
选择题库
</a>
<br
/>
<a
style=
"cursor:pointer;color:blue;margin-bottom:10px;display:inline-block;"
@
click=
"showExamTemplate"
>
选择模板
</a>
<br
/>
<a
style=
"cursor:pointer;color:blue;margin:10px 0 10px 0;display:inline-block;"
@
click=
"showQuestionBank"
>
选择题库
</a>
<br
/>
<a
style=
"cursor:pointer;color:blue;margin-bottom:10px;display:inline-block;"
@
click=
"showExamTemplate"
>
选择模板
</a>
<br
/>
<div
class=
"row"
>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"templateMsg.TemplateName"
class=
"col-6 q-pb-lg q-pr-lg"
label=
"试卷标题"
/>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"templateMsg.TemplateScore"
class=
"col-6 q-pb-lg"
<q-input
filled
stack-label
maxlength=
"5"
@
keyup
.
native=
"checkInteger(templateMsg,'TemplateScore')"
:dense=
"false"
v-model=
"templateMsg.TemplateScore"
class=
"col-6 q-pb-lg"
label=
"满分"
/>
</div>
<div
class=
"row"
>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"templateMsg.TemplateNum"
class=
"col-6 q-pb-lg q-pr-lg"
label=
"随机组卷数量"
/>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
ref=
"TemplateNum"
v-model=
"templateMsg.TemplateNum"
class=
"col-6 q-pb-lg q-pr-lg"
label=
"随机组卷数量"
@
keyup
.
native=
"checkInteger(templateMsg,'TemplateNum')"
:rules=
"[val => !!val || '请填写随机组卷数量']"
/>
<q-select
filled
option-value=
"Id"
option-label=
"Name"
:options=
"questionDifficultyTypeList"
emit-value
map-options
label=
"难易程度"
class=
"col-6"
use-input
clearable
v-model=
"templateMsg.TemplateDifficultyType"
/>
</div>
...
...
@@ -46,7 +48,7 @@
<div
style=
"padding:0 20px 10px 20px;"
>
<div
class=
"row"
>
<q-input
filled
stack-label
maxlength=
"5"
:dense=
"false"
v-model=
"item.QuestionScore"
class=
"col-6 q-pb-lg q-pr-lg"
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>
...
...
@@ -54,7 +56,7 @@
<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"
v-model=
"item.ChooseNum
"
maxlength=
"5"
></el-input>
<el-input
style=
"width:100px;"
size=
"small"
:disabled=
"item.QuestionTypeNum
<
=
0
"
v-model=
"item.ChooseNum"
@
keyup
.
native=
"checkInteger(item,'ChooseNum')
"
maxlength=
"5"
></el-input>
道
</span>
</
template
>
</span>
...
...
@@ -65,7 +67,7 @@
<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"
v-model=
"subItem.ChooseNum"
maxlength=
"5"
></el-input>
<el-input
style=
"width:100px;"
size=
"small"
:disabled=
"subItem.DifficultyTypeCount
<
=
0
"
@
keyup
.
native=
"checkInteger(subItem,'ChooseNum')"
v-model=
"subItem.ChooseNum"
maxlength=
"5"
></el-input>
道
</div>
</
template
>
...
...
@@ -339,27 +341,50 @@
},
//根据模板生成试卷
setPaperTemplate
()
{
savePaperTemplate
(
this
.
templateMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'创建试卷成功!'
,
position
:
'top'
})
this
.
$router
.
push
({
path
:
'/exam/examManagement'
,
query
:
{}
});
}
else
{
this
.
$refs
.
TemplateNum
.
validate
()
if
(
!
this
.
$refs
.
TemplateNum
.
hasError
)
{
let
TotalNum
=
0
;
for
(
let
i
=
0
;
i
<
this
.
templateMsg
.
TemplateData
.
length
;
i
++
){
if
(
this
.
templateMsg
.
TemplateData
[
i
].
ChooseType
==
1
&&
this
.
templateMsg
.
TemplateData
[
i
].
ChooseNum
==
''
){
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`请填写第
${
i
+
1
}
题的抽取数`
})
return
}
TotalNum
+=
parseInt
(
this
.
templateMsg
.
TemplateData
[
i
].
QuestionScore
);
}
if
(
TotalNum
>
this
.
templateMsg
.
TemplateScore
){
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`
操作失败!
`
message
:
`
题目总分之和大于满分
`
})
return
}
});
savePaperTemplate
(
this
.
templateMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'创建试卷成功!'
,
position
:
'top'
})
this
.
$router
.
push
({
path
:
'/exam/examManagement'
,
query
:
{}
});
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`操作失败!`
})
}
});
}
}
}
}
...
...
src/pages/exam/examManagement.vue
View file @
826ac2ec
...
...
@@ -53,7 +53,7 @@
<q-list>
<q-item
clickable
v-close-popup
@
click=
"CreatePaper()"
>
<q-item-section>
<q-item-label>
自动
组卷
</q-item-label>
<q-item-label>
智能
组卷
</q-item-label>
</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@
click=
"goExameEdit(null)"
>
...
...
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