Bug #671 Progress bar not showing full stats#750
Conversation
|
Visit the preview URL for this PR (updated for commit 7567d16): https://hs-levante-admin-dev--pr750-bug-671-progress-bar-66d4b9u4.web.app (expires Tue, 13 Jan 2026 18:47:54 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 7889bff1da3bcc333d7422b9fc863c65b3962be7 |
| const numOfCompleted = Number(completed) || 0; | ||
| const numOfAssigned = Number(assigned) || 0; | ||
| const numOfStarted = Number(started) || 0; | ||
| const numOfIncomplete = numOfStarted - numOfCompleted; |
There was a problem hiding this comment.
I think this is causing an issue when adults complete surveys - for children, assignments have multiple tasks so they may often be started but not completed, but adults only have one survey so it may get done in one go. When e.g., a child starts (but doesn't finish), and then an adult finishes (but was never tallied as started), it shows started as 0 (or some number of adults less than it actually is) even though there may still be users who have started but not finished. I think we might need to do something more complicated here to fix that - do we have different options for what the orgStats returns?
Proposed changes
For the layout, I fixed some inconsistencies related to the full statuses (full started and full completed). The border radius was breaking for them. Here are all the statuses:
NO STARTED

PARTIALLY STARTED AND NO COMPLETED

PARTIALLY STARTED AND PARTIALLY COMPLETED

ALL STARTED AND PARTIALLY COMPLETED

ALL COMPLETED

For the refactoring (readability improvement), I updated the plotting function to move from
startedtocompletedwhen the user completes the assignment. This allowed me to give the right results for:Screen.Recording.2026-01-06.at.15.30.40.mov
Types of changes
What types of changes does this pull request introduce?
Additional Notes