German vocabulary builder (VBA)

One of the difficult things about learning a new language is the number of new words one has to learn from scratch. You might have tackled the grammar and the syntax principles, but without a big vocabulary, you’ll only be ‘oh how cute, you speak a little X’. And that’s frustrating as hell.

Example for windshield

So I’ve coded this little VBA program that attempts to use the power of spaced repetition to increase the brain’s ability to grab onto new words and solidify recent ones.

The code isn’t that elegant, but it does the trick. Also, I was just learning to use VBA with this program.

So, the user is supposed to add words and for each one add audio and images. The code doesn’t do this for the user, which means that the user should add the words in excel and media in a specific folder.

The spaced repetition part of the code was kinda simple. It’s below. What was hard was playing audio and ensuring the code was robust enough to deal with data input errors.

Sub approved()

For j = 2 To lastrow

'memorized word is reset to be tested again
If Worksheets("Vokabular").Range("L" & j).Value <> "" And Worksheets("Vokabular").Range("L" & j).Value <= Date Then
Worksheets("Vokabular").Range("L" & j & ":M" & j).Value = "" 'erases dates
Worksheets("Vokabular").Range("J" & j & ":K" & j).Value = 1 'attempts and successes are set to 1
End If

'approved by reaching the goals
If Worksheets("Vokabular").Range("I" & j).Value >= target_efficiency And Worksheets("Vokabular").Range("J" & j).Value >= minimum_attempts And Worksheets("Vokabular").Range("L" & j).Value = "" Then
Worksheets("Vokabular").Range("L" & j).Value = Date + dias_sem_testar
End If

'manually approved
If Worksheets("Vokabular").Range("M" & j).Value = "x" Then
Worksheets("Vokabular").Range("L" & j).Value = Date + dias_sem_testar_memorizado
Worksheets("Vokabular").Range("M" & j).Value = ""
End If

Next j

End Sub

Deixe uma Resposta

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da

Está a comentar usando a sua conta Terminar Sessão /  Alterar )

Google photo

Está a comentar usando a sua conta Google Terminar Sessão /  Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão /  Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão /  Alterar )

Connecting to %s