Skip to content

Commit

Permalink
Fix: Error on missing generic _answers array (fixes #155)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Nov 1, 2024
1 parent 19e0635 commit e5a65d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/textInputModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class TextInputModel extends QuestionModel {
// (this excludes any inputs which have their own specific answers).
markGenericAnswers() {
let numberOfCorrectAnswers = 0;
const correctAnswers = this.get('_answers').slice();
const correctAnswers = this.get('_answers')?.slice() ?? [];
const usedAnswerIndexes = [];

this.get('_items').forEach(item => {
Expand Down

0 comments on commit e5a65d1

Please sign in to comment.