Skip to content

Commit d669d7e

Browse files
style(format): fix spaces and update message to camelCase
1 parent 740a7b8 commit d669d7e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/editors/containers/ProblemEditor/components/EditProblemView/AnswerWidget/AnswerOption.jsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff 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
}

src/editors/containers/ProblemEditor/components/EditProblemView/AnswerWidget/messages.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

9292
export default messages;

0 commit comments

Comments
 (0)