Skip to content

feat(matching): match by text instead of IDs to support duplicates - #33

Merged
pganesh-apphelix merged 1 commit into
mainfrom
feat/TNL2-550
Apr 23, 2026
Merged

pganesh-apphelix merged 1 commit into
mainfrom
feat/TNL2-550

Conversation

@pganesh-apphelix

Copy link
Copy Markdown
Contributor

Description

  • Replaced ID-based matching with content-based (text + HMAC) matching.
  • Fixes incorrect matches when multiple terms share the same definition.
  • Removes encrypted key mapping and related handler/API.
  • Simplifies frontend by embedding matching data directly.
  • Enables many-to-many matching and improves overall reliability.

Jira

Version

  • 1.0.16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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-card match tokens 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.

Comment thread games/static/html/matching.html Outdated
Comment thread games/handlers/matching.py
Comment thread games/static/js/src/matching.js Outdated
Comment thread games/static/js/src/matching.js
Comment thread games/handlers/matching.py
@pganesh-apphelix
pganesh-apphelix merged commit aca19ec into main Apr 23, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants