Add cloze support to CardType

Registered by ryan.freckleton

The CardType should allow for "highlighting" phrases or bullet points for
automatic generation of cloze deleted cards.

For example: a card with the phrase "[Poland] was the [second] [constitutional republic] in the world."

Should generate cards for "(...) was the second constitutional republic in the world.", "Poland was the (...) constitutional republic in the world." and "Poland was the second (...) in the world."

This feature should also allow cloze deletion within LaTeX tags, and possibly SVG files.

Blueprint information

Status:
Started
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Approved
Assignee:
None
Definition:
Approved
Series goal:
None
Implementation:
Beta Available
Milestone target:
None
Started by
Peter Bienstman

Related branches

Sprints

Whiteboard

PB: I'd also support [...] instead of tags, as that is less typing
RF: So the the card source would look like: "[Poland] was the [second] [constitutional republic] in the world"?
That looks a lot better than tags. The only additional worry would be escaping the [] when cloze deletion wasn't wanted. I guess we could do something like wikicreole where ~[...~] or \[...\] would render as [...] on the card instead of doing cloze deletion, what do you think?
------------------------------------------------------------
OldGrantonian:
I make two suggestions. There is an example at the end that consolidates these suggestions.

1) First suggestion: Cloze items having the same identification can be grouped in one answer.

2) Second suggestion: In the answer, all cloze deletions for the same sentence should be on one line, separated by commas. (The use of commas allows the user to have multiple words within a single cloze deletion.)

----------------

Example:

In 1314, King Robert the Bruce liberated Scotland. He defeated Edward II at the Battle of Bannockburn.

With cloze markings:

In [1314], King 2[Robert] [the Bruce] liberated 2[Scotland]. He defeated [Edward II] at the Battle of
2[Bannockburn].
-----------------
First "Question":

In (...), King Robert (...) liberated Scotland. He defeated (...) at the Battle of Bannockburn.

First "Answer":

1314, the Bruce
Edward II
--------------
Second "Question":

In 1314, King (...) the Bruce liberated (...). He defeated Edward II at the Battle of (...).

Second "Answer":

Robert, Scotland
Bannockburn

RF: The only issue I have with this is it seems to violate the Minimum Information Principle...Perhaps we could have groupings of cloze deletions show up sometime after each individual one has been memorized? At the same time, I don't want the scheduling to become *too* complicated...
-----------------------------------------------------------------------------
OldGrantonian:

RF wrote:

"RF: The only issue I have with this is it seems to violate the Minimum Information Principle"

I'm fairly new to Mnemosyne and the theory of memory. Please specify which specific line or lines is violating the principle, and maybe I can modify the lines. (I've read Section 4 of SuperMemo's "Twenty Rules", which discusses the principle. Note that Section 6 of these rules recommends repeating the same sentence, but using differing cloze deletions in each replicate. This is where I saw the idea that I am proposing in this thread.)

RF wrote:

"I don't want the scheduling to become *too* complicated"

A simple (but not ideal) scheduling might be to treat all the child cards for a single parent identically. For example, if there were two child cards, and the user assigned a grade of "2" to the first, and "5" to the second, then the parent would be assigned the lowest grade ("2"), for scheduling purposes. (In this simple case, I assume that the "5" would simply be discarded.) Similarly, the children could be presented contiguously and in sequence, even although one child (grade "5") would not have been scheduled if two individual cards had been produced "manually" by the user. The two children would simply be instantiated "on the fly" by the program, and presented one after the other.

