Commit eccb2529 by Chao Sun

添加questionName

parent 256da1ee
......@@ -32,6 +32,7 @@ export class Page2Component implements OnInit {
questions: [
{
questionId: this.curPageData['questions'][0].questionId,
questionName: this.curPageData['questions'][0].questionName,
options: [option]
}
]
......@@ -39,6 +40,7 @@ export class Page2Component implements OnInit {
// console.log(this.curPageData['questions']);
// console.log(ret.questions)
this.getAllAnswer.emit(ret);
console.log(ret)
// console.log(ret)
}
......
......@@ -69,6 +69,7 @@ export class Page3Component implements OnInit {
pageId: 3,
questions
};
console.log(ret)
this.getAllAnswer.emit(ret);
}
......
......@@ -31,6 +31,7 @@ export class Page4Component implements OnInit {
questions: [
{
questionId: this.curPageData['questions'][0].questionId,
questionName:this.curPageData['questions'][0].questionName,
options: [option]
}
]
......
......@@ -31,6 +31,7 @@ export class Page5Component implements OnInit {
questions: [
{
questionId: this.curPageData['questions'][0].questionId,
questionName:this.curPageData['questions'][0].questionName,
options: [option]
}
]
......@@ -45,7 +46,6 @@ export class Page5Component implements OnInit {
options.forEach(option => {
if (option['selected']) {
this.selectedObj = option;
console.log(this.selectedObj)
this.getAnswer(this.selectedObj)
}
})
......
......@@ -21,6 +21,7 @@ export class Page7Component implements OnInit {
this.setOptionSelected()
}
getAnswer(question, options) {
debugger;
//获取当前页面问题id
const questionId = question['questionId']
if (!this.selectedObj[questionId]) {
......@@ -35,9 +36,10 @@ export class Page7Component implements OnInit {
}
this.curAllQues[questionId] = options
const questions = Object.keys(this.curAllQues).map(questionId => {
return { questionId, options: [this.curAllQues[questionId]] }
return { questionId,
options: [this.curAllQues[questionId]]
}
})
for (let j = 0; j < this.questions.length; j++) {
for (let i = 0; i < questions.length; i++) {
if (questions[i]['questionId'] != this.questions[j]['questionId']) {
......@@ -51,6 +53,7 @@ export class Page7Component implements OnInit {
pageId: 7,
questions
}
// console.log(ret)
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