From 38d7e64a2bb6eb3dd393b1727c0c9706745c0542 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Mon, 24 Jun 2024 12:43:31 +0100 Subject: [PATCH] Fix: Content object progress calculations (fixes #233) --- js/PageLevelProgressIndicatorView.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/PageLevelProgressIndicatorView.js b/js/PageLevelProgressIndicatorView.js index 9ef37c7..cb8902d 100644 --- a/js/PageLevelProgressIndicatorView.js +++ b/js/PageLevelProgressIndicatorView.js @@ -49,12 +49,10 @@ class PageLevelProgressIndicatorView extends Backbone.View { } calculatePercentage() { + const isContentObject = this.model.isTypeGroup('contentobject'); + if (isContentObject) return completionCalculations.calculatePercentageComplete(this.model); const isComplete = this.model.get('_isComplete'); if (isComplete) return 100; - const isContentObject = this.model.isTypeGroup('contentobject'); - if (isContentObject) { - return completionCalculations.calculatePercentageComplete(this.model); - } const isPresentationComponentWithItems = (!this.model.isTypeGroup('question') && this.model instanceof ItemsComponentModel); if (isPresentationComponentWithItems) { const children = this.model.getChildren();