fix(client): filter challenge nodes by certification to fix progress bar#67052
Open
ragini-pandey wants to merge 1 commit intofreeCodeCamp:mainfrom
Open
fix(client): filter challenge nodes by certification to fix progress bar#67052ragini-pandey wants to merge 1 commit intofreeCodeCamp:mainfrom
ragini-pandey wants to merge 1 commit intofreeCodeCamp:mainfrom
Conversation
Contributor
|
Hi there, Thanks for opening this pull request. The automated checks found some issues: Linked Issue: The linked issue has not been triaged yet, and a solution has not been agreed upon. Once the issue is open for contribution, you are welcome to update this pull request to reflect the issue consensus. Until then, we will not be able to review your pull request. Join us in our chat room or our forum if you have any questions or need help with contributing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist:
mainbranch of freeCodeCamp.Closes #67048
Problem
The progress bar after completing a challenge in the JavaScript v9 curriculum only fills to ~50% maximum (e.g. shows 7% for 1 out of 7 completed challenges instead of 14%).
Root cause: 446 block names are shared across multiple superblocks (e.g.
workshop-greeting-botexists in bothjavascript-v9andintroduction-to-variables-and-strings-in-javascript). TheallChallengeNodeGraphQL query returns nodes for all superblocks, sogetCurrentBlockIdswas collecting challenge IDs from all superblocks that share the same block name. This doubledcurrentBlockIds.lengthfor shared blocks:Fix
client/src/templates/Challenges/utils/fetch-all-curriculum-data.tsx— Addedcertificationto theallChallengeNodeGraphQL query so it's available for filtering.client/src/utils/get-completion-percentage.ts— Addedcertificationto thechallengeNodesfilter ingetCurrentBlockIds, ensuring only challenges belonging to the current superblock are counted.client/src/utils/get-completion-percentage.test.ts— Added a regression test covering the shared-block scenario.