Cloze one by one uncovering

Hello, this script here has helped me greatly. I’ve used it in my medical studies succesfully. Thank you very much.

I use “Q” on my keyboard to uncover them. Is there a simple way to make this work on AnkiDroid? Such as adding a simple button or changing Q to double tap, or tapping on the […].

Unfortunately I don’t know anything about JavaScript, I have tried to have a play but I’ve always messed it up!

I used your script further down, but the formatting puts all of it into a box and centers it, which unfortunately confuses my rather large cards. I note someone else asked about this also, so any help appreciated

Thank you all

My template maybe help for you.

I combined the best ideas from everyone in this post with my template.

You are also welcome to make PR or suggestions, I will continue to improve it in my spare time

1 Like

Hi, I fixed the hint bug with ClozeAdv. You can test it @huandney.

1 Like

I replied on Github.

1 Like

@kleinerpirat Hello, recently a friend of mine found a weird problem while testing my template on an ios device.
Our floating button doesn’t seem to be fixed to the bottom right corner of the screen anymore. I typed out the log and saw that it should be that the height of safari’s webview will change with the content of the web page. Do you have any reference materials or related ideas that you can give me some reference?
I think vh is used as margin for bottom and right here, which does not perform well on ios devices

#controls {
    right: 5vh;
    bottom: 5vh;
    text-align: right;
    position: fixed;
    position: -webkit-fixed;
    display: table;
}

Finally, thank you in advance for taking the time to help.

Sry for the late answer. Yes, an incremental reveal is needed. Lot’s of medical curriculum is about processes. From light induction to the pathways of vessels to clinical/practical algorithms.
We’d like to create an extra “Ankiphil cloze one by one” for those kind of questions. We’d then take the card you highlighted and switch it’s notetype/create it again with the new notetype.
I looked back into the thread a few times and tried again tinkering on my own, but I can’t manage to get it integrated into the Ankiphil v2 note type.
In dire need of your help.

Hello,
Thank you all for your work.
I have been using a lot the cloze type of @kleinerpirat. Very useful.
This new card is helpful. There is no more the need of a “first front card”. And the button to cover again the last revealed cloze is great !
But, using it on an ipad, I need the buttons to always be fixed at the same place. down right corner was a good choice.
Another thing very important, is that when you touch the screen, you reveal all cloze. The thing is : it’s really easy to touch inadvertently the screen and ruin your studying of the card. Without it, it’s very tough to use it on a “touch device”. So I think a new button to reveal all clozes, and a way of revealing one cloze at a time by touching the screen “anywhere” (beside the buttons) would be a great improvement.
Also, the choice of “backquote” for a shortcut is not very convenient on my keyboard (in fact, I can’t type it). It could refrain some people not at ease with reading code.

I made a lot of cards for learning maths and statistics. From lessons, definitions/theorems and exercices. It’s really good, and I plan to share everything for future students on Anki (French language). All because of you, devheroes of our ages !

1 Like

Also,
is it possible to add an “autoscroll” feature to the cloze card ?
I think, there would be a need to activate/deactivate easily this feature, because it could be inconvenient to always go to the first current cloze (like if you need to know the title of the chapter), and one can also need to read the title.
Maybe one can think of a simple feature ?

If it can be of any help, my Clozolkor includes an autoscroll feature. Maybe it can help the other devs get to it more quickly.

Here’s the link to the relevant section of the code : Clozolkor/back.js at main · thiswillbeyourgithub/Clozolkor · GitHub

3 Likes

I added this code to the front model, it seems to work fine:

<script>
var scroll_to_cloze = () => {
   var mycloze = document.getElementsByClassName("cloze")[0];
   const element = mycloze;
   const elementRect = element.getBoundingClientRect();
   const absoluteElementTop = elementRect.top + window.pageYOffset;
   const middle = absoluteElementTop - (window.innerHeight / 2);
   window.scrollTo(0, middle);
}
if (typeof onShownHook !== "undefined") {
   //for Anki 2.1.x
   onShownHook.push(function() {
       scroll_to_cloze();
   })
} else {
   // for AnkiDroid
   setTimeout(function() {
       scroll_to_cloze();
   }, 10);
}
</script>

My version of incremental cloze card type is here: https://ankiweb.net/shared/info/1874787050

  • Simple cloze card with incremental reveal.
  • Works exactly as native cloze card type, but with incremental reveal.
  • Tap anywhere on the card to reveal next cloze.
  • Press “Show answer” to reveal all clozes.
  • Works in Anki Desktop and Anki Droid.
1 Like

hi,
i replied you at the download page.
hyperlink didn’t work in your cloze template,
but will work in anki’s original cloze.
pls see if it can be done, thanks

hyperlink didn’t work in your cloze template

Fixed. The updated deck is going to available in 24 hours. You can download it immediately at github.com_foenixx_anki-incremental-reveal-card (replace underscores with slashes).

1 Like

thx, will try

yeah it worked now for hyperlink, thx

i have to say it now worked very well,
it now can use hyperlink,
also it works with other add-ons so far i tested.
thanks

hi, however after some use, i found it’s a little bit imperfect.

when i re-started anki and start study using click “decks”.

in the first cloze incremental card, 1 click will reveal 1 answer.

but then in the 2nd cloze incremental card, seems 1 click will reveal 2 answers.

then in 3rd one revealed 3 answers :rofl:

it’s still working but would be nice if could be corrected, thanks

Try the updated deck from github (github.com_foenixx_anki-incremental-reveal-card) and let me know if it works.
Bonus feature: now you can tap on specific cloze to reveal it.

2 Likes

I’ve just updated the deck at github. This time the bug is really fixed (hopefully). If you downloaded the deck before, do it again please.

2 Likes

just tested, the bonus feature is good!

quite best experience,

good at desktop.

Not sure for mobile like 8" windows tablet. (the one using closet by kleinerpirat+/- others with virtual buttons may be more suit that)

have to deploy for sometime for stability but thanks!
ps hyperlink works