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
a56fcf16
Commit
a56fcf16
authored
Sep 09, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
a402baba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
34 deletions
+80
-34
paperCreate.vue
src/pages/exam/paperCreate.vue
+80
-34
No files found.
src/pages/exam/paperCreate.vue
View file @
a56fcf16
...
...
@@ -10,17 +10,19 @@
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
font-size
:
20px
;
font-size
:
20px
;
}
.examTi_List
{
border
:
1px
solid
#ddd
;
margin-bottom
:
20px
;
}
.examCreat_Top
i
{
.examCreat_Top
i
{
color
:
var
(
--q-color-negative
);
font-size
:
20px
;
}
.examCreat_Top
i
:hover
{
color
:
red
;
cursor
:
pointer
;
...
...
@@ -60,6 +62,7 @@
background-color
:
#3FC4FF
;
margin-right
:
10px
;
}
</
style
>
<
template
>
<div
class=
"page-body paperCreate"
>
...
...
@@ -101,8 +104,7 @@
<div
v-for=
"(item,index) in templateMsg.TemplateData"
:key=
"index"
class=
"examTi_List"
>
<div
class=
"examCreat_Top"
>
<div>
{{
item
.
QuestionTypeName
}}
</div>
<div><i
@
click=
"delQuestion(templateMsg.TemplateData,index)"
class=
"iconfont icon-img_delete_small"
></i></div>
<div><i
@
click=
"delQuestion(templateMsg.TemplateData,index)"
class=
"iconfont icon-img_delete_small"
></i></div>
</div>
<div
style=
"padding:0 20px 10px 20px;"
>
<div
class=
"row"
>
...
...
@@ -186,6 +188,9 @@
savePaperInfo
,
savePaperTemplate
}
from
'../../api/teacher/index'
;
import
{
date
}
from
"quasar"
;
export
default
{
components
:
{
questionbankForm
,
...
...
@@ -203,8 +208,8 @@
templateMsg
:
{
TemplateId
:
0
,
//模板编号
TemplateName
:
""
,
//模板名称
TemplateScore
:
0
,
//模板分数
TemplateNum
:
0
,
//随机组卷数量
TemplateScore
:
10
0
,
//模板分数
TemplateNum
:
1
,
//随机组卷数量
TemplateDifficultyType
:
1
,
//难易程度
TemplateData
:
[],
TemplateBankIds
:
""
,
...
...
@@ -217,7 +222,7 @@
questionTypeList
:
[],
//问题列表
saveLoading
:
false
,
QuestionArray
:
[],
AllquestionTypeList
:[]
AllquestionTypeList
:
[]
}
},
created
()
{
...
...
@@ -231,18 +236,19 @@
this
.
getQuestionCategoryList
();
},
mounted
()
{
var
timeStr
=
date
.
formatDate
(
Date
.
now
(),
"YYYYMMDDHHmmss"
);
this
.
templateMsg
.
TemplateName
=
timeStr
+
"新建试卷"
;
},
methods
:
{
//设置最大值
getMaxInput
(
item
)
{
if
(
this
.
templateMsg
.
TemplateBankIds
!=
''
&&
item
.
ChooseNum
>
item
.
QuestionTypeNum
)
{
item
.
ChooseNum
=
''
;
if
(
item
.
ChooseNum
>
item
.
QuestionTypeNum
)
{
item
.
ChooseNum
=
item
.
QuestionTypeNum
;
}
},
getMaxMiniInput
(
item
)
{
if
(
this
.
templateMsg
.
TemplateBankIds
!=
''
&&
item
.
ChooseNum
>
item
.
DifficultyTypeCount
)
{
item
.
ChooseNum
=
''
;
if
(
item
.
ChooseNum
>
item
.
DifficultyTypeCount
)
{
item
.
ChooseNum
=
item
.
DifficultyTypeCount
;
}
},
//获取题型列表
...
...
@@ -289,20 +295,21 @@
this
.
filterChecked
();
},
//过滤已经选中
filterChecked
(
type
){
filterChecked
(
type
)
{
var
NewData
=
[];
if
(
type
==
1
)
{
NewData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllquestionTypeList
));
}
else
{
if
(
type
==
1
)
{
NewData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllquestionTypeList
));
}
else
{
NewData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
questionTypeList
));
}
let
newArray
=
[];
if
((
this
.
templateMsg
.
TemplateData
&&
this
.
templateMsg
.
TemplateData
.
length
>
0
)
&&
(
NewData
&&
NewData
.
length
>
0
)){
this
.
templateMsg
.
TemplateData
.
forEach
(
x
=>
{
NewData
.
forEach
((
y
,
index
)
=>
{
if
(
x
.
QuestionTypeId
==
y
.
QId
){
NewData
.
splice
(
index
,
1
);
}
if
((
this
.
templateMsg
.
TemplateData
&&
this
.
templateMsg
.
TemplateData
.
length
>
0
)
&&
(
NewData
&&
NewData
.
length
>
0
))
{
this
.
templateMsg
.
TemplateData
.
forEach
(
x
=>
{
NewData
.
forEach
((
y
,
index
)
=>
{
if
(
x
.
QuestionTypeId
==
y
.
QId
)
{
NewData
.
splice
(
index
,
1
);
}
})
})
}
...
...
@@ -466,6 +473,14 @@
},
//根据模板生成试卷
setPaperTemplate
()
{
if
(
this
.
templateMsg
.
TemplateScore
==
''
||
this
.
templateMsg
.
TemplateScore
==
0
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`请填写试卷满分`
})
return
}
if
(
this
.
templateMsg
.
TemplateNum
==
''
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
...
...
@@ -474,23 +489,54 @@
})
return
}
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
let
totalScore
=
0
;
if
(
this
.
templateMsg
&&
this
.
templateMsg
.
TemplateData
&&
this
.
templateMsg
.
TemplateData
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
templateMsg
.
TemplateData
.
length
;
i
++
)
{
var
currentItem
=
this
.
templateMsg
.
TemplateData
[
i
];
if
(
currentItem
.
QuestionScore
==
""
||
currentItem
.
QuestionScore
==
0
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`请填写第
${
i
+
1
}
题【
${
currentItem
.
QuestionTypeName
}
】总分`
})
return
}
//题库选题
if
(
currentItem
.
ChooseType
==
1
)
{
if
(
currentItem
.
ChooseNum
==
''
||
currentItem
.
ChooseNum
==
0
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`请填写第
${
i
+
1
}
题【
${
currentItem
.
QuestionTypeName
}
】的抽取题目数量`
})
return
}
}
//题库难易程度选题
else
if
(
currentItem
.
ChooseType
==
2
)
{
if
(
currentItem
.
ChooseList
&&
currentItem
.
ChooseList
.
length
>
0
)
{
var
tempChooseNum
=
0
;
currentItem
.
ChooseList
.
forEach
(
sItem
=>
{
tempChooseNum
+=
sItem
.
ChooseNum
});
if
(
tempChooseNum
<=
0
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`请填写第
${
i
+
1
}
题【
${
currentItem
.
QuestionTypeName
}
】(难易程度)抽取题目数量`
})
return
}
}
}
totalScore
+=
parseInt
(
currentItem
.
QuestionScore
);
}
TotalNum
+=
parseInt
(
this
.
templateMsg
.
TemplateData
[
i
].
QuestionScore
);
}
if
(
TotalNum
>
this
.
templateMsg
.
TemplateScore
)
{
if
(
totalScore
!=
this
.
templateMsg
.
TemplateScore
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`题目总分
之和大于满分
`
message
:
`题目总分
(
${
totalScore
}
)和试卷满分(
${
this
.
templateMsg
.
TemplateScore
}
)不相等
`
})
return
}
...
...
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