Anki shows cards that are intentionally empty (I input no information)

Anki shows cards that are intentionally empty. That is, there is no information to be tested on (because the card doesn’t apply to the information).
(Back Template code at the bottom of post)

Context: I am learning Arabic vocabulary and want to have a card type to learn the verbal noun. The problem is that I’m being tested for the verbal noun for regular nouns.
(Verb: swim, verbal noun: swimming.
Noun: bear, verbal noun: blank/DNE)

I would love advice on how to stop Anki from testing me on cards that don’t have data.
Thank you so much for your time and help!

FYI, I used chatGPT for this code, hoping it would be a quick fix. I don’t know how to code.

Back Template code:

{{FrontSide}}

{{#MuSdar}}
{{#MuSdar Levantine}}
<hr id=answer>

<div class="answer-box">

{{#MuSdar}}
    <div class="answer-box">{{English}}</div>
    <div class="title">:مصدار</div>
    <div class="answer-box-Fusħa">ال{{MuSdar}}</div>
    <hr>
{{/MuSdar}}

{{#MuSdar Levantine}}
    <div class="title">:مصدار</div>
    <div class="answer-box-levantine">ال{{MuSdar Levantine}}</div>
    <hr>
{{/MuSdar Levantine}}

</div>

{{#Fusha MuSdar Sentence}}
<div style='font-family: "Amiri"; font-size: 35px;' id="fusha-musdarsentence">{{Fusha MuSdar Sentence}}</div>
{{/Fusha MuSdar Sentence}}

{{#Fusha Eng MuSdar Sentence}}
<div style='font-family: "Arial"; font-size: 20px;'>{{Fusha Eng MuSdar Sentence}}</div>
{{/Fusha Eng MuSdar Sentence}}

{{#Levantine MuSdar Sentence}}
<div style='font-family: "Amiri"; font-size: 35px; display: none; color: #c23df2;' id="levantine-musdarsentence">{{Levantine MuSdar Sentence}}</div>
{{/Levantine MuSdar Sentence}}

{{#Levantine English MuSdar Sentence}}
<div style='font-family: "Arial"; font-size: 20px; color: #c23df2;'>{{Levantine English MuSdar Sentence}}</div>
{{/Levantine English MuSdar Sentence}}

<script>
    // Compare Fusha and Levantine Arabic MuSdar Sentences
    var fushaMuSdarSentence = document.getElementById("fusha-musdarsentence");
    var levantineMuSdarSentence = document.getElementById("levantine-musdarsentence");
    if (fushaMuSdarSentence && levantineMuSdarSentence && fushaMuSdarSentence.innerText.trim() !== levantineMuSdarSentence.innerText.trim()) {
        levantineMuSdarSentence.style.display = "block";
    }
</script>

{{/MuSdar Levantine}}
{{/MuSdar}}

You posted the back template – but Anki decides whether or not to create the card based on the front template. An empty front means no card will be created – Card Generation - Anki Manual . [ChatGPT is comically bad at everything having to do with Anki, so it generally cannot be trusted.]

Or if the fields on the front template aren’t blank, you can use another field to stop the card from being created. When you say “I input no information” – what field (or combination of fields) is empty for these notes?

1 Like

Oh wow, thank you so much for your quick reply!

When I say “no information,” I mean when I import the Excel file, I have left some of the cells blank when there is no information to be tested on. That is, when there is no verbal noun, like when there is already just a regular noun.

e.g.
(Verb: swim, verbal noun: swimming.
Noun: bear, verbal noun: blank/DNE )

When the fields on the front template aren’t blank, can you help me learn how to use another field to stop the card from being created? I would really appreciate that!

Here is the front template code:

<div style='font-family: Amiri, Italic; font-size:20px;'>
<div class="title">:مصدار</div>
<div style='font-family: Amiri, Italic; font-size:40px;'>
<div class="">{{Fusħa}}</div>
</div>
<br/>

Sure, you’ll use Conditional Replacement to do that – just as described in Card Generation - Anki Manual .

You didn’t tell me what the empty verbal noun field is called, but the syntax is to put {{#FieldName}}
before the rest of your front template, and
{{/FieldName}}
at the end.

2 Likes

Great! Thank you so much for your help!! This worked like a charm!

The way I do it, is to have an additional field in my spreadsheet, which I test before supplying the information on a verbal noun. That is, check that the type of your word is a verb, and only then display information on a verbal noun. Or alternatively, check that the verbal noun column in not empty, before displaying the card.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.