-
Notifications
You must be signed in to change notification settings - Fork 0
<feat> Add colour to back of responses based on correctness of answer #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Formula for calculating correctness = 100(1 - e^(no. identical nodes /(no. nodes in solution + difference in no. nodes))).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Formula for calculating correctness = 100(1 - e^(-(no. identical nodes /(no. nodes in solution + difference in no. nodes)))).