Show some text only for particular cloze deletion, without changing card template

Is there something like a “cloze addition” (this name sounds silly, I know), where you only display some text when a particular cloze deletion is active? I know you can sort of do this by modifying the card template, but that feels kind of overkill for what I would like to do.

What I’m trying to do is make a cloze card for a formula, with different expanded versions of the formula, where each expanded version is a separate cloze.

Here’s an example:

I’d like to have this one card generate two notes that look like this:


I.e. in both notes I’d be clozing over both formulas, so the prompt would look like “Var(X)=[…]”. However on the first note I’d have the first formula wrapped in a box, and on the second note I’d have the additional “expanded” word + the second formula wrapped in a box.

I think this would be doable if there was something like a cloze deletion, only that instead of hiding its contents when a particular cloze note is active, it would instead only show its contents when its cloze was active.

Have I completely overcomplicated everything? You tell me :))

The first thing I think of when you talk about “cloze addition” is a cloze hint. That will display when a cloze is “active” but before it is revealed, and you do that in the field, not on the template.

I’m not sure I quite understand what your intention is with the boxes – is that an empty box before the reveal or a box around the formula after the reveal? I assume in order to hide both you’ll have c1 and c2 nested and covering the same area.

The gist of a cloze card is that the revealed side is the same for all cards, with emphasis on what was clozed on the front. While you should be able to have different hints on the cards, I can’t quite wrap my mind around how to have different reveals on the cards. You might have to play around with it and see what works.

1 Like

Hi, thanks for your response! In the beginning I thought that cloze hints wouldn’t be sufficient for what I wanted to do, but after reading your response, and thinking about it for a bit, I realized that with them I can basically achieve what I want, and in a way simpler manner than what I was thinking of doing originally.

So thanks once more! :slight_smile:

1 Like

Once you work out your complete solution – I’m sure it will help folks in the future if you’ll post it here –

```

and with 3 backticks before and after, 
so it is in a code/preformatted text block.

```

So basically I had three requirements that I wanted to be fulfilled:

  1. for everything to be contained in a single note
  2. for it to be clear which version of the formula I have to recall, and which one of the formulas on the back side is that one
  3. for neither formula to be visible on the front side, but both to be visible on the back side

I realized that I could solve 2 and 3 if I just clozed over both formulas separately, then wrote a hint only for the formula that I was supposed to recall. This makes it sufficiently clear which variant of the formula I have to recall, and where it is on the back side.

Then to solve 1 I used nested clozes, with the same technique as mentioned before.

Here’s what the front sides look like:


Here’s what the back side looks like:

And here’s the code:

The formula for variance (using expected value) is: <br><anki-mathjax block="true">\begin{aligned}
\text{Var}(X)
&amp;=
{{c2::{{c1::
E\left[(X-E[X])^2\right]
::\text{short} }}
}}
\\
&amp;=
{{c2::{{c1::
E[X^2]-E[X]^2
}}
::\text{expanded} }}
\end{aligned}</anki-mathjax><br>
1 Like

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