<feat> Add colour to back of responses based on correctness of answer#9
Merged
JoshdRod merged 3 commits intodev-untestedfrom Dec 21, 2025
Merged
<feat> Add colour to back of responses based on correctness of answer#9JoshdRod merged 3 commits intodev-untestedfrom
JoshdRod merged 3 commits intodev-untestedfrom
Conversation
Formula for calculating correctness = 100(1 - e^(no. identical nodes /(no. nodes in solution + difference in no. nodes))).
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds visual feedback for answer correctness by applying background colors to response boxes. The color ranges from red (incorrect) to green (correct) based on a similarity metric between the user's answer tree and the solution tree.
- Uncommented and activated the correctness evaluation logic that calculates similarity between expression trees
- Implemented the
evaluateCorrectnessfunction that compares two expression trees using a formula based on identical nodes and tree size differences - Applied background colors to both response boxes and color boxes in the answer history
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…on (#12) Addresses question on PR #9 about helper function refactoring to reduce code duplication in response colour coding. ## Changes - Added `getColourString()` helper function to encapsulate RGB string formatting - Extracted repeated color string construction (8 occurrences) into single variable
This loop continues until the DFS of one of the trees is complete. The use of a for loop here was harder to read, so I replaced it with a more obvious while loop.
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.
Formula for calculating correctness = 100(1 - e^(-(no. identical nodes /(no. nodes in solution + difference in no. nodes)))).