diff --git a/client/app/bundles/course/assessment/pages/AssessmentStatistics/LiveFeedbackStatisticsTable.tsx b/client/app/bundles/course/assessment/pages/AssessmentStatistics/LiveFeedbackStatisticsTable.tsx index 0a135e237b8..3aa86692536 100644 --- a/client/app/bundles/course/assessment/pages/AssessmentStatistics/LiveFeedbackStatisticsTable.tsx +++ b/client/app/bundles/course/assessment/pages/AssessmentStatistics/LiveFeedbackStatisticsTable.tsx @@ -193,7 +193,6 @@ const LiveFeedbackStatisticsTable: FC = (props) => { sortable: true, cell: (datum) => ( diff --git a/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentAttemptCountTable.tsx b/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentAttemptCountTable.tsx index a2323e435fc..4b2dd140dfc 100644 --- a/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentAttemptCountTable.tsx +++ b/client/app/bundles/course/assessment/pages/AssessmentStatistics/StudentAttemptCountTable.tsx @@ -1,6 +1,5 @@ import { FC, ReactNode, useState } from 'react'; import { useParams } from 'react-router-dom'; -import { Box } from '@mui/material'; import { WorkflowState } from 'types/course/assessment/submission/submission'; import { MainSubmissionInfo } from 'types/course/statistics/assessmentStatistics'; @@ -100,7 +99,7 @@ const StudentAttemptCountTable: FC = (props) => { }); }} > - {datum.attemptStatus![index].attemptCount} + {datum.attemptStatus![index].attemptCount} ); }; @@ -115,7 +114,7 @@ const StudentAttemptCountTable: FC = (props) => { }, title: t(translations.questionIndex, { index: index + 1 }), cell: (datum): ReactNode => { - return typeof datum.attemptStatus?.[index].attemptCount === + return typeof datum.attemptStatus?.[index]?.attemptCount === 'number' ? ( renderAttemptCountClickableCell(index, datum) ) : ( @@ -180,7 +179,6 @@ const StudentAttemptCountTable: FC = (props) => { sortable: true, cell: (datum) => ( = (props) => { }); }} > - {datum.answers![index].grade.toFixed(1)} + {datum.answers![index].grade.toFixed(1)} ); }; @@ -108,11 +107,7 @@ const StudentMarksPerQuestionTable: FC = (props) => { maxGrade: number, ): ReactNode => { const className = getClassNameForMarkCell(totalGrade, maxGrade); - return ( -
- {totalGrade.toFixed(1)} -
- ); + return
{totalGrade.toFixed(1)}
; }; const answerColumns: ColumnTemplate[] = Array.from( @@ -125,7 +120,7 @@ const StudentMarksPerQuestionTable: FC = (props) => { }, title: t(translations.questionIndex, { index: index + 1 }), cell: (datum): ReactNode => { - return typeof datum.answers?.[index].grade === 'number' ? ( + return typeof datum.answers?.[index]?.grade === 'number' ? ( renderAnswerGradeClickableCell(index, datum) ) : (
@@ -189,13 +184,12 @@ const StudentMarksPerQuestionTable: FC = (props) => { sortable: true, cell: (datum) => ( ), - className: 'center', + className: 'text-left', }, ...answerColumns, { diff --git a/client/app/bundles/course/assessment/pages/AssessmentStatistics/classNameUtils.ts b/client/app/bundles/course/assessment/pages/AssessmentStatistics/classNameUtils.ts index f596d3cb76a..b1ff63602a7 100644 --- a/client/app/bundles/course/assessment/pages/AssessmentStatistics/classNameUtils.ts +++ b/client/app/bundles/course/assessment/pages/AssessmentStatistics/classNameUtils.ts @@ -47,8 +47,8 @@ export const getClassNameForMarkCell = ( maxGrade / 2, ); return grade >= maxGrade / 2 - ? `${greenBackgroundColorClassName[gradientLevel]} p-[1rem]` - : `${redBackgroundColorClassName[gradientLevel]} p-[1rem]`; + ? `${greenBackgroundColorClassName[gradientLevel]} p-1.5` + : `${redBackgroundColorClassName[gradientLevel]} p-1.5`; }; // for attempt count cell, the difference in color means the following: @@ -59,10 +59,10 @@ export const getClassNameForAttemptCountCell = ( attempt: AttemptInfo, ): string => { if (!attempt.isAutograded || attempt.correct === null) { - return 'bg-gray-300 p-[1rem]'; + return 'bg-gray-300 p-1.5'; } - return attempt.correct ? 'bg-green-300 p-[1rem]' : 'bg-red-300 p-[1rem]'; + return attempt.correct ? 'bg-green-300 p-1.5' : 'bg-red-300 p-1.5'; }; export const getClassnameForLiveFeedbackCell = ( diff --git a/client/app/bundles/course/assessment/submission/components/SubmissionWorkflowState.tsx b/client/app/bundles/course/assessment/submission/components/SubmissionWorkflowState.tsx index f9e78fc9289..0332a209dbc 100644 --- a/client/app/bundles/course/assessment/submission/components/SubmissionWorkflowState.tsx +++ b/client/app/bundles/course/assessment/submission/components/SubmissionWorkflowState.tsx @@ -1,6 +1,5 @@ -import { FC } from 'react'; +import { FC, JSXElementConstructor, ReactElement } from 'react'; import { Link } from 'react-router-dom'; -import { Warning } from '@mui/icons-material'; import { Chip } from '@mui/material'; import palette from 'theme/palette'; import { WorkflowState } from 'types/course/assessment/submission/submission'; @@ -14,6 +13,7 @@ interface SubmissionWorkflowStateProps { className?: string; linkTo?: string; opensInNewTab?: boolean; + icon?: ReactElement; // The "unstarted" workflow state represents a student who has not clicked "Attempt" to create a submission // (i.e. the submission for the assessment from them does not exist) workflowState: WorkflowState | typeof workflowStates.Unstarted; @@ -23,24 +23,11 @@ const SubmissionWorkflowState: FC = (props) => { const { className, linkTo, opensInNewTab, workflowState } = props; const { t } = useTranslation(); - const renderUnpublishedWarning = (): JSX.Element | undefined => { - if (workflowState === workflowStates.Graded) { - return ( - -
- -
-
- ); - } - return undefined; - }; - if (workflowState === workflowStates.Unstarted || !linkTo) { return ( @@ -53,9 +40,9 @@ const SubmissionWorkflowState: FC = (props) => { target: '_blank', rel: 'noopener noreferrer', })} - className={`text-blue-800 ${palette.submissionStatusClassName[workflowState]} ${className}`} + className={`text-blue-800 hover:underline w-fit py-1.5 h-auto ${palette.submissionStatusClassName[workflowState]} ${className}`} component={Link} - icon={renderUnpublishedWarning()} + icon={props.icon} label={t(translations[workflowState])} to={linkTo} variant="filled" diff --git a/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/SubmissionsTable.jsx b/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/SubmissionsTable.jsx index ed61f916e92..71aeaf01b4b 100644 --- a/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/SubmissionsTable.jsx +++ b/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/SubmissionsTable.jsx @@ -35,7 +35,7 @@ const styles = { display: 'none', }, tableCell: { - padding: '0.5em', + padding: '0 0.5em', textOverflow: 'initial', whiteSpace: 'nowrap', wordBreak: 'break-word', @@ -364,7 +364,7 @@ export default class SubmissionsTable extends Component { {tableHeaderColumnFor('userName')} - {tableHeaderCenterColumnFor('submissionStatus')} + {tableHeaderColumnFor('submissionStatus')} {tableHeaderCenterColumnFor('grade')} {assessment.gamified ? tableHeaderCenterColumnFor('experiencePoints') diff --git a/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/SubmissionsTableRow.jsx b/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/SubmissionsTableRow.jsx index dfd26338c96..b8af41451fa 100644 --- a/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/SubmissionsTableRow.jsx +++ b/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/SubmissionsTableRow.jsx @@ -1,5 +1,6 @@ import { memo, useState } from 'react'; import { FormattedMessage } from 'react-intl'; +import { Warning } from '@mui/icons-material'; import Delete from '@mui/icons-material/Delete'; import History from '@mui/icons-material/History'; import RemoveCircle from '@mui/icons-material/RemoveCircle'; @@ -30,7 +31,7 @@ import submissionsTranslations from './translations'; const styles = { tableCell: { - padding: '0.5em', + padding: '0 0.5em', textOverflow: 'initial', whiteSpace: 'normal', alignItems: 'center', @@ -55,6 +56,21 @@ const renderPhantomUserIcon = (submission) => { return null; }; +const renderUnpublishedWarning = (submission) => { + if (submission.workflowState !== workflowStates.Graded) return null; + return ( + +
+ +
+
+ ); +}; + const SubmissionsTableRow = (props) => { const { assessment, assessmentId, courseId, dispatch, submission } = props; const palette = useTheme().palette; @@ -242,11 +258,9 @@ const SubmissionsTableRow = (props) => { - +