@@ -4,7 +4,7 @@ import classNames from "classnames";
4
4
import { Markup } from "../markup" ;
5
5
import { IsaacNumericQuestionDTO , QuantityDTO , QuantityValidationResponseDTO } from "../../../../IsaacApiTypes" ;
6
6
import { selectors , useAppSelector , useGetConstantUnitsQuery } from "../../../state" ;
7
- import { isLoggedIn , useCurrentQuestionAttempt } from "../../../services" ;
7
+ import { isDefined , isLoggedIn , useCurrentQuestionAttempt } from "../../../services" ;
8
8
import { InlineEntryZoneProps , correctnessClass } from "../markup/portals/InlineEntryZone" ;
9
9
import { selectUnits , wrapUnitForSelect } from "../../../services/numericUnits" ;
10
10
import { QuestionCorrectness } from "../../../../IsaacAppTypes" ;
@@ -46,6 +46,8 @@ export const InlineNumericEntryZone = ({width, height, questionDTO, setModified,
46
46
setModified ( true ) ;
47
47
}
48
48
49
+ const unit = questionDTO . displayUnit ?? currentAttempt ?. units ;
50
+
49
51
return < div { ...rest }
50
52
className = { classNames ( "inline-numeric-container w-100" , rest . className , correctnessClass ( valueCorrectness === "NOT_SUBMITTED" ? "NOT_SUBMITTED" : correctness ) ) }
51
53
>
@@ -94,7 +96,7 @@ export const InlineNumericEntryZone = ({width, height, questionDTO, setModified,
94
96
>
95
97
< div className = { showFeedback ( unitCorrectness ) ? "pe-4" : "pe-2" } >
96
98
< Markup encoding = { "latex" } >
97
- { currentAttempt ?. units !== undefined ? wrapUnitForSelect ( noDisplayUnit ? currentAttempt . units : questionDTO . displayUnit ) : "Unit..." }
99
+ { isDefined ( unit ) ? wrapUnitForSelect ( unit ) : "Unit..." }
98
100
</ Markup >
99
101
{ showFeedback ( unitCorrectness ) && noDisplayUnit && < div className = { "feedback-box ps-2" } >
100
102
{ unitCorrectness === "NOT_ANSWERED" ?
0 commit comments