Skip to content

Commit

Permalink
Fix: Bank blocks only, restore other children (fixes #192)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster committed Feb 27, 2024
1 parent 9076c0c commit bb11443
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/adapt-assessmentArticleModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ const AssessmentModel = {
} else if (quizModels.length === 0) {
quizModels = this.getChildren().models;
logging.warn('assessment: Not enough unique questions to create a fresh assessment, using last selection');
} else {
// reattach any removed non-block children, trickle buttons etc
const outsideModels = this._originalChildModels.filter(model => model.get('_type') !== 'block')
quizModels = quizModels.concat(outsideModels)
}
this.getChildren().reset(quizModels);
this.setupCurrentQuestionComponents();
Expand Down Expand Up @@ -240,7 +244,7 @@ const AssessmentModel = {
const assessmentConfig = this.getConfig();

const randomisationModel = assessmentConfig._randomisation;
const blockModels = this.getChildren().models;
const blockModels = this.findDescendantModels('block');

let questionModels = _.shuffle(blockModels);

Expand Down

0 comments on commit bb11443

Please sign in to comment.