|
@@ -77,12 +77,14 @@ export default {
|
|
// 将答案塞进去
|
|
// 将答案塞进去
|
|
result.data.question.map(i => {
|
|
result.data.question.map(i => {
|
|
if (!i.answer) i.type === '1' ? (i.answer = []) : '';
|
|
if (!i.answer) i.type === '1' ? (i.answer = []) : '';
|
|
- let mid = asArr.find(f => f.questionid === i.id);
|
|
|
|
|
|
+ let mid = asArr.find(f => f.questionid === i._id);
|
|
|
|
+ console.log(mid);
|
|
if (_.get(mid, `answer`)) {
|
|
if (_.get(mid, `answer`)) {
|
|
i.answer = JSON.parse(mid.answer);
|
|
i.answer = JSON.parse(mid.answer);
|
|
}
|
|
}
|
|
return i;
|
|
return i;
|
|
});
|
|
});
|
|
|
|
+
|
|
this.$set(this, `info`, { ...result.data, ...asObject });
|
|
this.$set(this, `info`, { ...result.data, ...asObject });
|
|
},
|
|
},
|
|
// 提交答案
|
|
// 提交答案
|
|
@@ -96,7 +98,12 @@ export default {
|
|
});
|
|
});
|
|
let object = { termid, batchid, classid, studentid, questionnaireid: this.id, answers };
|
|
let object = { termid, batchid, classid, studentid, questionnaireid: this.id, answers };
|
|
let res;
|
|
let res;
|
|
|
|
+
|
|
|
|
+ console.log(object);
|
|
|
|
+ console.log(answerid);
|
|
|
|
+
|
|
if (!answerid) {
|
|
if (!answerid) {
|
|
|
|
+ console.log('ccc');
|
|
res = await this.sendAnswer(object);
|
|
res = await this.sendAnswer(object);
|
|
} else {
|
|
} else {
|
|
object.id = answerid;
|
|
object.id = answerid;
|