Flash cards for language learning

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.

5 Likes

This looks great! I'm so frustrated with Duolingo's mobile app (and the company for that matter), so I primarily do my lessons through the web browser on my mac, except for the story and listeningβ€”the most valuable for learningβ€”lessons because frustratingly they're only available on the mobile app.

I also have an app from the app store that puts new vocab in my menu bar throughout the day, which I like even though it's less useful than I'd hoped.


N.b. pro tip when learning German: always include the article [der/die/das/die] with the nouns in your flashcards. The gender of a noun is not always implicit (e.g. die Frau - feminine, but das MΓ€dchen - neuter), and the only way to know the genders is to memorise them, unfortunately, and the genders are hugely important once you start changing cases in more complex sentences. (Duolingo does not do this and I'm so thankful that I already had a strong foundation in the language before I started using it.)

2 Likes

I just noticed a couple hardcoded English and German references; I'll be uploading an updated version shortly with those fixes, and one other new feature.

Edit: Posted now in the first post.

-rob.

I just posted an update, as my lists stopped working when my card count went over 100 ... yea, bit (again) by the default "don't show more than 100 items" default for the Prompt With List action :).

-rob.

Another new version today. This one adds a requiz feature, which quizzes you on the words you missed until you either get them all right or give up. I've modified the original post with new screenshots and an updated download.

-rob.

New version posted with two major new features: A main menu to access all the other macros, and a new practice mode for studying words. Details and link in the first post, but here are the two new UI elements:

-rob.

Each day I use this macro, I realize I want it to do something just a bit more or different…today's addition is a "difficult words" dictionary. When practicing, you can press M to mark difficult words, which are saved in a separate file (set its path in the Required Variables macro).

Once you have difficult words, practice will let you choose whether to practice all words or just the difficult words. Note that there's no management of the difficult words list within the macros; just edit the file yourself in a text editor, or delete it to start fresh.

Newest version linked in first post.

-rob.

I'm beginning to wonder if what you might actually want is Anki :sweat_smile:

Anki is really comprehensive (FOSS) software, but I rarely use it because I'm just bad at opening full software for whatever reason, which is why I'm excited for your macro to remove that element of friction. Although you've updated it all these times, and I've downloaded every single version...and have yet to actually use it. It might be that I'm just bad at flashcard discpline generally.

Wowza, that's so much more than my simple little macro will ever be! Probably what I should have started looking for instead of writing something, but to be honest, the setup looks like pure complexity :).

I'll take a look, though - thanks!

-rob.