Skip to content

Troubleshooting

Glutanimate edited this page Aug 20, 2017 · 8 revisions

Troubleshooting

General Information

Basic Troubleshooting Procedure

Before reporting an issue on GitHub or the Anki support forums please check if any of the following steps fixes your problem:

  1. Restart Anki
  2. (If pasting in text from an external source, try a pasting in a different text)
  3. Reinstall Cloze Overlapper. This will update the add-on to the latest version.
  4. Only if you've modified your Cloze Overlapper note type, i.e. the fields or the card template: Reset them to the defaults (see below)

Resetting Note Type and Template to the Defaults

Note Type

To restore the original note type please do the following:

  1. Go to ToolsCloze Overlapper Options..., Click Restore Defaults, and then confirm with OK

    This will reset all global settings, custom field names included. Your note-specific settings will remain untouched by this.

  2. Go to ToolsManage Note Types

  3. Select the Cloze (overlapping) entry

  4. Click on Fields

  5. Add, Delete, or Rename the listed field entries in order to restore the following list of default fields:

Original
Title
Remarks
Sources
Settings
Text1
Text2
Text3
Text4
Text5
Text6
Text7
Text8
Text9
Text10
Text11
Text12
Text13
Text14
Text15
Text16
Text17
Text18
Text19
Text20
Full

Some Notes For Advanced Users

The settings above are the defaults the add-on ships with. The actual requirements for the note type are far more lenient. Cloze Overlapper will work with any note type as long as it is named appropriately (name either starting with Cloze (overlapping), or added to the custom note types list) and as long as it contains all of the following fields:

Original
Settings
Text1
Text2
Text3
Full

The number of Text fields is arbitrary, but there should always be at least 3.

Card Template

To restore the original card template please do the following:

  1. Go to ToolsManage Note Types
  2. Select the Cloze (overlapping) entry
  3. Click on Cards
  4. If you are having trouble with your cards always ending up in one deck: Click on More and make sure that it says Deck override (off) in the menu. If the override is on you will have to click on that menu option and clear out the deck name in the window that appears subsequently.
  5. If you are having trouble with your card formatting: Please fully restore the card template by copying and pasting the snippets below into the respective template fields.

Default Front Template

<div class="front">
  {{#Title}}<div class="title">{{Title}}</div>{{/Title}}
  <div class="text">
    {{cloze:Text1}}
    {{cloze:Text2}}
    {{cloze:Text3}}
    {{cloze:Text4}}
    {{cloze:Text5}}
    {{cloze:Text6}}
    {{cloze:Text7}}
    {{cloze:Text8}}
    {{cloze:Text9}}
    {{cloze:Text10}}
    {{cloze:Text11}}
    {{cloze:Text12}}
    {{cloze:Text13}}
    {{cloze:Text14}}
    {{cloze:Text15}}
    {{cloze:Text16}}
    {{cloze:Text17}}
    {{cloze:Text18}}
    {{cloze:Text19}}
    {{cloze:Text20}}
    {{cloze:Full}}
    <div class="hidden">
       <div>{{Original}}</div>
    </div>
  </div>
</div>

Default Styling

/* general card style */

html {
  /* scrollbar always visible in order to prevent shift when revealing answer*/
  overflow-y: scroll;
}

.card {
  font-family: "Helvetica LT Std", Helvetica, Arial, Sans;
  font-size: 150%;
  text-align: center;
  color: black;
  background-color: white;
}

/* general layout */

.text {
  /* center left-aligned text on card */
  display: inline-block;
  align: center;
  text-align: left;
  margin: auto;
  max-width: 40em;
}

.hidden {
  /* guarantees a consistent width across front and back */
  font-weight: bold;
  display: block;
  line-height:0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.title {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 1em;
  text-align: center;
}

/* clozes */

.cloze {
  /* regular cloze deletion */
  font-weight: bold;
  color: #0048FF;
}

/* original text reveal hint */

.fullhint a {
  color: #0048FF;
}

.card21 .fullhint{
  /* no need to display hint on last card */
  display:none;
}

/* additional fields */

.extra{
  margin-top: 0.5em;
  margin: auto;
  max-width: 40em;
}

.extra-entry{
  margin-top: 0.8em;
  font-size: 0.9em;
  text-align:left;
}

.extra-descr{
  margin-bottom: 0.2em;
  font-weight: bold;
  font-size: 1em;
}

Default Back Template

<div class="back">
  {{#Title}}<div class="title">{{Title}}</div>{{/Title}}
  <div class="text">
    {{cloze:Text1}}
    {{cloze:Text2}}
    {{cloze:Text3}}
    {{cloze:Text4}}
    {{cloze:Text5}}
    {{cloze:Text6}}
    {{cloze:Text7}}
    {{cloze:Text8}}
    {{cloze:Text9}}
    {{cloze:Text10}}
    {{cloze:Text11}}
    {{cloze:Text12}}
    {{cloze:Text13}}
    {{cloze:Text14}}
    {{cloze:Text15}}
    {{cloze:Text16}}
    {{cloze:Text17}}
    {{cloze:Text18}}
    {{cloze:Text19}}
    {{cloze:Text20}}
    {{cloze:Full}}
    <div class="hidden">{{Original}}</div>
  </div>
  <div class="extra"><hr></div>
  <div class="text"><div class="fullhint">{{hint:Original}}</div></div>
  <div class="extra">
    {{#Remarks}}
    <div class="extra-entry">
      <div class="extra-descr">Remarks</div><div>{{Remarks}}</div>
    </div>
    {{/Remarks}}
    {{#Sources}}
    <div class="extra-entry">
      <div class="extra-descr">Sources</div><div>{{Sources}}</div>
    </div>
    {{/Sources}}
  </div>
</div>
<script>
  // remove cloze syntax from revealed hint
  var hint = document.querySelector('.fullhint>[id^="hint"]')
  var html = hint.innerHTML.replace(/\[\[oc(\d+)::(.*?)(::(.*?))?\]\]/mg, "$2")
  hint.innerHTML = html
  // scroll to cloze
  document.addEventListener('DOMContentLoaded', function() {
    setTimeout(function(){
      const cloze1 = document.getElementsByClassName("cloze")[0];
      const rect = cloze1.getBoundingClientRect();
      const absTop = rect.top + window.pageYOffset;
      const absBot = rect.bottom + window.pageYOffset;
      if (absBot >= window.innerHeight) {
        const height = rect.top - rect.bottom
        const middle = absTop - (window.innerHeight/2) - (height/2);
        window.scrollTo(0, middle);};
    }, 1);
  }, false);
</script>

If you've renamed any of the fields listed in the note template you will have to change the field names accordingly in the Front and Back templates above.

Specific Issues

Note Type Error: Cloze fields are not continuous

This is usually caused by manual modifications to the note type. Please try resetting your note type fields to the defaults.

Clone this wiki locally