Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add the the word in a cloze deletion to the back of card? #20

Closed
bcordo opened this issue Aug 3, 2016 · 10 comments
Closed

How to add the the word in a cloze deletion to the back of card? #20

bcordo opened this issue Aug 3, 2016 · 10 comments
Labels

Comments

@bcordo
Copy link

bcordo commented Aug 3, 2016

Thanks for reading this.

Let's say I have a sentence:

Die Dame, welche (die) die Brosche gekauft {{c1::hat::habe}}, ist sehr reich.

And I want to add the c1 word "hat" to the back of the card automatically. So something like:

Front of card:
Die Dame, welche (die) die Brosche gekauft [habe], ist sehr reich.

Back of card:

hat
Die Dame, welche (die) die Brosche gekauft hat, ist sehr reich.

Is this possible?

Thanks so much!

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Aug 17, 2016

@bcordo Hi Brad, I'm actually working on a cloze theme for the next release. And if languages are your thing, I have a one I've created for my personal learning which follows the Fluent Forever method.

For displaying a cloze, first you need to make sure it's an actual cloze card. You can do this by duplicating the cloze note type and adding fields. Any field can be converted to a cloze type field and displayed on the card (front or back) by using the correct template tags

  1. So in the field, you'd have {{c1::hat::habe}} ...
  2. And on the template, you'd have {{cloze:FieldName}}

If you add the {{cloze:FieldName}} to the front and back of the card, the front will display [...] or [hint]; the reverse of the card will display the answer.

If you'd like a demo of my language deck, perhaps I can send you the ones I'm using.

@bcordo
Copy link
Author

bcordo commented Aug 17, 2016

@badlydrawnrob, sounds great. Thanks for the response, and thanks for creating this awesome repo. Yea, Fluent Forever is awesome, that's exactly what I've been using to create grammar cards for German.

I eventually figured out how to display the word in the close (in this case hat), on the back of the card using javascript.

<script>
var cloze = document.getElementsByClassName('cloze');
document.write(cloze[1].textContent);
</script>

What I wanted to do is replace the "multi purpose card" that Gabe gives us for the new word form grammar cards, which took a lot of time to make since you have to copy and paste the sentence multiple times, and add the front and the back. Now all I do is type the sentence once, add cloze fields and everything gets filled out automatically. I love it- I can crank out grammar cards much faster now.

Let me know if you would like me to send you those.

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Aug 18, 2016

@bcordo Glad you figured it out! Yeah it might be helpful to see an example deck, so I can see what you're trying to achieve — perhaps I'm misunderstanding you, but it sounds like a cloze note type will do what you're trying to do anyway. One thing to note is you can't convert a regular card into a cloze card (I think the multi-purpose card was a regular card).

You can find mine attached, I'm still not sure if they're overboard on fields but the cloze cards save quite a bit of time. I don't use all the fields all the time — to be honest, Fluent Forever takes a good amount of time in general, so perhaps it's best used sparingly when it's something that you're continually forgetting, or a particularly tricky conjugation (at least once past beginner level).

I'm yet to figure out the best way to learn a language, I'm still struggling with French! :)

french-fluent-forever.apkg.zip

By the way ... make sure you import it in a testing account, as I've adapted the original Fluent Forever note types, which will probably override yours!

@JustAQuest
Copy link

@bcordo I came across this conversation while trying to do exactly what you describe. Do you mind sharing your improved all-purpose card / cloze template? Thanks so much!

@bcordo
Copy link
Author

bcordo commented Aug 8, 2018 via email

@JustAQuest
Copy link

JustAQuest commented Aug 8, 2018 via email

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Aug 8, 2018

@JustAQuest I do think the cloze template takes a little while to understand, it's not entirely obvious from the docs that you have to specifically (from the deck screen):

  1. Click on "add"
  2. Click on "type" (of card)
  3. Click on "manage"
  4. Click "add"
  5. Click "Add: Cloze"
  6. Name your new note type
  7. Add any fields you need
  8. Follow their docs for using cloze note types

You can see my original cloze card — click "add" (card) then click on "cards ...". You'll then see the card template with Front Template/Styling/Back Template sections. It should make sense from there.

Anki is definitely not the most intuitive when looking through the docs.

@bcordo when you use {{c1:answer:hints}}, the hints show on the front, and the answer on the reverse, when you set the card template properly. Out of curiosity, what benefit do you get by using Javascript?

It's been a while since my last update but I have some pretty big changes coming in the next version, when I find a little time to update. It'll likely be simplified quite a bit (every time I go back, even I'm having WTF moments with the note types I've created)

Good luck!

@EloyRD
Copy link

EloyRD commented Jun 12, 2019

@bcordo @JustAQuest Hi. Would you mind sharing the CSS styling and HTML codes that allow you to do this? I can´t get the JavaScript snippet to work in my card.

I'm also trying to recreate the Fluent Forever method but with less work. I did replace the "syntax" card with the multiple cloze question. But I want to also replace the word order card with a cloze that in the front shows the word above the cloze without the [...].

Thanks.

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Jul 22, 2019

Hi @EloyRD @bcordo @JustAQuest ...

I've answered best I can here and here (although the old repo link is dead).

If I'm right in thinking, you're wanting:

  • hint word on the front
  • answer on the back

... Right? I've quickly grabbed some screenshots, which hopefully helps people:

Choose a cloze template

01-select-cloze

Select cards ... to view the template

02-cards

Create a cloze deletion

  • {{c1::answer::hint}}
    • c1 is the number of the cloze, you can add many c2, c3, ...

03-method

The results ...

04-front

05-back

Templates (css, html, js)

Styling is as easy as you want to make it. Take a look at the current cloze for this repo, but it might just confuse you.

  • Remove the [...] brackets: example javascript
    • I'm not a JS guy so homework for someone is how to override the original .cloze
  • Target the .cloze class, for css-ing.

To be perfectly honest though, I'd avoid using javascript — doesn't always play nice with Anki.

@rgould
Copy link

rgould commented Dec 31, 2020

If I understand it correctly, @bcordo was trying to have the cloze hint rendered on the back of the card. This is also my usecase. I've solved it in an ugly way by rendering {{c1::Text}} on the back of the card, which displays the raw cloze text.

Here's the full template for the back side:

{{cloze:Text}}

{{#c1}}
  <hr/>
  <small><small>{{c1::Text}}</small></small>
{{/c1}}

Here's what it looks like:

Bildschirmfoto 2020-12-31 um 12 16 00

Ideally I would like to just render the hint for the specific cloze ("weakened") in this case, rather than the entire sentence again

@badlydrawnrob do you know if that's possible somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants