From def3e3d372aa50e7e4cdd4f14269ffef551f3001 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 8 Apr 2026 11:02:42 +0530 Subject: [PATCH 1/3] fix: mark for review should only be allowed when showing answers is disabled --- frontend/src/components/Quiz.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/Quiz.vue b/frontend/src/components/Quiz.vue index 84e17442..31c92540 100644 --- a/frontend/src/components/Quiz.vue +++ b/frontend/src/components/Quiz.vue @@ -224,6 +224,7 @@
@@ -289,12 +291,18 @@ activeQuestion != questions.length && quiz.data.show_answers " @click="nextQuestion()" + class="ml-auto" > {{ __('Next') }} -
- {{ __('Assignment Question') }} + {{ __('Assignment') }}: {{ assignment.data.title }}
{ } } -const addNewSubmission = () => { +const prepareSubmissionDoc = () => { let doc = { doctype: 'LMS Assignment Submission', assignment: props.assignmentID, @@ -311,24 +311,31 @@ const addNewSubmission = () => { } else { doc.assignment_attachment = attachment.value } + return doc +} + +const addNewSubmission = () => { + let doc = prepareSubmissionDoc() + if (!doc.assignment_attachment && !doc.answer) { + toast.error( + __('Please provide an answer or upload a file before submitting.') + ) + return + } call('frappe.client.insert', { doc: doc, }) .then((data) => { toast.success(__('Assignment submitted successfully')) - if (router.currentRoute.value.name == 'AssignmentSubmission') { - router.push({ - name: 'AssignmentSubmission', - params: { - assignmentID: props.assignmentID, - submissionName: data.name, - }, - query: { fromLesson: router.currentRoute.value.query.fromLesson }, - }) - } else { - markLessonProgress() - router.go() - } + router.push({ + name: 'AssignmentSubmission', + params: { + assignmentID: props.assignmentID, + submissionName: data.name, + }, + query: { fromLesson: router.currentRoute.value.query.fromLesson }, + }) + markLessonProgress() isDirty.value = false submissionResource.name = data.name submissionResource.reload() @@ -372,15 +379,17 @@ const saveSubmission = (file) => { } const markLessonProgress = () => { - if (router.currentRoute.value.name == 'Lesson') { - let courseName = router.currentRoute.value.params.courseName - let chapterNumber = router.currentRoute.value.params.chapterNumber - let lessonNumber = router.currentRoute.value.params.lessonNumber + let pathname = window.location.pathname.split('/') + if (!pathname.includes('courses')) + pathname = window.parent.location.pathname.split('/') + if (pathname[2] != 'courses') return + let lessonIndex = pathname.pop().split('-') + if (lessonIndex.length == 2) { call('lms.lms.api.mark_lesson_progress', { - course: courseName, - chapter_number: chapterNumber, - lesson_number: lessonNumber, + course: pathname[3], + chapter_number: lessonIndex[0], + lesson_number: lessonIndex[1], }) } } diff --git a/lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.json b/lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.json index 485cef55..c1e6c1fa 100644 --- a/lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.json +++ b/lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.json @@ -20,11 +20,12 @@ "section_break_ydgh", "column_break_oqqy", "status", + "question", + "column_break_tbnv", "comments", "section_break_rqal", - "question", - "column_break_esgd", "course", + "column_break_esgd", "lesson" ], "fields": [ @@ -145,13 +146,17 @@ { "fieldname": "section_break_ydgh", "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_tbnv", + "fieldtype": "Column Break" } ], "grid_page_length": 50, "index_web_pages_for_search": 1, "links": [], "make_attachments_public": 1, - "modified": "2026-02-05 11:38:03.792865", + "modified": "2026-04-06 18:24:11.837953", "modified_by": "sayali@frappe.io", "module": "LMS", "name": "LMS Assignment Submission", From 0d394646d9bab1648f4287dbf150552fb82e3653 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 8 Apr 2026 12:17:10 +0530 Subject: [PATCH 3/3] fix: removed prefix from assignment and exercise list count --- frontend/src/pages/Assignments.vue | 2 +- .../src/pages/ProgrammingExercises/ProgrammingExercises.vue | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/pages/Assignments.vue b/frontend/src/pages/Assignments.vue index 038a1aa2..17a1e75a 100644 --- a/frontend/src/pages/Assignments.vue +++ b/frontend/src/pages/Assignments.vue @@ -112,7 +112,7 @@
{{ assignments.data?.length }} {{ __('of') }} - {{ totalAssignments.data }} {{ __('Assignments') }} + {{ totalAssignments.data }}
diff --git a/frontend/src/pages/ProgrammingExercises/ProgrammingExercises.vue b/frontend/src/pages/ProgrammingExercises/ProgrammingExercises.vue index c4923f06..9a1ae149 100644 --- a/frontend/src/pages/ProgrammingExercises/ProgrammingExercises.vue +++ b/frontend/src/pages/ProgrammingExercises/ProgrammingExercises.vue @@ -123,7 +123,6 @@
{{ exercises.data?.length }} {{ __('of') }} {{ totalExercises.data }} - {{ __('Exercises') }}