Commit 392e8c4e by Chao Sun

789

parent 9901c22c
...@@ -51,16 +51,7 @@ export class Page2Component implements OnInit { ...@@ -51,16 +51,7 @@ export class Page2Component implements OnInit {
options.forEach(option => { options.forEach(option => {
if (option['selected']) { if (option['selected']) {
this.selectedObj = option; this.selectedObj = option;
const ret = { this.getAnswer(this.selectedObj)
pageId: this.curPageData['pageId'],
questions: [
{
questionId: this.curPageData['questions'][0].questionId,
options: [this.selectedObj]
}
]
}
this.getAllAnswer.emit(ret);
} }
}) })
} }
......
...@@ -45,16 +45,7 @@ export class Page5Component implements OnInit { ...@@ -45,16 +45,7 @@ export class Page5Component implements OnInit {
options.forEach(option => { options.forEach(option => {
if (option['selected']) { if (option['selected']) {
this.selectedObj = option; this.selectedObj = option;
const ret = { this.getAnswer(this.selectedObj)
pageId: this.curPageData['pageId'],
questions: [
{
questionId: this.curPageData['questions'][0].questionId,
options: [this.selectedObj]
}
]
}
this.getAllAnswer.emit(ret);
} }
}) })
} }
......
...@@ -53,7 +53,14 @@ export class Page7Component implements OnInit { ...@@ -53,7 +53,14 @@ export class Page7Component implements OnInit {
if (option['selected']) { if (option['selected']) {
// console.log(this.selectedObj) // console.log(this.selectedObj)
this.selectedObj[question['questionId']] = option this.selectedObj[question['questionId']] = option
const questions = Object.keys(this.curAllQues).map(questionId => {
return { questionId, options: [this.curAllQues[questionId]] }
})
const ret = {
pageId: 7,
questions
}
this.getAllAnswer.emit(ret)
} }
}) })
}) })
......
...@@ -53,6 +53,14 @@ export class Page8Component implements OnInit { ...@@ -53,6 +53,14 @@ export class Page8Component implements OnInit {
question['options'].forEach(option => { question['options'].forEach(option => {
if (option['selected']) { if (option['selected']) {
this.selectedObj[question['questionId']] = option this.selectedObj[question['questionId']] = option
const questions = Object.keys(this.curAllQues).map(questionId => {
return { questionId, options: [this.curAllQues[questionId]] }
})
const ret = {
pageId: 8,
questions
}
this.getAllAnswer.emit(ret)
} }
}) })
}) })
......
...@@ -50,6 +50,14 @@ export class Page9Component implements OnInit { ...@@ -50,6 +50,14 @@ export class Page9Component implements OnInit {
question['options'].forEach(option => { question['options'].forEach(option => {
if (option['selected']) { if (option['selected']) {
this.selectedObj[question['questionId']] = option this.selectedObj[question['questionId']] = option
const questions = Object.keys(this.curAllQues).map(questionId => {
return { questionId, options: [this.curAllQues[questionId]] }
})
const ret = {
pageId: 9,
questions
}
this.getAllAnswer.emit(ret)
} }
}) })
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment