File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
src/editors/containers/ProblemEditor/components/EditProblemView/AnswerWidget Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ const AnswerOption = ({
5656 const validateAnswerNumeric = ( value ) => {
5757 const cleanedValue = ( value ?? '' ) . trim ( ) ;
5858 return ! cleanedValue . length || numericRegex . test ( cleanedValue ) ;
59- }
59+ } ;
6060
6161 const getInputArea = ( ) => {
6262 if ( [ ProblemTypeKeys . SINGLESELECT , ProblemTypeKeys . MULTISELECT ] . includes ( problemType ) ) {
@@ -74,7 +74,7 @@ const AnswerOption = ({
7474 ) ;
7575 }
7676 if ( problemType !== ProblemTypeKeys . NUMERIC || ! answer . isAnswerRange ) {
77- const isValidValue = validateAnswerNumeric ( answer . title )
77+ const isValidValue = validateAnswerNumeric ( answer . title ) ;
7878 return (
7979 < Form . Group isInvalid = { ! isValidValue } >
8080 < Form . Control
@@ -87,12 +87,11 @@ const AnswerOption = ({
8787 placeholder = { intl . formatMessage ( messages . answerTextboxPlaceholder ) }
8888
8989 />
90- { ! isValidValue && (
91- < Form . Control . Feedback type = "invalid" >
92- < FormattedMessage { ...messages . AnswerNumericErrorText } />
93- </ Form . Control . Feedback >
94- ) }
95-
90+ { ! isValidValue && (
91+ < Form . Control . Feedback type = "invalid" >
92+ < FormattedMessage { ...messages . answerNumericErrorText } />
93+ </ Form . Control . Feedback >
94+ ) }
9695 </ Form . Group >
9796 ) ;
9897 }
Original file line number Diff line number Diff line change @@ -82,11 +82,11 @@ const messages = defineMessages({
8282 defaultMessage : 'Error: Invalid range format. Use brackets or parentheses with values separated by a comma.' ,
8383 description : 'Error text describing wrong format of answer ranges' ,
8484 } ,
85- AnswerNumericErrorText : {
85+ answerNumericErrorText : {
8686 id : 'authoring.answerwidget.answer.answerNumericErrorText' ,
8787 defaultMessage : 'Error: This problem type only supports numeric answers. Did you mean to make a (Text/Math Expression) Input problem?' ,
88- description : 'Error numeric describing wrong format' ,
89- }
88+ description : 'Error message when user provides wrong format' ,
89+ } ,
9090} ) ;
9191
9292export default messages ;
You can’t perform that action at this time.
0 commit comments