Solved minor issue (Last activity not being saved)
This commit is contained in:
parent
1a04f774d7
commit
6de9cbb52d
@ -2,7 +2,7 @@
|
|||||||
<div class="nav-buttons">
|
<div class="nav-buttons">
|
||||||
<button class='btn btn-outline-secondary' @click="$router.go(-1)">Back</button>
|
<button class='btn btn-outline-secondary' @click="$router.go(-1)">Back</button>
|
||||||
<button v-if="nextContent" class='btn btn-primary' @click="goNext()">Next</button>
|
<button v-if="nextContent" class='btn btn-primary' @click="goNext()">Next</button>
|
||||||
<button v-else class='btn btn-primary' @click="$router.push({ name: 'program', params: { code: $route.params.code}})">Finish Course</button>
|
<button v-else class='btn btn-primary' @click="finish()">Finish Course</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -21,6 +21,19 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$router.push({ name: 'content', params: { course: this.$route.params.course, type:this.nextContentType, content:this.nextContent }})
|
this.$router.push({ name: 'content', params: { course: this.$route.params.course, type:this.nextContentType, content:this.nextContent }})
|
||||||
|
},
|
||||||
|
finish() {
|
||||||
|
if(this.$route.params.type != "Quiz"){
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.www.academy.add_activity",
|
||||||
|
args: {
|
||||||
|
enrollment: this.$root.$data.enrolledCourses[this.$route.params.course],
|
||||||
|
content_type: this.$route.params.type,
|
||||||
|
content: this.$route.params.content
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.$router.push({ name: 'program', params: { code: this.$route.params.code}})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user