I'm using Duolingo to try to train my brain to learn a new language. The app itself is fine, but I wanted a vocabulary study tool to use at my Mac, away from the iPad (and the overly gamified interface of Duolingo). Duolingo has quizzes, and includes voice quizzes, which are very useful. But I didn't want to have to run the app every time I wanted to study words.
So I wrote what started as a simple quiz macro to help me learn the words. It has since morphed quite a lot, and is now a more fully-featured flash card macro.
Here's the macro:
Jan 19 release: β Flash Cards Macros.kmmacros (158 KB)
The macro group consists of four five seven macros:
βββββββββββββββββββββββββββ
_Main Menu
Assigned a hot key (Shift-Ctrl-Opt-L), this pops up a menu from which you can access each of the flash card macro's functions:
The support macros each call the main menu when they end, so you'll always wind up back here. The choices are hopefully self-explanatory.
00 - Required variables
There are but three: The path to the file where the flash cards will be saved, your native language, and the name of the language you're trying to learn. These last two should be as simple as they can beβdon't use "The King's English As Spoken In Southern England," but rather just "English."
That's because they'll be the key names for the JSON variable that holds all the data.
02 - Practice
I wasn't doing well on my quizzes, and that's because I didn't have a really easy way to study the entries in my growing dictionary. Now I do. Pick this module, and you can easily work through the entire dictionary, revealing answers if needed, or just skipping words if you know them well:
New in this version is an indefinite wait, instead of a timed delay, when the answer is onscreen: The macro now pauses until you press the Space Bar to continue. Also new in this version is the ability to flag words as tough (by pressing "M"), which saves them in their own file:
Once you have a list of difficult words, the practice macro asks which one you'd like to practice with:
Note that there's no ability to manage the difficult words list within the macro; if you want to start over, delete the file, or edit it to remove words you've since memorized.
02 - Quiz Me
The quiz macro. When launched, it checks to make sure you have flash cards; if you don't, it will launch the flash card creator macro. If you do, you'll see a dialog showing you how many flash cards you have, and asking how many you'd like to be quizzed on:
Press Enter or enter a lower number, and then you'll see the first quiz card:
The questions are selected at random from your flash cards; each time you answer a question, that card is removed from the variable holding the flash card values, so you won't see it again.
This is a very basic quiz macro: There's no intelligence applied to your answer. That is, you must type the answer exactly as it was typed when you set up the flash card. Typos mean the answer is wrong, and there's no "are you sure?" button before you submit an answer.
When you answer the first question, a progress meter pops up letting you know if you got the question right or wrong, and how many questions you have left to go:
When you finish the quiz, you'll be asked if you want to be quizzed again on just the words you missed:
The requiz is on all missed words, continuing until you have none wrong, though you can give up at any time:
When you give up, you'll see the right answers for the words you never got, along with your original results:
If you get through the requiz with all the right answers, you'll see a similar summary box:
And if you opt out of a requiz, you'll see another similar summary box:
As you can see in the results box, you're not restricted to single-word values; you can enter phrases as well, on either the native or foreign language side of the card.
03 - Add flash cards
This macro was written to be left running while I worked in Duolingo. It just sits onscreen, waiting for new words:
As soon as you click OK, the values are saved to disk, and then the blank dialog reappears. To exit, you can just click Cancel or press Escape, or if you know you just want to enter one (or just one more), click the "Done adding items" box before you click OK.
There is some intelligence in this macro: It will check to make sure you haven't already added the word to your flash cards, and it makes sure you populate both the native and foreign language values.
I write to the file every time I make a change, so that I can leave the dialog onscreen and never worry about it not saving a bunch of batched entries if I happen to hit Escape without thinking.
04 - Browse and edit entries
I added a simple editor that lets you browse all the definitions, and edit the foreign language side of any entry:
I restrict the edit to the foreign side as it was too complicated to figure out how to prevent duplicates if you change the native language side. If you need to do that, just delete and re-add, or edit in a text editor :).
05 - Delete entries
This is a very basic macro that lets you delete entries from the flash cards. It's done through a Prompt With List action that allows multiple selections:
Use Shift and/or Command to highlight multiple entries, then double-click any selected line to proceed. The macro will ask for confirmation before deleting:
Click Yes, and poof, they're gone. There's no ability to edit, but I do use "pretty JSON" when saving, so you can edit entries in any text editor quite easily:
βββββββββββββββββββββββββββ
I'm pretty happy with how this has evolved ... and yes, Duolingo has this built in, but I'm at my Mac all day, and typing in the words to add them to my flash cards helps my brain remember them even before I do any quizzing. I also prefer the no-flashiness no-sound interface of my quiz to that of Duolingo's :).
This could easily be adapted for other study uses, of course; it's just storing a series of two-item data elements in a JSON variable, and retrieving one based on a random number. Instead of languages, those two data elements could be Process and Description, or Element Number and Element Name, etc.
-rob.