Fixed major bugs
This commit is contained in:
parent
53c2d5db63
commit
8951c165f0
@ -13,14 +13,13 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
addActivity() {
|
addActivity() {
|
||||||
if(this.$route.params.type != "Quiz"){
|
if(this.$route.params.type != "Quiz"){
|
||||||
lms.call({
|
lms.call("add_activity",
|
||||||
method: "add_activity",
|
{
|
||||||
args: {
|
|
||||||
enrollment: lms.store.enrolledCourses[this.$route.params.course],
|
enrollment: lms.store.enrolledCourses[this.$route.params.course],
|
||||||
content_type: this.$route.params.type,
|
content_type: this.$route.params.type,
|
||||||
content: this.$route.params.content
|
content: this.$route.params.content
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
goNext() {
|
goNext() {
|
||||||
|
@ -61,25 +61,23 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getQuizWithoutAnswers() {
|
getQuizWithoutAnswers() {
|
||||||
return lms.call({
|
return lms.call("get_quiz_without_answers",
|
||||||
method: "get_quiz_without_answers",
|
{
|
||||||
args: {
|
|
||||||
quiz_name: this.content,
|
quiz_name: this.content,
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
},
|
},
|
||||||
updateResponse(res) {
|
updateResponse(res) {
|
||||||
this.quizResponse[res.question] = (res.option)
|
this.quizResponse[res.question] = (res.option)
|
||||||
},
|
},
|
||||||
submitQuiz() {
|
submitQuiz() {
|
||||||
lms.call({
|
lms.call("evaluate_quiz",
|
||||||
method: "evaluate_quiz",
|
{
|
||||||
args: {
|
|
||||||
enrollment: lms.store.enrolledCourses[this.$route.params.course],
|
enrollment: lms.store.enrolledCourses[this.$route.params.course],
|
||||||
quiz_response: this.quizResponse,
|
quiz_response: this.quizResponse,
|
||||||
quiz_name: this.content
|
quiz_name: this.content
|
||||||
}
|
}
|
||||||
}).then(data => {
|
).then(data => {
|
||||||
this.score = data,
|
this.score = data,
|
||||||
this.submitted = true,
|
this.submitted = true,
|
||||||
this.quizResponse = null
|
this.quizResponse = null
|
||||||
|
@ -60,13 +60,12 @@ export default {
|
|||||||
this.$router.push({ name: 'content', params: { program_name: this.$route.params.program_name, course: this.nextCourse, type: this.nextContentType, content: this.nextContent}})
|
this.$router.push({ name: 'content', params: { program_name: this.$route.params.program_name, course: this.nextCourse, type: this.nextContentType, content: this.nextContent}})
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lms.call({
|
lms.call("enroll_in_program",
|
||||||
method: "enroll_in_program",
|
{
|
||||||
args:{
|
program_name: this.$route.params.program_name,
|
||||||
program_name: this.$route.params.program_name,
|
student_email_id: frappe.session.user
|
||||||
student_email_id: frappe.session.user
|
}
|
||||||
}
|
)
|
||||||
})
|
|
||||||
lms.store.updateEnrolledPrograms()
|
lms.store.updateEnrolledPrograms()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -35,20 +35,20 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getNextContent().then(data => {
|
this.getNextContent().then(data => {
|
||||||
this.nextContent = r.message.content,
|
this.nextContent = data.content,
|
||||||
this.nextContentType = r.message.content_type
|
this.nextContentType = data.content_type
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getNextContent(){
|
getNextContent(){
|
||||||
return lms.call({
|
window.t = this
|
||||||
method: "get_next_content",
|
return lms.call("get_next_content",
|
||||||
args:{
|
{
|
||||||
content: this.content,
|
content: this.content,
|
||||||
content_type: this.type,
|
content_type: this.type,
|
||||||
course: this.course
|
course: this.course
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
Loading…
Reference in New Issue
Block a user