From 993ab2463b025ea158df749f850be707fdfdf67e Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Tue, 28 May 2024 13:13:50 +0530 Subject: [PATCH] feat: update score label in progress page based on grading --- .../grades/detailed-grades/ProblemScoreDrawer.jsx | 8 ++++++-- src/course-home/progress-tab/grades/messages.js | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/course-home/progress-tab/grades/detailed-grades/ProblemScoreDrawer.jsx b/src/course-home/progress-tab/grades/detailed-grades/ProblemScoreDrawer.jsx index 7970821aaf..cf29c39c38 100644 --- a/src/course-home/progress-tab/grades/detailed-grades/ProblemScoreDrawer.jsx +++ b/src/course-home/progress-tab/grades/detailed-grades/ProblemScoreDrawer.jsx @@ -10,9 +10,10 @@ import messages from '../messages'; const ProblemScoreDrawer = ({ intl, problemScores, subsection }) => { const isLocaleRtl = isRtl(getLocale()); + const scoreLabel = subsection.hasGradedAssignment ? messages.problemScoreLabel : messages.ungradedProblemScoreLabel; return ( - {intl.formatMessage(messages.problemScoreLabel)} + {intl.formatMessage(scoreLabel)}
    {problemScores.map((problemScore, i) => ( @@ -31,7 +32,10 @@ ProblemScoreDrawer.propTypes = { earned: PropTypes.number.isRequired, possible: PropTypes.number.isRequired, })).isRequired, - subsection: PropTypes.shape({ learnerHasAccess: PropTypes.bool }).isRequired, + subsection: PropTypes.shape({ + learnerHasAccess: PropTypes.bool, + hasGradedAssignment: PropTypes.bool, + }).isRequired, }; export default injectIntl(ProblemScoreDrawer); diff --git a/src/course-home/progress-tab/grades/messages.js b/src/course-home/progress-tab/grades/messages.js index d28482dcf5..ac8076891d 100644 --- a/src/course-home/progress-tab/grades/messages.js +++ b/src/course-home/progress-tab/grades/messages.js @@ -168,6 +168,11 @@ const messages = defineMessages({ defaultMessage: 'Problem Scores:', description: 'Label text which precedes detailed view of all scores per assignment', }, + ungradedProblemScoreLabel: { + id: 'progress.detailedGrades.ungraded.problemScore.label', + defaultMessage: 'Ungraded Problem Scores:', + description: 'Label text which precedes detailed view of all ungraded problem scores per assignment', + }, problemScoreToggleAltText: { id: 'progress.detailedGrades.problemScore.toggleButton', defaultMessage: 'Toggle individual problem scores for {subsectionTitle}',