Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Anki Hint-peeking Plugin
This is a plugin for the Anki flashcard program. It allows peeking at some of the fields in a flashcard before seeing the answer. This can be used to peek at example sentences, pronunciation for Chinese/Japanese/Korean, or anything else where you may want to look at an extra field as a hint.
By default, pressing the ‘r’ key in a question slide will reveal the hints, but this, as well as other options, can be configured.
The easiest way to install the Hint-peeking plugin is through Anki.
- Go to the “Download Shared Plugin” browser (File→Download→Shared Plugin).
- Search for “Hint-peeking” plugin and confirm to install.
The plugin has reasonable default settings, so it is possible that it may work with your existing deck. If not, it is often easy to modify the deck to make it conform.
- Open up the “Deck Properties Dialog” (Settings→Deck Properties) and edit the model that you will be using hints with.
- In the General tab, check that the answer field is called “Meaning”. If it’s not, you can change its name. Make sure that there is a field for the hint(s). In this example, the hint field is called “Example”.
- In the Card Temples tab, make sure that there is a “Recognition” template. Make sure also that the hint field is included in the “Answer” side.
- Once you have set up your deck correctly, open a “Recognition” direction card that has a hint.
- If you can’t recognize the card by itself, you can press the “r” key to reveal the hints.
- This should cause the fields other than the “Definition” field to be revealed. When you figure out the word, press the show answer button.
- Continue from the answer card as you would usually. Keep in mind that if you needed to use a hint, you might want to choose “Again” to practice the card more.
Open up your plugin folder and find the file named “Hint-peeking.py”. Open this file in a text editor, and locate the following section:
- If you would like to change the button that reveals the hint, simply change the value of SHOW_HINT_KEY.
A list of valid values can be found at http://opendocs.net/pyqt/pyqt4/html/qt.html#Key-enum.
- If you need to keep more fields than the “Meaning” hidden while showing the hints, simply add the extra field names to ANSWER_FIELDS.
For example, one could keep hidden both the “Meaning” and “English” fields hidden by changing the ANSWER_FIELDS line as follows:
- If you need to use hints in templates other than recognition, add them to CARD_TEMPLATES. You can find the card templates for a given deck by going to “Deck Properties”, choosing a model, and clicking “Edit”. This should then show a list of potential template names.