fix: getGeneralFeedback selectedFeedback error (#243)

This commit is contained in:
Kristin Aoki
2023-02-10 14:54:56 -05:00
committed by GitHub
parent 0367ef776e
commit eeaa0e3f68

View File

@@ -379,7 +379,7 @@ export class OLXParser {
2. All the problem's incorrect, if Selected answers are equivalent strings, and there is no other feedback.
*/
if (problemType === ProblemTypeKeys.SINGLESELECT || problemType === ProblemTypeKeys.DROPDOWN) {
const firstIncorrectAnswerText = answers.find(answer => answer.correct === false).selectedFeedback;
const firstIncorrectAnswerText = answers.find(answer => answer.correct === false)?.selectedFeedback;
const isAllIncorrectSelectedFeedbackTheSame = answers.every(answer => (answer.correct
? true
: answer?.selectedFeedback === firstIncorrectAnswerText