(My assumption in all this, is that if the user uses Deck > Edit current card, or Deck > Edit deck, the "Answer" will be empty. Is that a good assumption? I'm not sure what would happen if the user tried to edit the "Answer"? Implosion? Cheap nuclear fusion? So maybe only the "Question" should be editable, with the "Answer" greyed out.)
---------------------------------------------------------------------------------------------------------
Konrad:
Using [] with any markers for cloze support would break other people's cards. Questions with clozes could be defined as a separate card type: this type only requires one input per card ('fact'). The class handling this card type would automatically generate the question and answers.
Marking the clozes with a <cloze> would be better than using [], but would still do weird things with the Q/A.

RF: Can't we only expand [] into cloze answers if there are no specified answers to a card? This would cause old cards to be treated in the same way as they always have and prevents the need to add extra escaping if you're doing standard Q/A cards. [] is still displayed as always.
---------------------------------------------------------------------------------------------------------

I've added infrastructure to libmnemosyne 2.0 to allow these kinds of card types. I've also added a skeleton implementation of this card type (cloze.py), so that people interested to implement this can take in from there.

PB

---------------------------------------------------------------------------------------------------------

OldGrantonian (9 Apr 09):

I've just seen Peter's announcement about version 2.0 on the "mnemosyne-proj-users" forum. I think I had assumed that cloze deletions were dead.

Here are my comments. These comments only apply to what the user actually sees on the screen. Internal implementations are probably of no interest to the user.

----------------

RF: For example, if there were two child cards, and the user assigned a grade of "2" to the first, and "5" to the second, then the parent would be assigned the lowest grade ("2"), for scheduling purposes. (In this simple case, I assume that the "5" would simply be discarded.)

OG: Having statistics for each card is clearly the most appealing solution, But, in practice, maintaining only a single set of statistics is likely to be satisfactory, for the following reason.

I don't know how other people's minds work, but when I create multiple cards, I try to "balance" the difficulty between the two cards (sometimes three or more cards). Sometimes, on the first run through the cards, it becomes clear that one card is more difficult than the other. So I edit both cards, to balance the difficulty. If two cards are still too difficult (because there are too many cloze deletions, then I add another card to spread the cloze deletions more thinly.

Therefore, in practice, the grades for each card are likely to be almost equal.

----------------

RF: Similarly, the children could be presented contiguously and in sequence, even although one child (grade "5") would not have been scheduled if two individual cards had been produced "manually" by the user.

OG: I would prefer this method rather than have to have no cloze deletions at all. However, the first question plus the first answer provides (by definition) a "complete solution", Therefore the situation would be analogous to a program that does the following.

1) First, present a "complete solution".
2) Remove the "complete solution", and present only the question (for the second card).
3) When the user clicks "Show answer", the answer (for the second card) is presented.
3) Therefore, the actual interval of repetition is not (for example) 30 days, but only about 5 seconds.

----------------

RF: My assumption in all this, is that if the user uses Deck > Edit current card, or Deck > Edit deck, the "Answer" will be empty. Is that a good assumption?

OG: Yes. Unless the action of Deck > Edit deck could actually cause a "recompile", such that the answers are virtually displayed. I'm no programmer, so maybe the "compilation" time for large decks might be prohibitive.

Empty answers caused by the cloze deletion functionality should be visually different from answers that are empty because the user forgot to provide a value. Maybe a stock answer, such as "This answer will be auto-generated when you display the card."

----------------

RF: I'm not sure what would happen if the user tried to edit the "Answer"? Implosion? Cheap nuclear fusion?

We should investigate incorporating a geiger sensor, to allow immediate switching from battery power to the fusion cell :)

----------------

RF: So maybe only the "Question" should be editable, with the "Answer" greyed out.

OG: Fine.

----------------

OG: Here is a new comment.

I would like the ability to prepend one or more characters to the cloze.

An example is where the cloze is one of a pair of similar words, and I can never remember which is which.

Example: The only Commonwealth state in South America is Gu{...}

Here, there is no point in wasting time if I know that the answer is either "Guyana" or "Guinea", so I prepend the two common characters to the cloze.

Another example (which I use very frequently) is when I have a LIST of items, but I only need to know a few of those items to impress my boss. I don't care which items I actually remember during the meeting.

Example: The cat sat on the m{...}

Here, if I forget "mat", it doesn't matter because I'm confident that I can remember enough of the following items. (The actual remembered items might be different each time that specific card is presented.) I would mark that card correct if I remembered enough of the items.

This is a memorization principle that I cannot see in the list of SuperMemo methods. (Note also that it greatly speeds up the initial memorization, and cards are pushed into the future very rapidly, allowing more time to be spent on difficult cards.)
----
PB: the code does not care whether what is inside and outside [] is a whole word or not, so no problems here.

----
OldGrantonian: the minimum information principle is, I've always taken it as, the idea that each card should ask about as little information as possible. To take the example of 'In 1314, King Robert the Bruce liberated Scotland. He defeated Edward II at the Battle of Bannockburn.'. This is a bad item for a single card. It covers no less than 5 pieces of knowledge:
1. Scotland was liberated by Robert the Bruce
2. Scotland was liberated in 1314
3. Edward II was defeated at the Battle of Bannockburn
4. the Battle of Bannockburn won Scotland its independence.
5. Robert the Bruce won the Battle of Bannockburn

Each of *these* would make a good cloze deletion card ('Scotland was liberated in ____./1314'), but the original as a single monolithic whole? Not so much. --gwern

----------------------------------------------------------------------------------------

OldGrantonian (11 Apr 09):

Another feature that we should address is the "hint". Here is a verbatim SuperMemo example:

Q: Kaleida was funded to the tune of ...(amount) by Apple Computer and IBM in 1991
A: $40 million

----------------------------------------------------------------------------------------

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.