RisingOrange / anki-enhanced-cloze

20 stars 3 forks source link

Hide Cloze, Show only contextual relevant ones #72

Open itsmarble opened 1 year ago

itsmarble commented 1 year ago

It would be very helpful if there was the possibility to hide individual clozes. For example, when I query an exam scheme, only the elements of a certain level (and higher-ranking ones) are on the screen, so that it is not overloaded - I do not mean that the others are covered, but are not displayed at all. I have always used the cloze text template with attached documentation for this, unfortunately it only works to a limited extent. A similar function would be fantastic for this add-on here.

What is behind >>> (i.e., three consecutive greater-than signs) is generally initially hidden. This section is only revealed immediately if text is queried that is behind it. Example:

Section 1 >>>Section 2. If a cloze text within Section 1 is queried, everything from >>> is initially hidden. However, if a cloze text within Section 2 is queried, the entire text is immediately displayed.

[[ and ]] What is within two square brackets ([[ and ]]) is also generally initially hidden. The entire contents of the bracket are only displayed from the beginning if something within these square brackets is queried. Example:

The capital of Germany is [[since {{c2::1990}}]] {{c1::Berlin}}. If it is queried what the capital of Germany is (= cloze text 1), the additional information "since 1990" is initially hidden. If the second cloze text position is queried (Since when is Berlin the capital of Germany?), the contents of the square brackets are immediately revealed.

You can use >>> both outside and inside (!) of [[ ]]. The use of >>> within a [[ ]]-bracket makes sense to reveal their contents only gradually. Example:

Definitions Theft (§ 242 StGB) Removal [[is {{c1::the breaking of foreign and the establishment of new, not necessarily perpetrator-owned custody.}} >>>Custody is {{c2::the actual control of a person over a thing,}} >>>which {{c3::is driven by a natural will to control.}}]]

Movable [[is a thing, if...]]

Intent to appropriate [[is...]] If two sections with [[ and ]] follow each other immediately as in this example:

[[{{c3::District courts}} are divided into {{c1::departments.}}]]

[[{{c4::Regional courts}} are divided into {{c2::chambers.}}]] ...you can write || instead of the inner ]][[:

[[{{c3::District courts}} are divided into {{c1::departments.}}

||{{c4::Regional courts}} are divided into {{c2::chambers.}}]] You can also use || alone to quickly divide related information into individual packages:

{{c3::District courts}} are divided into {{c1::departments.}}||

{{c4::Regional courts}} are divided into {{c2::chambers.}}` The sentence from which nothing is queried is then initially hidden.

and

If text is queried that is between and , everything that follows the respective queried position is initially hidden with >>>. This can be useful, for example, with longer definitions. Example:

An attempt has failed if

{{c1::the perpetrator, according to his subjective perception}}

{{c2::cannot complete the act with the means available to him}}

{{c3::without a temporal break.}} If the first cloze text position is queried ("the perpetrator, according to his subjective perception"), everything that follows, for example, is initially hidden.

(See https://thomaskahn.de/jura-vorlagen/#/dokumentation)

itsmarble commented 1 year ago

Of course, it would be even better if the addon could automatically recognize outline levels and always cover the fields with a lower outline rank, display those with the same outline rank (which may be currently queried together), and even automatically reveal those with a higher outline rank. Especially in large exam schemes, one quickly loses track of which main points one currently has a cloze for.

SCR-20230803-pvsz

E. g. I'd love to have 4. and III. automatically unveiled but the ones in between the to red ones hidden, as they are not relevant here.

itsmarble commented 1 year ago

Upon reflection, the implementation of this concept might be surprisingly straightforward, provided that a single, simple parameter is introduced. Imagine a parameter that establishes a hierarchical order, perhaps defined in a manner akin to this:

{{c1::\1\content within this bracket}},

{{c2:: \2\ additional content}},

or something along those lines, where the specified rank \Rank\ determines what is concealed and what is revealed.

During the review process, all clozes with a higher hierarchy (i.e., a higher numerical value) should remain completely hidden, while clozes of the same rank should be obscured. Conversely, clozes of a lower order should be fully unveiled and displayed.