diff --git a/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/__snapshots__/index.test.jsx.snap b/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/__snapshots__/index.test.jsx.snap
index b12be4b3..7db0d58c 100644
--- a/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/__snapshots__/index.test.jsx.snap
+++ b/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/__snapshots__/index.test.jsx.snap
@@ -5,7 +5,7 @@ exports[`AdjustedGradeInput component render snapshot 1`] = `
some-hint-text
diff --git a/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/hooks.js b/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/hooks.js
index da315857..efc4cbd5 100644
--- a/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/hooks.js
+++ b/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/hooks.js
@@ -15,6 +15,7 @@ const useAdjustedGradeInputData = () => {
value,
onChange,
hintText,
+ possibleGrade,
};
};
diff --git a/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/index.jsx b/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/index.jsx
index 5a4ff3c4..2d6aa0e1 100644
--- a/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/index.jsx
+++ b/src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/index.jsx
@@ -2,7 +2,9 @@ import React from 'react';
import { Form } from '@openedx/paragon';
+import { useIntl } from '@edx/frontend-platform/i18n';
import useAdjustedGradeInputData from './hooks';
+import messages from '../messages';
/**
*
@@ -14,16 +16,18 @@ export const AdjustedGradeInput = () => {
value,
onChange,
hintText,
+ possibleGrade,
} = useAdjustedGradeInputData();
+ const { formatMessage } = useIntl();
return (
- {hintText}
+ {value > possibleGrade ? { formatMessage(messages.adjustedGradeError, { possibleGrade })}
: hintText}
);
};
diff --git a/src/components/GradesView/EditModal/OverrideTable/messages.js b/src/components/GradesView/EditModal/OverrideTable/messages.js
index 25e7bff1..91bbd2f9 100644
--- a/src/components/GradesView/EditModal/OverrideTable/messages.js
+++ b/src/components/GradesView/EditModal/OverrideTable/messages.js
@@ -21,6 +21,11 @@ const messages = defineMessages({
defaultMessage: 'Reason',
description: 'Edit Modal Override Table Reason column header',
},
+ adjustedGradeError: {
+ id: 'gradebook.GradesView.EditModal.Overrides.adjustedGradeError',
+ defaultMessage: 'The value exceeds the maximum grade: {possibleGrade}',
+ description: 'Edit Modal Override Adjusted Grade Error',
+ },
});
export default messages;
diff --git a/src/components/GradesView/EditModal/__snapshots__/index.test.jsx.snap b/src/components/GradesView/EditModal/__snapshots__/index.test.jsx.snap
index 46a0c513..6ec6164f 100644
--- a/src/components/GradesView/EditModal/__snapshots__/index.test.jsx.snap
+++ b/src/components/GradesView/EditModal/__snapshots__/index.test.jsx.snap
@@ -36,6 +36,7 @@ exports[`EditModal component render with error snapshot 1`] = `
Cancel