Skip to content

Commit

Permalink
Fixing joinSentenceWords for itemResponseType paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCoronadoN committed Nov 4, 2024
1 parent 585ccae commit 29905d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/entities/activity/ui/items/ActionPlan/ResponseSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export const ResponseSegment = ({ phrasalData, field, isAtStart }: ResponseSegme
words = isAnswersSkipped(fieldPhrasalData.values)
? [t('questionSkipped')]
: fieldPhrasalData.values
.flatMap((value) => value.split(/\r?\n+/))
.map((sentence) => sentence.trim());
.flatMap((value) => value.split(/\r?\n/)) // Split each paragraph by newlines
.map(transformValue);
} else if (fieldPhrasalDataType === 'indexed-array') {
const indexedAnswers = fieldPhrasalData.values[field.itemIndex] || [];
words = isAnswersSkipped(indexedAnswers)
Expand Down

0 comments on commit 29905d0

Please sign in to comment.