File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { useIntl } from '@edx/frontend-platform/i18n';
2
2
3
3
import { MutationStatus , stepNames } from 'constants/index' ;
4
4
5
- import { useOnSubmit } from 'hooks/assessment' ;
5
+ import { useIsAssessmentInvalid , useOnSubmit } from 'hooks/assessment' ;
6
6
import { useViewStep } from 'hooks/routing' ;
7
7
8
8
import useConfirmAction from './useConfirmAction' ;
@@ -21,6 +21,7 @@ const useSubmitAssessmentAction = () => {
21
21
? `${ formatMessage ( viewStepMessages [ viewStep ] ) } `
22
22
: '' ;
23
23
const confirmAction = useConfirmAction ( ) ;
24
+ const isInvalid = useIsAssessmentInvalid ( ) ;
24
25
25
26
const action = {
26
27
onClick : onSubmit ,
@@ -33,7 +34,10 @@ const useSubmitAssessmentAction = () => {
33
34
[ MutationStatus . success ] : formatMessage ( messages . gradeSubmitted ) ,
34
35
} ,
35
36
} ;
36
- if ( viewStep === stepNames . studentTraining ) {
37
+ if ( viewStep === stepNames . studentTraining || isInvalid ) {
38
+ // Don't bother showing the confirm modal if we're doing student training
39
+ // or if the assessment is invalid and we're just going to show validation
40
+ // errors
37
41
return { action } ;
38
42
}
39
43
return confirmAction ( {
You can’t perform that action at this time.
0 commit comments