|
@@ -103,7 +103,12 @@ export default {
|
|
|
async onsave() {
|
|
|
let task = _.cloneDeep(this.task);
|
|
|
let obj = {};
|
|
|
+ console.log(this.task);
|
|
|
+ console.log(task);
|
|
|
if (!this.taskAnswer) {
|
|
|
+ console.log('as');
|
|
|
+ console.log(this.task);
|
|
|
+ console.log(task);
|
|
|
obj = {
|
|
|
termid: this.user.termid,
|
|
|
batchid: this.user.batchid,
|
|
@@ -111,10 +116,13 @@ export default {
|
|
|
lessonid: this.lessonid,
|
|
|
lessonname: this.task.name,
|
|
|
studentid: this.user.userid,
|
|
|
- taskid: this.taks.id,
|
|
|
+ taskid: this.taks ? this.task.id : task.id,
|
|
|
};
|
|
|
- } else obj = _.cloneDeep(this.taskAnswer);
|
|
|
-
|
|
|
+ console.log('1');
|
|
|
+ } else {
|
|
|
+ obj = _.cloneDeep(this.taskAnswer);
|
|
|
+ console.log('2');
|
|
|
+ }
|
|
|
let studanswer = [];
|
|
|
let { question } = task;
|
|
|
for (const quest of question) {
|
|
@@ -125,6 +133,7 @@ export default {
|
|
|
studanswer.push(obj);
|
|
|
}
|
|
|
obj.answers = studanswer;
|
|
|
+ console.log(obj);
|
|
|
if (!obj.id) {
|
|
|
let res = await this.Uploadtaskadd(obj);
|
|
|
if (this.$checkRes(res, '作业提交成功', res.errmsg || '作业提交失败')) window.history.go(-1);
|