diff --git a/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentAttemptCountTable.tsx b/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentAttemptCountTable.tsx index 24761e63ab..de956b8032 100644 --- a/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentAttemptCountTable.tsx +++ b/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentAttemptCountTable.tsx @@ -14,6 +14,7 @@ import Note from 'lib/components/core/Note'; import GhostIcon from 'lib/components/icons/GhostIcon'; import Table, { ColumnTemplate } from 'lib/components/table'; import { DEFAULT_TABLE_ROWS_PER_PAGE } from 'lib/constants/sharedConstants'; +import TableLegends from 'lib/containers/TableLegends'; import { useAppSelector } from 'lib/hooks/store'; import useTranslation from 'lib/hooks/useTranslation'; @@ -26,6 +27,18 @@ const translations = defineMessages({ defaultMessage: 'This table is only displayed for Assessment with at least one Autograded Questions', }, + greenCellLegend: { + id: 'course.assessment.statistics.greenCellLegend', + defaultMessage: 'Correct', + }, + redCellLegend: { + id: 'course.assessment.statistics.redCellLegend', + defaultMessage: 'Incorrect', + }, + grayCellLegend: { + id: 'course.assessment.statistics.grayCellLegend', + defaultMessage: 'Undecided (question is Non-autogradable)', + }, name: { id: 'course.assessment.statistics.name', defaultMessage: 'Name', @@ -224,27 +237,48 @@ const StudentAttemptCountTable: FC = (props) => { ]; return ( - - `data_${datum.courseUser.id} bg-slot-1 hover?:bg-slot-2 slot-1-white slot-2-neutral-100` - } - getRowEqualityData={(datum): MainSubmissionInfo => datum} - getRowId={(datum): string => datum.courseUser.id.toString()} - indexing={{ indices: true }} - pagination={{ - rowsPerPage: [DEFAULT_TABLE_ROWS_PER_PAGE], - showAllRows: true, - }} - search={{ searchPlaceholder: t(translations.searchText) }} - toolbar={{ show: true }} - /> + <> + +
+ `data_${datum.courseUser.id} bg-slot-1 hover?:bg-slot-2 slot-1-white slot-2-neutral-100` + } + getRowEqualityData={(datum): MainSubmissionInfo => datum} + getRowId={(datum): string => datum.courseUser.id.toString()} + indexing={{ indices: true }} + pagination={{ + rowsPerPage: [DEFAULT_TABLE_ROWS_PER_PAGE], + showAllRows: true, + }} + search={{ searchPlaceholder: t(translations.searchText) }} + toolbar={{ show: true }} + /> + ); }; diff --git a/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentMarksPerQuestionTable.tsx b/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentMarksPerQuestionTable.tsx index 4f819474d1..7906309525 100644 --- a/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentMarksPerQuestionTable.tsx +++ b/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentMarksPerQuestionTable.tsx @@ -10,6 +10,7 @@ import Link from 'lib/components/core/Link'; import GhostIcon from 'lib/components/icons/GhostIcon'; import Table, { ColumnTemplate } from 'lib/components/table'; import { DEFAULT_TABLE_ROWS_PER_PAGE } from 'lib/constants/sharedConstants'; +import TableLegends from 'lib/containers/TableLegends'; import { useAppSelector } from 'lib/hooks/store'; import useTranslation from 'lib/hooks/useTranslation'; @@ -21,6 +22,14 @@ const translations = defineMessages({ id: 'course.assessment.statistics.name', defaultMessage: 'Name', }, + greenCellLegend: { + id: 'course.assessment.statistics.greenCellLegend', + defaultMessage: '>= 0.5 * Maximum Grade', + }, + redCellLegend: { + id: 'course.assessment.statistics.redCellLegend', + defaultMessage: '< 0.5 * Maximum Grade', + }, group: { id: 'course.assessment.statistics.group', defaultMessage: 'Group', @@ -266,27 +275,43 @@ const StudentMarksPerQuestionTable: FC = (props) => { ]; return ( -
- `data_${datum.courseUser.id} bg-slot-1 hover?:bg-slot-2 slot-1-white slot-2-neutral-100` - } - getRowEqualityData={(datum): MainSubmissionInfo => datum} - getRowId={(datum): string => datum.courseUser.id.toString()} - indexing={{ indices: true }} - pagination={{ - rowsPerPage: [DEFAULT_TABLE_ROWS_PER_PAGE], - showAllRows: true, - }} - search={{ searchPlaceholder: t(translations.searchText) }} - toolbar={{ show: true }} - /> + <> + +
+ `data_${datum.courseUser.id} bg-slot-1 hover?:bg-slot-2 slot-1-white slot-2-neutral-100` + } + getRowEqualityData={(datum): MainSubmissionInfo => datum} + getRowId={(datum): string => datum.courseUser.id.toString()} + indexing={{ indices: true }} + pagination={{ + rowsPerPage: [DEFAULT_TABLE_ROWS_PER_PAGE], + showAllRows: true, + }} + search={{ searchPlaceholder: t(translations.searchText) }} + toolbar={{ show: true }} + /> + ); }; diff --git a/client/app/lib/containers/TableLegends.tsx b/client/app/lib/containers/TableLegends.tsx new file mode 100644 index 0000000000..da4a23e79a --- /dev/null +++ b/client/app/lib/containers/TableLegends.tsx @@ -0,0 +1,27 @@ +import { FC } from 'react'; +import { Typography } from '@mui/material'; + +interface Props { + legends: { + key: string; + backgroundColor: string; + description: string; + }[]; +} + +const TableLegends: FC = (props) => { + const { legends } = props; + + return ( +
+ {legends.map((l) => ( +
+
+ {l.description} +
+ ))} +
+ ); +}; + +export default TableLegends;