-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: Enhance MatchingPairs game with tutorial overlay (#1416)
* feat: Allow Button to be clicked more than once if the `clickOnce` prop is set to `false` (`true` by default) * feat: Add Overlay component with customizable content and close functionality * feat: Integrate MSW for API mocking in Storybook and update MatchingPairs story to use handlers * feat: Add tutorial messages to MatchingPairs game and integrate tutorial overlay in UI * style: Decrease overlay's background color's opacity to increase visibility of game behind it. * style: Adjust Overlay component width and body margin for improved layout * test: Add unit tests for Overlay component functionality and rendering * test: Add tutorial overlay integration tests for MatchingPairs component * test: Enable previously skipped tests for MatchingPairs component and refactor state initialization * refactor: Remove in-between turns display from MatchingPairs component * fix: Fix checking if board is empty * style: Update Overlay component styles and button text for improved visibility and clarity (dark opaque background with white text instead of a white dialog with black text) * fix: Correct condition for checking 'seen' status in MatchingPairsGame scoring logic * style: Update transition effects in Overlay component for smoother animations * refactor: Turn off tutorial in matching pairs lite game * lint: Update string quotes for consistency in MatchingPairsICMPC class and remove unused import * feat: Add MatchingPairs2025 class with tutorial messages and docstrings * fix: Explicitly set tutorial to None in MatchingPairsGame class * feat: Add overlay visibility tracking to MatchingPairs game logic * fix: Remove unused overlay visibility tracking in MatchingPairsGame class as the information was already being stored and this was causing an error * test: Add test for "overlay_was_shown" value in a result's json data
- Loading branch information
1 parent
dc3ca49
commit 4688aab
Showing
22 changed files
with
2,135 additions
and
217 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from .matching_pairs import MatchingPairsGame | ||
|
||
|
||
class MatchingPairs2025(MatchingPairsGame): | ||
"""This is the working version of the Matching Pairs game for the 2025 Tunetwins experiment. The difference between this version and the original Matching Pairs game is that this version has some additional tutorial messages. These messages are intended to help the user understand the game. The tutorial messages are as follows: | ||
- no_match: This was not a match, so you get 0 points. Please try again to see if you can find a matching pair. | ||
- lucky_match: You got a matching pair, but you didn't hear both cards before. This is considered a lucky match. You get 10 points. | ||
- memory_match: You got a matching pair. You get 20 points. | ||
- misremembered: You thought you found a matching pair, but you didn't. This is considered a misremembered pair. You lose 10 points. | ||
The tutorial messages are displayed to the user in an overlay on the game screen. | ||
""" | ||
|
||
ID = "MATCHING_PAIRS_2025" | ||
tutorial = { | ||
"no_match": _( | ||
"This was not a match, so you get 0 points. Please try again to see if you can find a matching pair." | ||
), | ||
"lucky_match": _( | ||
"You got a matching pair, but you didn't hear both cards before. This is considered a lucky match. You get 10 points." | ||
), | ||
"memory_match": _("You got a matching pair. You get 20 points."), | ||
"misremembered": _( | ||
"You thought you found a matching pair, but you didn't. This is considered a misremembered pair. You lose 10 points." | ||
), | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from .matching_pairs import MatchingPairsGame | ||
from experiment.actions.form import TextQuestion | ||
|
||
|
||
class MatchingPairsICMPC(MatchingPairsGame): | ||
ID = 'MATCHING_PAIRS_ICMPC' | ||
ID = "MATCHING_PAIRS_ICMPC" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.question_series[0]['keys'].append('fame_name') | ||
self.question_series[0]["keys"].append("fame_name") |
This file contains 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
Oops, something went wrong.