From a44f59c3620288110e1b803f0b9bdbfa8c9a6d52 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 24 Dec 2024 21:48:45 +0530 Subject: [PATCH 1/9] feat: assignments list and form --- frontend/src/components/AppSidebar.vue | 14 +- frontend/src/components/AssessmentPlugin.vue | 75 +++++++ frontend/src/components/Assessments.vue | 4 +- frontend/src/components/BatchStudents.vue | 52 +++-- frontend/src/components/LessonHelp.vue | 30 +-- .../Modals/BatchStudentProgress.vue | 2 +- frontend/src/components/QuizPlugin.vue | 58 ----- frontend/src/pages/AssignmentForm.vue | 183 ++++++++++++++++ frontend/src/pages/AssignmentSubmission.vue | 12 +- .../src/pages/AssignmentSubmissionList.vue | 202 ++++++++++++++++++ frontend/src/pages/Assignments.vue | 123 +++++++++++ frontend/src/pages/Jobs.vue | 7 +- frontend/src/pages/QuizForm.vue | 6 +- frontend/src/router.js | 28 ++- frontend/src/utils/assignment.js | 80 +++++++ frontend/src/utils/index.js | 2 + frontend/src/utils/quiz.js | 6 +- .../lms_assignment/lms_assignment.json | 18 +- .../lms_assignment_submission.json | 29 +-- lms/lms/utils.py | 18 +- 20 files changed, 808 insertions(+), 141 deletions(-) create mode 100644 frontend/src/components/AssessmentPlugin.vue delete mode 100644 frontend/src/components/QuizPlugin.vue create mode 100644 frontend/src/pages/AssignmentForm.vue create mode 100644 frontend/src/pages/AssignmentSubmissionList.vue create mode 100644 frontend/src/pages/Assignments.vue create mode 100644 frontend/src/utils/assignment.js diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index dfc67968c..c864038f4 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -185,6 +185,17 @@ const addQuizzes = () => { } } +const addAssignments = () => { + if (isInstructor.value || isModerator.value) { + sidebarLinks.value.push({ + label: 'Assignments', + icon: 'Pencil', + to: 'Assignments', + activeFor: ['Assignments', 'AssignmentForm'], + }) + } +} + const addPrograms = () => { let activeFor = ['Programs', 'ProgramForm'] let index = 1 @@ -247,8 +258,9 @@ watch(userResource, () => { if (userResource.data) { isModerator.value = userResource.data.is_moderator isInstructor.value = userResource.data.is_instructor - addQuizzes() addPrograms() + addQuizzes() + addAssignments() } }) diff --git a/frontend/src/components/AssessmentPlugin.vue b/frontend/src/components/AssessmentPlugin.vue new file mode 100644 index 000000000..21f8895e7 --- /dev/null +++ b/frontend/src/components/AssessmentPlugin.vue @@ -0,0 +1,75 @@ + + diff --git a/frontend/src/components/Assessments.vue b/frontend/src/components/Assessments.vue index ac0664ef9..db293da1a 100644 --- a/frontend/src/components/Assessments.vue +++ b/frontend/src/components/Assessments.vue @@ -148,7 +148,7 @@ const getRowRoute = (row) => { return { name: 'AssignmentSubmission', params: { - assignmentName: row.assessment_name, + assignmentID: row.assessment_name, submissionName: row.submission.name, }, } @@ -156,7 +156,7 @@ const getRowRoute = (row) => { return { name: 'AssignmentSubmission', params: { - assignmentName: row.assessment_name, + assignmentID: row.assessment_name, submissionName: 'new', }, } diff --git a/frontend/src/components/BatchStudents.vue b/frontend/src/components/BatchStudents.vue index 269a053ea..03d171d59 100644 --- a/frontend/src/components/BatchStudents.vue +++ b/frontend/src/components/BatchStudents.vue @@ -1,6 +1,6 @@