Skip to content

Commit b1bfc1a

Browse files
fix: minor fixes
Co-authored-by: Samuel Allan <samuel.allan@fastmail.com>
1 parent c1540a9 commit b1bfc1a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

branching_xblock/branching_xblock.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,7 @@ def _current_score(self) -> int:
517517
"""
518518
Compute the learner's accumulated score from score history.
519519
"""
520-
total = 0
521-
for awarded_points in (self.score_history or []):
522-
if isinstance(awarded_points, int):
523-
total += awarded_points
524-
return max(0, total)
520+
return sum(self.score_history)
525521

526522
def get_current_node(self) -> Optional[dict[str, Any]]:
527523
"""

branching_xblock/static/js/src/branching_xblock.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ function BranchingXBlock(runtime, element) {
390390
isReportVisible = true;
391391
if (currentState) {
392392
updateView(currentState);
393+
} else {
394+
refreshView();
393395
}
394396
});
395397

0 commit comments

Comments
 (0)