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
1ec9e74c
Commit
1ec9e74c
authored
Aug 27, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
fa51384d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
317 additions
and
271 deletions
+317
-271
questionconfig.js
src/api/question/questionconfig.js
+257
-1
paperEdit.vue
src/pages/exam/paperEdit.vue
+60
-270
No files found.
src/api/question/questionconfig.js
View file @
1ec9e74c
...
...
@@ -40,7 +40,7 @@ export function CreateQuestion(questionKey) {
case
"single"
:
AnswerList
=
optionListConfig
();
break
;
//单选题数字
//单选题数字
case
"single-number"
:
var
temp
=
optionListConfig
();
temp
.
forEach
((
item
,
index
)
=>
{
...
...
@@ -184,3 +184,259 @@ export function CreateQuestion(questionKey) {
}
return
AnswerList
;
}
/**
* 【单选题、多选题、数字选择题】验证
*/
export
function
chooseValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
//单选题 多选题
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
var
Num
=
0
;
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
.
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,选项
${
detailsList
[
i
].
QuestionContentObj
[
j
].
Name
}
内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
QuestionContentObj
[
j
].
IsAnswer
)
{
Num
++
}
}
if
(
Num
==
0
)
{
message
=
`请设置【
${
gName
}
】第
${
i
+
1
}
题 正确答案!`
;
return
message
;
}
}
}
return
message
;
}
/**
* 【填空题、分录题、资料题】验证
*/
export
function
fillInValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
.
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
空 答案!`
;
return
message
;
}
}
}
return
message
;
}
/**
* 【判断题】验证
*/
export
function
judgeValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
}
return
message
;
}
/**
* 【简答题、名词解释、论述题、计算题、其它题】验证
*/
export
function
shortanswerValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
Answer
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题答案!`
;
return
message
;
}
}
return
message
;
}
/**
* 【连线题】验证
*/
export
function
matchingValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
QuestionContentObj
.
length
>
0
)
{
for
(
let
p
=
0
;
p
<
detailsList
[
i
].
QuestionContentObj
[
0
].
length
;
p
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
0
][
p
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 第一组 选项
${
detailsList
[
i
].
QuestionContentObj
[
0
][
p
].
Name
}
内容!`
return
message
;
}
}
}
if
(
detailsList
[
i
].
QuestionContentObj
.
length
>
0
)
{
for
(
let
p
=
0
;
p
<
detailsList
[
i
].
QuestionContentObj
[
1
].
length
;
p
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
1
][
p
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 第二组 选项
${
detailsList
[
i
].
QuestionContentObj
[
1
][
p
].
Name
}
内容!`
return
message
;
}
}
}
}
return
message
;
}
/**
* 【排序题】验证
*/
export
function
sortingproblemValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
[
0
].
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
0
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 选项
${
detailsList
[
i
].
QuestionContentObj
[
0
][
j
].
Name
}
内容!`
return
message
;
}
}
}
}
return
message
;
}
/**
*【完型填空】验证
*/
export
function
clozeValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
.
length
;
j
++
)
{
var
Num
=
0
;
for
(
var
k
=
0
;
k
<
detailsList
[
i
].
QuestionContentObj
[
j
].
length
;
k
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
j
][
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 选项
${
detailsList
[
i
].
QuestionContentObj
[
j
][
k
].
Name
}
内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
QuestionContentObj
[
j
][
k
].
IsAnswer
)
{
Num
++
}
}
if
(
Num
==
0
)
{
message
=
`请设置【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 正确答案!`
;
return
message
;
}
}
}
}
return
message
;
}
/**
* 【阅读理解、听力题】验证
*/
export
function
readingcomprehensioValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
.
length
;
j
++
)
{
var
subQuestion
=
detailsList
[
i
].
QuestionContentObj
[
j
];
if
(
subQuestion
)
{
if
(
subQuestion
.
SubTitle
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 问题内容!`
;
return
message
;
}
//单选题、多选题
if
(
subQuestion
.
QuestionKey
==
'single'
||
subQuestion
.
QuestionKey
==
"multiple"
)
{
var
singleNum
=
0
;
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 选项
${
subQuestion
.
SubAnwser
[
k
].
Name
}
内容!`
;
return
message
;
}
if
(
subQuestion
.
SubAnwser
[
k
].
IsAnswer
)
{
singleNum
++
}
}
if
(
singleNum
==
0
)
{
message
=
`请设置【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 正确答案!`
;
return
message
;
}
}
//填空题
if
(
subQuestion
.
QuestionKey
==
"fill-in"
)
{
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 第
${
k
+
1
}
空答案!`
;
return
message
;
}
}
}
//简答题
if
(
subQuestion
.
QuestionKey
==
"short-answer"
)
{
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题答案!`
;
return
message
;
}
}
}
}
}
}
}
return
message
;
}
/**
* 【公用选项题】验证
*/
export
function
sharingchooseValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
[
0
].
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
0
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 第一组 选项
${
detailsList
[
i
].
QuestionContentObj
[
0
][
j
].
Name
}
内容!`
;
return
message
;
}
}
for
(
var
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
[
1
].
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
1
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 第二组 题干
${
j
+
1
}
内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
QuestionContentObj
[
1
][
j
].
Name
==
''
)
{
message
=
`请选择【
${
gName
}
】第
${
i
+
1
}
题 第二组 题干
${
j
+
1
}
答案!`
;
return
message
;
}
}
}
}
return
message
;
}
src/pages/exam/paperEdit.vue
View file @
1ec9e74c
...
...
@@ -37,6 +37,7 @@
border
:
1px
solid
#d9d9d9
;
margin-left
:
20px
;
}
.Left-ptitel
{
font-size
:
14px
;
color
:
#777
;
...
...
@@ -59,11 +60,13 @@
border-top
:
1px
solid
#d9d9d9
;
height
:
calc
(
100vh
-
270px
);
}
.right_TiList
{
.right_TiList
{
width
:
100%
;
overflow
:
auto
;
height
:
calc
(
100vh
-
270px
);
}
.List-ul
{
margin
:
0
;
padding
:
0
;
...
...
@@ -190,6 +193,7 @@
-webkit-box-shadow
:
-webkit-gradient
(
linear
,
0
0
,
0
100%
,
color-stop
(
.5
,
rgba
(
255
,
255
,
255
,
.2
)),
color-stop
(
.5
,
transparent
),
to
(
transparent
));
background-color
:
#0ae
;
}
.right_TiList
::-webkit-scrollbar
{
width
:
3px
;
height
:
3px
;
...
...
@@ -209,6 +213,7 @@
-webkit-box-shadow
:
-webkit-gradient
(
linear
,
0
0
,
0
100%
,
color-stop
(
.5
,
rgba
(
255
,
255
,
255
,
.2
)),
color-stop
(
.5
,
transparent
),
to
(
transparent
));
background-color
:
#0ae
;
}
.commonDalei
{
display
:
flex
;
align-content
:
center
;
...
...
@@ -240,22 +245,26 @@
.exam_ListSHow
i
:hover
{
color
:
#2961fe
;
}
.paper_GroupName
{
max-width
:
40%
;
.paper_GroupName
{
max-width
:
40%
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
margin-right
:
5px
;
margin-right
:
5px
;
}
.paperEdit_Top
{
.paperEdit_Top
{
display
:
flex
;
font-weight
:
bold
;
position
:
relative
;
}
.paperEdit_Top
i
{
color
:
#555
;
.paperEdit_Top
i
{
color
:
#555
;
font-weight
:
normal
;
}
</
style
>
<
template
>
<div
class=
"examPaper page-body"
>
...
...
@@ -308,22 +317,25 @@
v-if=
"gIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
style=
"margin-right:5px;"
@
click
.
stop=
"MoveFatherItem(gIndex,1)"
v-if=
"gIndex!=DataObj.GroupList.length-1"
></i>
<i
class=
"iconfont icon-shanchu2"
style=
"font-size:18px;"
@
click
.
stop=
"removeFather(gItem,gIndex)"
></i>
<i
class=
"iconfont icon-shanchu2"
style=
"font-size:18px;"
@
click
.
stop=
"removeFather(gItem,gIndex)"
></i>
</div>
</div>
</div>
<ul
class=
"List-ul"
v-if=
"gItem.DetailsList&&gItem.DetailsList.length>0"
>
<li
class=
""
style=
"cursor:pointer;position:relative;"
:class=
"{'checkUl':dIndex==ComCheckIndex&&gIndex==ComOneIndex}"
<li
class=
""
style=
"cursor:pointer;position:relative;"
:class=
"{'checkUl':dIndex==ComCheckIndex&&gIndex==ComOneIndex}"
v-for=
"(dItem,dIndex) in gItem.DetailsList"
:key=
"dIndex"
@
click=
"ClickItem(dItem,gIndex,dIndex)"
>
({{dIndex+1}})
<span
class=
"exam_DetailList"
v-html=
"dItem.ShowTitle"
></span>
<span
style=
"position:absolute;right:5px;"
>
<el-tag
type=
"warning"
size=
"mini"
style=
"margin-right:5px;"
v-if=
"getRepeat(dItem.QuestionId,gItem.DetailsList)&&dIndex+1!=getIndex(dItem.QuestionId,gItem.DetailsList)"
>
与{{gIndex+1}}.{{getIndex(dItem.QuestionId,gItem.DetailsList)}}重复出现
</el-tag>
<el-tag
type=
"warning"
size=
"mini"
style=
"margin-right:5px;"
v-if=
"getRepeat(dItem.QuestionId,gItem.DetailsList)&&dIndex+1!=getIndex(dItem.QuestionId,gItem.DetailsList)"
>
与{{gIndex+1}}.{{getIndex(dItem.QuestionId,gItem.DetailsList)}}重复出现
</el-tag>
<span
class=
"exam_ListSHow"
>
<i
class=
"iconfont icon-shangyi2"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,0)"
style=
"margin-right:5px;"
v-if=
"dIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
style=
"margin-right:5px;"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,1)"
v-if=
"dIndex!=gItem.DetailsList.length-1"
></i>
<i
class=
"iconfont icon-xiayi"
style=
"margin-right:5px;"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,1)"
v-if=
"dIndex!=gItem.DetailsList.length-1"
></i>
<i
class=
"iconfont icon-shanchu2"
@
click
.
stop=
"delExam(gItem.DetailsList,dItem,dIndex)"
style=
"font-size:17px;"
></i>
</span>
...
...
@@ -477,6 +489,15 @@
}
from
'../../api/teacher/index'
;
import
{
CreateQuestion
,
//生成问题
chooseValidate
,
//【单选题、多选题、数字选择题】验证
fillInValidate
,
//【填空题、分录题、资料题】验证
judgeValidate
,
//【判断题】验证
shortanswerValidate
,
//【简答题、名词解释、论述题、计算题、其它题】验证
matchingValidate
,
//【连线题】验证
sortingproblemValidate
,
//【排序题】验证
clozeValidate
,
//【完型填空】验证
readingcomprehensioValidate
,
//【阅读理解、听力题】验证
sharingchooseValidate
,
//【公用选项题】验证
}
from
'../../api/question/questionconfig'
import
{
queryQuestionTypeList
,
...
...
@@ -629,7 +650,7 @@
sItem
.
Score
=
avgScore
;
})
}
},
//上移下移(IsUp:0上移,1下移)
MoveFatherItem
(
subIndex
,
IsUp
)
{
...
...
@@ -957,8 +978,6 @@
path
:
'/exam/examPaper'
,
query
:
{}
});
// this.ChooseItem = null;
// this.GetPaperInfo();
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
...
...
@@ -985,79 +1004,79 @@
switch
(
newKey
)
{
//单选题
case
"single"
:
retMessage
=
this
.
chooseValidate
(
gName
,
detailsList
);
retMessage
=
chooseValidate
(
gName
,
detailsList
);
break
;
//多选题
case
'multiple'
:
retMessage
=
this
.
chooseValidate
(
gName
,
detailsList
);
retMessage
=
chooseValidate
(
gName
,
detailsList
);
break
;
//填空题
case
"fill-in"
:
retMessage
=
this
.
fillInValidate
(
gName
,
detailsList
);
retMessage
=
fillInValidate
(
gName
,
detailsList
);
break
;
//判断题
case
"judge"
:
retMessage
=
this
.
judgeValidate
(
gName
,
detailsList
);
retMessage
=
judgeValidate
(
gName
,
detailsList
);
break
;
//简答题
case
"short-answer"
:
retMessage
=
this
.
shortanswerValidate
(
gName
,
detailsList
);
retMessage
=
shortanswerValidate
(
gName
,
detailsList
);
break
;
//名词解释
case
"noun-explanation"
:
retMessage
=
this
.
shortanswerValidate
(
gName
,
detailsList
);
retMessage
=
shortanswerValidate
(
gName
,
detailsList
);
break
;
//论述题
case
"essay-question"
:
retMessage
=
this
.
shortanswerValidate
(
gName
,
detailsList
);
retMessage
=
shortanswerValidate
(
gName
,
detailsList
);
break
;
//计算题
case
"calculation"
:
retMessage
=
this
.
shortanswerValidate
(
gName
,
detailsList
);
retMessage
=
shortanswerValidate
(
gName
,
detailsList
);
break
;
//分录题
case
"entry-problem"
:
retMessage
=
this
.
fillInValidate
(
gName
,
detailsList
);
retMessage
=
fillInValidate
(
gName
,
detailsList
);
break
;
//资料题
case
"data-question"
:
retMessage
=
this
.
fillInValidate
(
gName
,
detailsList
);
retMessage
=
fillInValidate
(
gName
,
detailsList
);
break
;
//连线题
case
"matching"
:
retMessage
=
this
.
matchingValidate
(
gName
,
detailsList
);
retMessage
=
matchingValidate
(
gName
,
detailsList
);
break
;
//排序题
case
"sorting-problem"
:
retMessage
=
this
.
sortingproblemValidate
(
gName
,
detailsList
);
retMessage
=
sortingproblemValidate
(
gName
,
detailsList
);
break
;
//完型填空
case
"cloze"
:
retMessage
=
this
.
clozeValidate
(
gName
,
detailsList
);
retMessage
=
clozeValidate
(
gName
,
detailsList
);
break
;
//阅读理解
case
"reading-comprehensio"
:
retMessage
=
this
.
readingcomprehensioValidate
(
gName
,
detailsList
);
retMessage
=
readingcomprehensioValidate
(
gName
,
detailsList
);
break
;
//口语题
case
"spoken"
:
retMessage
=
this
.
shortanswerValidate
(
gName
,
detailsList
);
retMessage
=
shortanswerValidate
(
gName
,
detailsList
);
break
;
//听力题
case
"listening"
:
retMessage
=
this
.
readingcomprehensioValidate
(
gName
,
detailsList
);
retMessage
=
readingcomprehensioValidate
(
gName
,
detailsList
);
break
;
//公用选项题
case
"sharing-choose"
:
retMessage
=
this
.
sharingchooseValidate
(
gName
,
detailsList
);
retMessage
=
sharingchooseValidate
(
gName
,
detailsList
);
break
;
//其它题
case
"other"
:
retMessage
=
this
.
shortanswerValidate
(
gName
,
detailsList
);
retMessage
=
shortanswerValidate
(
gName
,
detailsList
);
break
;
//单选题-数字
case
"single-number"
:
retMessage
=
this
.
chooseValidate
(
gName
,
detailsList
);
retMessage
=
chooseValidate
(
gName
,
detailsList
);
break
;
}
if
(
retMessage
!=
''
)
{
...
...
@@ -1073,235 +1092,6 @@
}
return
result
;
},
//【单选题、多选题、数字选择题】验证
chooseValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
//单选题 多选题
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
var
Num
=
0
;
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
.
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,选项
${
detailsList
[
i
].
QuestionContentObj
[
j
].
Name
}
内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
QuestionContentObj
[
j
].
IsAnswer
)
{
Num
++
}
}
if
(
Num
==
0
)
{
message
=
`请设置【
${
gName
}
】第
${
i
+
1
}
题 正确答案!`
;
return
message
;
}
}
}
return
message
;
},
//【填空题、分录题、资料题】验证
fillInValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
.
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
空 答案!`
;
return
message
;
}
}
}
return
message
;
},
//【判断题】验证
judgeValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
}
return
message
;
},
//【简答题、名词解释、论述题、计算题、其它题】验证
shortanswerValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
Answer
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题答案!`
;
return
message
;
}
}
return
message
;
},
//【连线题】验证
matchingValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
QuestionContentObj
.
length
>
0
)
{
for
(
let
p
=
0
;
p
<
detailsList
[
i
].
QuestionContentObj
[
0
].
length
;
p
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
0
][
p
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 第一组 选项
${
detailsList
[
i
].
QuestionContentObj
[
0
][
p
].
Name
}
内容!`
return
message
;
}
}
}
if
(
detailsList
[
i
].
QuestionContentObj
.
length
>
0
)
{
for
(
let
p
=
0
;
p
<
detailsList
[
i
].
QuestionContentObj
[
1
].
length
;
p
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
1
][
p
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 第二组 选项
${
detailsList
[
i
].
QuestionContentObj
[
1
][
p
].
Name
}
内容!`
return
message
;
}
}
}
}
return
message
;
},
//【排序题】验证
sortingproblemValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
[
0
].
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
0
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 选项
${
detailsList
[
i
].
QuestionContentObj
[
0
][
j
].
Name
}
内容!`
return
message
;
}
}
}
}
return
message
;
},
//【完型填空】验证
clozeValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
.
length
;
j
++
)
{
var
Num
=
0
;
for
(
var
k
=
0
;
k
<
detailsList
[
i
].
QuestionContentObj
[
j
].
length
;
k
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
j
][
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 选项
${
detailsList
[
i
].
QuestionContentObj
[
j
][
k
].
Name
}
内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
QuestionContentObj
[
j
][
k
].
IsAnswer
)
{
Num
++
}
}
if
(
Num
==
0
)
{
message
=
`请设置【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 正确答案!`
;
return
message
;
}
}
}
}
return
message
;
},
//【阅读理解、听力题】验证
readingcomprehensioValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
if
(
detailsList
[
i
].
Title
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 问题内容!`
;
return
message
;
}
for
(
let
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
.
length
;
j
++
)
{
var
subQuestion
=
detailsList
[
i
].
QuestionContentObj
[
j
];
if
(
subQuestion
)
{
if
(
subQuestion
.
SubTitle
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 问题内容!`
;
return
message
;
}
//单选题、多选题
if
(
subQuestion
.
QuestionKey
==
'single'
||
subQuestion
.
QuestionKey
==
"multiple"
)
{
var
singleNum
=
0
;
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 选项
${
subQuestion
.
SubAnwser
[
k
].
Name
}
内容!`
;
return
message
;
}
if
(
subQuestion
.
SubAnwser
[
k
].
IsAnswer
)
{
singleNum
++
}
}
if
(
singleNum
==
0
)
{
message
=
`请设置【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 正确答案!`
;
return
message
;
}
}
//填空题
if
(
subQuestion
.
QuestionKey
==
"fill-in"
)
{
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题 第
${
k
+
1
}
空答案!`
;
return
message
;
}
}
}
//简答题
if
(
subQuestion
.
QuestionKey
==
"short-answer"
)
{
for
(
var
k
=
0
;
k
<
subQuestion
.
SubAnwser
.
length
;
k
++
)
{
if
(
subQuestion
.
SubAnwser
[
k
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题,第
${
j
+
1
}
小题答案!`
;
return
message
;
}
}
}
}
}
}
}
return
message
;
},
//【公用选项题】验证
sharingchooseValidate
(
gName
,
detailsList
)
{
var
message
=
""
;
if
(
detailsList
&&
detailsList
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
detailsList
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
[
0
].
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
0
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 第一组 选项
${
detailsList
[
i
].
QuestionContentObj
[
0
][
j
].
Name
}
内容!`
;
return
message
;
}
}
for
(
var
j
=
0
;
j
<
detailsList
[
i
].
QuestionContentObj
[
1
].
length
;
j
++
)
{
if
(
detailsList
[
i
].
QuestionContentObj
[
1
][
j
].
Content
==
''
)
{
message
=
`请填写【
${
gName
}
】第
${
i
+
1
}
题 第二组 题干
${
j
+
1
}
内容!`
;
return
message
;
}
if
(
detailsList
[
i
].
QuestionContentObj
[
1
][
j
].
Name
==
''
)
{
message
=
`请选择【
${
gName
}
】第
${
i
+
1
}
题 第二组 题干
${
j
+
1
}
答案!`
;
return
message
;
}
}
}
}
return
message
;
},
//关闭弹窗
closeQuestForm
()
{
this
.
isShowQuestion
=
false
;
...
...
@@ -1342,20 +1132,20 @@
this
.
isShowQuestion
=
false
;
},
//获取相同
getRepeat
(
QuestionId
,
Arr
)
{
let
Num
=
0
;
Arr
.
forEach
((
x
,
index
)
=>
{
getRepeat
(
QuestionId
,
Arr
)
{
let
Num
=
0
;
Arr
.
forEach
((
x
,
index
)
=>
{
if
(
x
.
QuestionId
==
QuestionId
)
{
Num
++
;
}
})
if
(
Num
>
1
)
{
if
(
Num
>
1
)
{
return
true
}
},
getIndex
(
Id
,
Arr
)
{
getIndex
(
Id
,
Arr
)
{
const
index
=
Arr
.
findIndex
(
d
=>
d
.
QuestionId
===
Id
);
return
index
+
1
;
return
index
+
1
;
}
}
}
...
...
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