Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
allCampaign
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
allCampaign
Commits
256da1ee
Commit
256da1ee
authored
May 17, 2019
by
Chao Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
判断问题长度和答案长度是否匹配
parent
da97f053
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
questionnair/src/app/ask/ask.component.ts
+22
-14
questionnair/src/app/page16/page16.component.ts
+1
-0
questionnair/src/app/page3/page3.component.ts
+0
-2
No files found.
questionnair/src/app/ask/ask.component.ts
View file @
256da1ee
...
...
@@ -130,29 +130,37 @@ export class AskComponent implements OnInit {
getAllAnswer
(
e
)
{
this
.
questionInfo
=
e
;
// console.log(e)
// debugger;
const
page2Answer
=
this
.
allAnswers
[
1
]
if
(
this
.
curPage
==
6
||
this
.
curPage
==
8
){
const
optionId
=
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
if
(
optionId
==
1
||
optionId
==
3
){
if
(
e
[
'questions'
].
length
>
0
){
this
.
nextBtn
=
true
}
}
}
//判断当前问题长度和当前回答长度
if
(
this
.
curPageData
[
'questions'
].
length
==
e
[
'questions'
].
length
){
for
(
let
i
=
0
;
i
<
e
[
'questions'
].
length
;
i
++
){
if
(
e
[
'questions'
][
i
][
'options'
].
length
>
0
){
for
(
let
j
=
0
;
j
<
e
[
'questions'
][
i
][
'options'
].
length
;
j
++
){
if
(
!
e
[
'questions'
][
i
][
'options'
][
j
][
'optionId'
]){
this
.
nextBtn
=
false
}
else
{
this
.
nextBtn
=
true
if
(
this
.
curPage
==
15
){
this
.
nextBtn
=
true
}
else
{
for
(
let
j
=
0
;
j
<
e
[
'questions'
][
i
][
'options'
].
length
;
j
++
){
if
(
!
e
[
'questions'
][
i
][
'options'
][
j
][
'optionId'
]){
this
.
nextBtn
=
false
}
else
{
this
.
nextBtn
=
true
}
}
}
}
}
}
else
{
this
.
nextBtn
=
false
//如果问题长度和答案长度不一样时判断问题页中是否配偶问题不显示
if
(
this
.
curPage
==
6
||
this
.
curPage
==
8
){
const
optionId
=
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
if
(
optionId
==
1
||
optionId
==
3
){
if
(
e
[
'questions'
].
length
>
0
){
this
.
nextBtn
=
true
}
}
}
else
{
this
.
nextBtn
=
false
;
}
}
}
setCurPageData
()
{
...
...
questionnair/src/app/page16/page16.component.ts
View file @
256da1ee
...
...
@@ -97,6 +97,7 @@ export class Page16Component implements OnInit {
]
}
this
.
getAllAnswer
.
emit
(
ret
)
console
.
log
(
ret
)
}
setOptionSelected
()
{
...
...
questionnair/src/app/page3/page3.component.ts
View file @
256da1ee
...
...
@@ -69,7 +69,6 @@ export class Page3Component implements OnInit {
pageId
:
3
,
questions
};
console
.
log
(
ret
);
this
.
getAllAnswer
.
emit
(
ret
);
}
...
...
@@ -110,7 +109,6 @@ export class Page3Component implements OnInit {
pageId
:
3
,
questions
:
this
.
questions
};
console
.
log
(
ret
);
this
.
getAllAnswer
.
emit
(
ret
);
}
...
...
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