Skip to content

Hook customizable functions to showing card and showing answer#24

Open
hungriesthippo wants to merge 4 commits intoakrivka:masterfrom
hungriesthippo:showcardfn
Open

Hook customizable functions to showing card and showing answer#24
hungriesthippo wants to merge 4 commits intoakrivka:masterfrom
hungriesthippo:showcardfn

Conversation

@hungriesthippo
Copy link
Copy Markdown
Contributor

simple first pass for #17
see my comment there for an example custom function

allow custom methods for showing card and answer akrivka#17
@akrivka
Copy link
Copy Markdown
Owner

akrivka commented Feb 19, 2021

Hey, looks good, though I'm considering a bigger refactor enabling multiple "layers" of button, which should be more agnostic to what the UI is actually trying to done. Like instead of a fixed "question-answer" paradigm, it would be "layer1->layer2->layer3->..."

Not sure if shouldn't just go through your suggestion right now instead, and keep this idea for a next big release (that would probably be called roam/loop because it'd more general).

Can you maybe give an example of something that an onShowAnswer would allow you?

@hungriesthippo
Copy link
Copy Markdown
Contributor Author

I had a very hacky image occlusion (onShowCard: add rectangle at coords, onShowAnswer: remove it), but your version of that is better.
Another example is playing a sound for a foreign language word.

@hungriesthippo
Copy link
Copy Markdown
Contributor Author

My strongest argument for doing something like this is that it's a way to appease people who have "card type" ideas that may or may not be worth complicating the code. With this you can just say to go try it and wait to see whether it's worth putting in the core code. (Of course it doesn't cover a variety of uses that e.g. involve changing how history is used, but it seems like that philosophical argument needs to be broached.)

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.

2 participants