feat(matching): match by text instead of IDs to support duplicates - #33
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the matching game implementation to support duplicate definitions by switching from ID-based pairing to text-derived matching (term carries a match token derived from its definition), while removing the old encrypted key-mapping flow and related handler.
Changes:
- Replace
start_matching_game/ encrypted mapping approach with per-cardmatchtokens and embedded page data. - Update matching frontend logic to validate matches using the embedded match tokens instead of server-provided index mappings.
- Remove corresponding tests/handler plumbing and bump package version to
1.0.16.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
games/handlers/matching.py |
Generates per-page payload with match/hash fields and initializes the new JS entrypoint; removes mapping decryption handler. |
games/static/html/matching.html |
Embeds matching payload (pages_json) and updates DOM attributes for matching. |
games/static/js/src/matching.js |
Reworks client-side matching to compare definition hashes vs term match tokens; removes server start call and obfuscated decoder flow. |
games/games.py |
Removes the start_matching_game XBlock JSON handler. |
tests/test_games.py |
Removes handler test for start_matching_game; minor import cleanup. |
tests/handlers/test_matching_handlers.py |
Removes tests for the deleted key-mapping handler; minor loop refactor. |
setup.py |
Version bump to 1.0.16. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pganesh-apphelix
force-pushed
the
feat/TNL2-550
branch
from
April 23, 2026 13:37
4b10e52 to
b47bb8a
Compare
abhalsod-sonata
approved these changes
Apr 23, 2026
pganesh-apphelix
force-pushed
the
feat/TNL2-550
branch
from
April 23, 2026 14:09
b47bb8a to
98f8731
Compare
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.
Description
Jira
Version