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..18dd5f2a2 100644 --- a/frontend/src/components/Assessments.vue +++ b/frontend/src/components/Assessments.vue @@ -19,6 +19,7 @@ :options="{ showTooltip: false, getRowRoute: (row) => getRowRoute(row), + selectable: user.data?.is_student ? false : true, }" > {{ row[column.key] == 'LMS Quiz' ? 'Quiz' : 'Assignment' }} +
+ {{ row[column.key] }} +
+
+ + {{ row[column.key] }} + +
{{ row[column.key] }}
@@ -83,6 +92,7 @@ import { ListSelectBanner, createResource, Button, + Badge, } from 'frappe-ui' import { inject, ref } from 'vue' import AssessmentModal from '@/components/Modals/AssessmentModal.vue' @@ -148,7 +158,7 @@ const getRowRoute = (row) => { return { name: 'AssignmentSubmission', params: { - assignmentName: row.assessment_name, + assignmentID: row.assessment_name, submissionName: row.submission.name, }, } @@ -156,7 +166,7 @@ const getRowRoute = (row) => { return { name: 'AssignmentSubmission', params: { - assignmentName: row.assessment_name, + assignmentID: row.assessment_name, submissionName: 'new', }, } @@ -180,23 +190,33 @@ const getAssessmentColumns = () => { { label: 'Assessment', key: 'title', - width: '30rem', + width: '25rem', }, { label: 'Type', key: 'assessment_type', - width: '10rem', + width: '15rem', }, ] if (!user.data?.is_moderator) { columns.push({ - label: 'Status/Score', + label: 'Status/Percentage', key: 'status', - align: 'center', + align: 'left', width: '10rem', }) } return columns } + +const getStatusTheme = (status) => { + if (status === 'Pass') { + return 'green' + } else if (status === 'Not Graded') { + return 'orange' + } else { + return 'red' + } +} diff --git a/frontend/src/components/Assignment.vue b/frontend/src/components/Assignment.vue new file mode 100644 index 000000000..87d7af0a2 --- /dev/null +++ b/frontend/src/components/Assignment.vue @@ -0,0 +1,448 @@ + + diff --git a/frontend/src/components/AssignmentBlock.vue b/frontend/src/components/AssignmentBlock.vue new file mode 100644 index 000000000..fcc8736b0 --- /dev/null +++ b/frontend/src/components/AssignmentBlock.vue @@ -0,0 +1,46 @@ + + diff --git a/frontend/src/components/BatchStudents.vue b/frontend/src/components/BatchStudents.vue index 5ee0570d9..dce49cbf9 100644 --- a/frontend/src/components/BatchStudents.vue +++ b/frontend/src/components/BatchStudents.vue @@ -98,9 +98,6 @@ row-key="name" :options="{ showTooltip: false, - onRowClick: (row) => { - openStudentProgressModal(row) - }, }" > - +