Skip to content

Commit b327bb7

Browse files
Fix: Return correct calculation for presentation components with items (fixes #228) (#229)
* Fix incorrect calculation for presentation components with items * Update js/PageLevelProgressIndicatorView.js Co-authored-by: Oliver Foster <oliver.foster@kineo.com> * Update js/PageLevelProgressIndicatorView.js Co-authored-by: Oliver Foster <oliver.foster@kineo.com> * Update js/PageLevelProgressIndicatorView.js Co-authored-by: Oliver Foster <oliver.foster@kineo.com> --------- Co-authored-by: Oliver Foster <oliver.foster@kineo.com>
1 parent ab3b4a4 commit b327bb7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/PageLevelProgressIndicatorView.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@ class PageLevelProgressIndicatorView extends Backbone.View {
5353

5454
calculatePercentage() {
5555
const isPresentationComponentWithItems = (!this.model.isTypeGroup('question') && this.model instanceof ItemsComponentModel);
56+
const isComplete = this.model.get('_isComplete');
57+
if (isComplete) return 100;
5658
if (isPresentationComponentWithItems) {
5759
const children = this.model.getChildren();
5860
const visited = children.filter(child => child.get('_isVisited'));
5961
return Math.round(visited.length / children.length * 100);
6062
}
61-
return this.model.get('_isComplete') ? 100 : 0;
63+
return 0
6264
}
6365

6466
render() {

0 commit comments

Comments
 (0)