Memrise card template [support thread]

Could do. How would I do this?

Actually, this works for me! Thanks!

1 Like

Why is my Choices Picture in multiple lines on ankidroid and ankiweb mobile? Help me fix it

Because that’s what Memrise decided to have as their style for very narrow screens:


The default template setup recreates exactly that.


If you want the multiple-choice buttons to be always displayed in two columns, you can add the following style to the “User styles” section at the end of the styling tab in your template.

.card-content.mch:not([mode]) #scr-keyboard,
.card-content[mode="mchoice"] #scr-keyboard {
  grid-template-columns: 1fr 1fr;
}
1 Like

Ok, Thanks. I got it

1 Like

How can I have both typing and mcq for a word? Like in Memrise, a word will be shown with everything first and will be asked on mcq first and then typing later or tapping kind like that. Thanks

The MultipleChoice+Typing/MultipleChoice+Tapping Note Types from the shared deck should produce exactly that. You just need to run “Fill Choices” as instructed to activate the MCQ. And to see the info when you are encountering a card for the first time, simply fail it - there are no drawbacks to doing so in the learning stage.

1 Like

Hi what happened to memrise why do so many quit memrise?

1 Like

Quite a lot of things over the years, actually, and they all lead downhill. The latest one, which is still the driving wave, I suppose, is the looming plans to remove all user-created content from the platform. They’ve been postponing it several times so far, but with no other clear indication than the promise to keep it up till the end of this year, it is quite possible that all user courses will be deleted immediately after.

2 Likes

Patch notes for v5.1

1. Fix for audio buttons on iOS/macOS

Because Apple browsers have no support for the CSS used in AnkiWeb audio buttons in v5.0, a separate script was added to patch the issue when necessary:

Before and after

This should also prevent the same problem from occurring on AnkiMobile and the desktop mac app with buttons for external audio files.

2. Improved right-to-left text support

  • Added a dedicated style for right-to-left tapping cards:

    To enable it, add a dir="rtl" attribute to the <input> element on the front of the Card (or an "rtl" class to its .mem-typing container element):

    ...
    <input id="typeans" type="text" inputmode="text" autocorrect="off" autocomplete="off" autocapitalize="off" spellcheck="false" dir="rtl">
    ...
    
  • Similarly, for typing cards the right-to-left mode can be enabled by adding dir="rtl" to the same <input> element (or by adding dir="rtl" to the .mem-typing container instead to flip everything, including the label):

  • Note that because combining right-to-left characters with left-to-right text (including the source code for the template itself) is notoriously inconvenient, it is better to use Unicode HTML entities instead of explicit characters for setting up the onscreen keyboard. Here is a recommended setup for a full set:

    &#1575;&#1576;&#1577;&#1578;&#1579;&#1580;&#1581;&#1582;&#1583;&#1584;&#1585;&#1586;&#1587;&#1588;&#1589;&#1590;&#1591;&#1592;&#1593;&#1594;&#1595;&#1596;&#1597;&#1598;&#1599;&#1600;&#1601;&#1602;&#1603;&#1604;&#1605;&#1606;&#1607;&#1608;&#1609;&#1610;&#1611;&#1612;&#1613;&#1614;&#1615;&#1616;&#1617;&#1618;
    

    This should render the following when used as the static keys set (any suggestions for improving the layout are welcome):

3. Empty answers now are always auto-rated as incorrect

This is to work better with the alternative answers, which makes it too easy to accidentally leave an empty alt in a field. Strings made of only spaces and other blank characters are considered empty as well.

4. AnkiWeb TTS

Not included in the template itself by default, but the following version of the script, which makes all text-to-speech fields automatically work in a web browser, can be added to “:gear: user prior scripts :gear:” section on the front of a Card (the backside will then include it automatically):

TTSRegex = /\[anki:tts([^\]]*)\]([^\[]*)\[\/anki:tts\]/g;

function parseTTSAttrs(attr_string) {
    const attrs = {};
    attr_string.trim().split(/\s+/).forEach(attr => {
        const [key, value] = attr.split('=');
        if (key && value) attrs[key] = value;
    });
    return attrs;
}

function awTTS(text, lang) {
  const utterance = new SpeechSynthesisUtterance(text);
  utterance.lang = lang;
  window.speechSynthesis.speak(utterance);
}

function sanitizeStr(str) {
    return str.replace(/['"]/g, "")
}

function TTS2asvg(htmlContent) {
  return htmlContent.replace(TTSRegex, (_, attr_string, word) => {
    const attrs = parseTTSAttrs(attr_string);
    const lang = attrs["lang"]?.replace('_','-') || "en-US";
    return `
      <a class="replay-button soundLink awtts" onclick="awTTS('${sanitizeStr(word)}','${sanitizeStr(lang)}')" href="../#">
        <svg class="playImage" viewBox="0 0 64 64" version="1.1">
          <circle cx="32" cy="32"></circle>
          <path></path>
        </svg>
      </a>
    `;
  });
}

document.querySelectorAll('.card-content').forEach(cont => cont.innerHTML = TTS2asvg(cont.innerHTML));

Thank you very much for the card template! It looks gorgeous and very useful!!

By the way, I noticed a slight regression after testing it with the latest Anki version on PC. The hr element has a 1px height now. It results in a visual layout shift while moving from the front side to the back side of the card.

1 Like

Thank you. I will try to include this in the next release, but in the meantime, putting

hr#answer {
    height: 0;
}

into the ⚙️ USER STYLES ⚙️ section should fix the layout.

v5.2 - Note Type Constructor

This update brings a card Constructor to the support add-on, allowing for a friendly way of customizing the template: changing fields and their labels, adjusting directions of testing and the types of the tests, keyboard layouts, color themes, etc.:

No more manual Field renaming and reordering is required, and there is an explicit bigger-font setting. Any unconventional test types, such as spelling exercises, should also be very easy to setup from now on.

The options are based on the Memrise community course properties and gather all the settings from multiple pages of the original site in a single place.

Full comparison

imgs

Creating Memrise Note Types

To make a new Memrise Note Type, go to ToolsNew Memrise (Lτ) Note Type in the main Anki menu:

This will open a dialog with all the Memrise settings. Each option, when hovered, provides a hint, which indicates what original Memrise course setting it relates to:


(also see Memrise ↔ Anki glossary)

Keep in mind that selecting the “Multiple-Choice” option does not immediately generate Multiple-Choice Cards. It is still required to use the Fill Choices” function after some Notes are created from a newly constructed Note Type.

Presets

There are several presets packaged with the add-on that can be used to get a general idea of different possible setups or to serve as a starting point for customization:

Customized setups can also be saved as new presets by typing a unique name into the Preset field and pressing Save. It is recommended to save every preset that has the potential of being reused or needing adjustments in the future. The creator dialog does not modify existing Note Types, because they might include customizations that go far beyond basic Memrise settings and cannot be fitted back into a predefined set of GUI options. If a preset is saved, adjustments to the Cards generated from it can be made by creating a new Note Type from a loaded and modified preset and then converting all cards with the NotesChange Note Type command in the Anki Browser menu.
Minor changes to existing Note Types or changes not covered by the standard Memrise settings can still be made using the old way via the Anki Card Template Editor (example).
Having a saved preset will also simplify updating to newer versions of the template when they are released.


Functionally, all the cards generated using v5.2 template should remain the same as v5.1. Cloze Note Types are not currently available for generation using the UI and can only be manually customized from respective template in the template Anki Deck.

2 Likes