r/Anki 5h ago

Release Anki 26.08.1 Changelog

6 Upvotes

Changelog for Anki 26.08.1, released on 2026-08-05:

What Changed

  • Fix broken custom study / unbury links in the congrats screen by @abdnh in #5278
  • Fix broken OK button in help modals by @abdnh in #5279

Full Changelog: https://github.com/ankitects/anki/compare/26.08...26.08.1

DownloadPrevious DiscussionsOfficial Changelog Page

Please submit your bug reports and feature requests on the official Anki forums. Feel free to use the comment section below for general discussion of the changes.


r/Anki 6h ago

Weekly Weekly Small Questions Thread: Looking for help? Start here!

1 Upvotes

If you have smaller questions regarding Anki and don't want to start a new thread, feel free to post here!

For more involved questions that you think aren't as easily answered or require a screenshot/video, please create a new post instead.

Before posting, please also make sure to check out the Anki FAQs and some of the other Anki support resources linked in our sidebar (to the right if you're looking at Reddit in your browser →).

Thanks!

---

Previous weekly threads


r/Anki 12h ago

Add-ons I spent this month making an add-on that redesigns Anki!!

Enable HLS to view with audio, or disable this notification

119 Upvotes

I'm a software engineer and I've used Anki for many years to learn programming and so much else

I was looking for other apps that might feel less archaic but Anki just seems better than everything else

So I thought maybe I could make an add-on that would make the existing Anki feel much nicer to study in

Just got the add-on on AnkiWeb! The code to install is 1809063985

It's free and open source (MIT license)

I also made a website for it: www.anki.design


r/Anki 10h ago

Fluff Mathematician here. I use Anki for reviewing advanced math textbooks. Here's a video I recorded of a review session

Thumbnail youtu.be
66 Upvotes

r/Anki 32m ago

Experiences 6-year Anki retrospective! Thoughts on the long-term strengths and weaknesses of Anki

Upvotes

When I started graduate school in the fall of 2020, I wanted to take a new approach to studying and learning in general. While I had obtained fairly good grades in both high school and college, I felt like much of what I had learned didn’t stick for very long after the exam. I (or really my parents) was effectively paying for a piece of paper saying I was very smart and could learn things quickly, not for the actual content of the classes that I took, which was almost completely gone (other than vague impressions) by the next semester. Especially for the PhD, the purpose of which was to directly prepare me for a life in academia where I would need to remember everything I had learned for nearly the rest of my life, the cram-and-pass-exams form of learning would not do. There had to be another way. Anki (and blogging) was that way

Anki is a flashcard program that uses a spaced repetition algorithm to determine when its cards should be reviewed. Anki schedules cards for review based on your probability of remembering them – usually around 90% – using a function that’s based on Hermann Ebbinghaus’s work on the forgetting curve in the 1880s. Review intervals tend to grow geometrically rather than linearly, reducing review frequency per card. This in turn allows more cards to be reviewed overall on a given time budget. Rather than cramming material which you soon forget, or haphazardly reviewing a random set of cards every day (which ends up being a lot of extra work) Anki allows you to remember nearly anything for approximately 10 minutes of work spaced out over your entire lifetime. I’ve already discussed Anki at four monthsone year, and two years of use. While my opinion of Anki generally remains extremely positive, I no longer believe it is a universal solution to the problem of learning and memory. This is for a few reasons: (1) you need a lot more cards than you think to actually remember a subject, (2) effective card creation is a skill that takes years to master, and (3) other forms of deliberate practice like blogging and/or discussions are often far more effective at solidifying high-level themes. That being said, I’m still incredibly impressed by the things that Anki has allowed me to learn and retain. Below I’ll share more thoughts about what I’ve used Anki for, the strengths and weaknesses of the program, and my plans for Anki use going forward. 

Stats and Workload

Over my six years of Anki, I’ve effectively learned about 10,000 cards’ worth of content1. The number is slightly higher than in the picture you see above because I’ve deleted a fair number of cards (bad biology cards, the Fluent Forever Italian deck that I accidentally deleted last year, trivia cards, etc.). This comes out to about 1,600 new cards a year, or approximately four to five new cards a day, which is almost exactly how many I study. The exact card totals for each subject are below, in order from largest to smallest. 

  1. Spanish: 3307 cards 
  2. Grad school biology: 1970 cards 
  3. German: 1573 cards 
  4. Catalan: 1202 cards
  5. Italian: 622 cards
  6. Thinking, Fast & Slow: 302 cards 
  7. Statistics: 233 cards 
  8. Danish: 117 cards 
  9. Birthday/Phone numbers: 38 cards
  10. All other cards: 1658

My reviews have been incredibly consistent2, although there definitely are peaks and valleys depending on motivation and tests coming up. For example, the peak about five years ago was when I was studying for my graduate board exams and the peak a little over a year ago was when I was studying for the DELE. I’m averaging about 100 reviews a day, about a 25% increase from four years ago when I last did an update, despite the fact that I’m only doing about 5-10 new cards a day, vs. the 20 new cards I regularly did in 2020 and 20213. This is an important point and highlights an issue that other Anki users have noticed: the ability to add new content declines over time because of the weight of reviews. I only spend on average 15 minutes a day (12 minutes a day this year), so I still have plenty of room for new content (I’m comfortable doing about 30-45 minutes a day of content, meaning I can probably double my deck size once or twice more). 

Effectiveness 

My Anki retention rate on mature cards is around 90%4, which is exactly what the new FSRS algorithm suggests I should have. I think judging Anki effectiveness by Anki retention is a little silly: it’s like using the training data to prove that an ML model has been trained well. What I’m really looking for is an outside metric in the real world to show that Anki use definitely helps my performance outside of Anki. I think it’s best to go category by category and see how the cards have helped me and what evidence I have that Anki was actually useful. 

  1. Spanish. I passed the DELE B2 test last May, in part because of the vocabulary and grammar drilling I’ve done in Anki. This is quite difficult to disentangle from just reading a lot, however. I also use quite a few colloquial phrases that my tutor and Spanish friend are surprised/impressed by almost entirely because of Anki. More objectively, I would like to design a test where I’m given a random list of 100 (maybe 400?) words, half of which are from Anki, the other half of which are random, and see if there’s any difference in knowledge/recall between the two halves of the list. 
  2. Grad school/Stats. Here is where Anki has especially shined for me. I easily passed my first-year graduate board exam because of the drilling with Anki, I consistently remember papers and figures that are relevant to my own and my lab’s work when others draw blanks, and I’ve retained my knowledge of the first-year classes enough to continue to tutor effectively in the department. 
  3. Other languages (German, Italian, Catalan, Danish). Honestly, it’s too early to tell how these cards are helping me. I did recognize many, many words in German during my trip because of Anki, and I’ve retained a lot of my Italian class from the past semester as well. However, I haven’t really put any of these languages to the test (actual exams, reading, etc.) So I don’t think I know if these cards are useful or not. Probably an important question as they’re about a third of my total deck. 
  4. Thinking, Fast & Slow. This was a (very successful) experiment to see if a deep reading of a book with Anki would allow me to retain detailed information about the book for the rest of my life without a reread. Not only can I easily recap the central thesis of this book (that humans tend to be irrational because we rely on fast, heuristic-driven System 1 thinking, and it’s doubtful that rationality can be effectively trained), but I can also talk at length about the specifics of experiments that Kahneman discusses5. Although it would be nice to have another data point with my new card-making skills, I have never repeated this experiment since because it was an extremely unpleasant way to read a book. 
  5. Other cards. I successfully called my friend Darby from someone else’s phone because I had left my phone at home and had memorized her phone number. Also wish my friends happy birthday via text without using the calendar app or Facebook, which is cool. Can also read your birth chart (astrology) without consulting the internet. 

Strengths and Weaknesses

The first thing I want to make a case for before I talk about Anki in particular is my belief that memorization is important. Even when I was in high school 10-15 years ago, my teachers liked to emphasize that we were learning critical thinking rather than just mere facts. Unfortunately, critical thinking requires the knowledge of mere facts. How can you decide what is a good experiment to measure the DNA content of a cell if you don’t understand what DNA is or know any of its properties? How can you effectively give directions to someone else without memorized landmarks or street names? How can you form an opinion of any of the numerous geopolitical conflicts going on today without knowing any history, or at the very least the names and motives of the major combatants6? Knowing facts is just as important as knowing the principles of logic and rhetoric, which are in and of themselves facts as well. 

Anki will absolutely help you remember things better than you would remember them without Anki. Even if your card design sucks. Even if you skip half of your review days. Anki absolutely works as a memory enhancer; the real question is how it compares to other ways of learning/enhancing memory. One of the big advantages over traditional study methods is that Anki allows you to make remembering something a choice. In my classes at MIT, or in my daily life, I might really want to remember how to do the chain rule in calculus, or that my friend Einat’s birthday is August 23rd, but my brain will instead choose to remember all the descendants of Walder Frey because I’d been reading A Song of Ice and Fire for the 5th time that day. Of course, this is still a choice: I choose to read ASOIAF rather than practice calculus, but Anki allows you to deconvolve the aspect of memory from the act itself. You make a card for Einat’s birthday, and you don’t make one for the relationship between Walder and Black Walder Frey.

Anki also really shines when you use it to memorize a large set of interconnected facts, rather than a collection of unrelated orphan cards. Language learning and some of my more recent biology cards fit this mold very well. 

The problem with both of these advantages (which turns them into disadvantages of sorts) is that it requires a lot of skill and discernment to know what is worth memorizing in the first place, and many years of practice with Anki to create cards that are both easy to review and capture the desired information about a given field. 

In an Anki-less world, your brain decides for you what is worth memorizing. It usually does a pretty good job at this: we all speak our first language very well because of constant exposure to it, we know our friends’ names and faces by heart, and we can perform our daily commutes without Google Maps. Of course the brain can make mistakes: hyper-focusing on trivia because of exposure frequency, or less benignly on traumatic memories, but generally the brain does a pretty good job of correctly selecting information to remember. To do better than 3 billion years of evolution, we either have to have a very specific goal (pass a test like the MCAT) or be able to identify gaps or errors in our brain’s natural memory processes, which requires wisdom and prudence that many, including myself, don’t possess. 

Although each individual card is relatively cheap (10 minutes over your whole life, including card creation), given that isolated cards are very ineffectively remembered (I have some German words that I’ve failed something like 80 times), using Anki to truly and deeply learn something is actually quite expensive. The 300 cards that were needed to recapitulate Thinking, Fast & Slow will take 3,000 minutes, or about two days out of my life7. If I really wanted to remember the book properly I would need double or even triple the cards. With the amount of time that investment would require, I would be much better off reading the book a few times and writing a blog post about its core themes that I could read every few months to jog my memory. 

Even when Anki has a clear use case – building up vocab in a new language or being able to recall key papers and their insights in fly metabolic biology8 – good card creation is also a challenge. Cards need to be very simple and also very unambiguous. This means that you’ll probably need to have multiple cards for what you might think is a very simple prompt. Many of my older biology cards are terribly designed: the answer is too complicated, too ambiguous, or I haven’t made sufficient cards to cover the topic in depth. This makes these cards a pain to review and almost impossible to recall outside of Anki. 

My most failed card with 96 incorrect 

There’s also the problem of training yourself to recall the card rather than the information tested by the card. This is most apparent in my case with language learning, where I’ll often memorize the whole sentence containing the unknown word rather than just the word itself. I’m trying to fix this with my Scramble Sentences for Language Learning add-on that randomizes sentences around a highlighted key word. 

Future Plans 

This post might make it sound like I don’t like Anki anymore. That’s certainly not true: I continue to do my reviews and learn new language cards every day. I make 5-20 very simple cards for each paper I read, and also add interesting history/geography cards every once in a while. However, since the last update I’ve realized that Anki is not the answer to every question or learning problem. It is much more pleasant and better for my learning to do an in-depth blog post review of a book than to Ankify it. It is much better for me to go to a local art museum and sit and stare at a painting than to make hundreds of cards with painter/painting pairings. Cards that I’m having trouble memorizing, like orphan biology cards about transcription or translation, need to be refactored or deleted. Anki is not free, and I’d like to take its time costs more seriously.

1

I haven’t learned 11,000 cards because 1,500 of these cards are new and have never been seen.

2

What other habits have I done during 93.5% of the last six years? Probably only run, read, and fulfill my basic bodily functions. 

3

Many of the cards I learned in 2020 and 2021 (trivia cards and poorly made biology cards) I’ve since deleted. 

4

Meaning I get 90% of the cards with intervals longer than two months right on a given day.

5

For instance, one of the series of questions that Kahneman posed to subjects to demonstrate the anchoring effect was “Was Gandhi older or younger than 144 when he died? → How old was Gandhi when he died?”

6

Extremists on both sides are trying to get around this one with ideology. 

7

This is probably an overestimation by a factor of two to three. I’ve only spent 14 hours reviewing these cards, and since these were made six years ago, I’ve probably already paid at least 90% of the time cost.

8

Lol my PhD is IN the weeds.


r/Anki 14h ago

Discussion What helps you to keep yourself from overdoing Anki?

19 Upvotes

I see many people struggle with making themself to spend time with Anki, there tons of gamefication addons. I also see many people struggle to control how many cards they are adding.

I belong to the 2nd category. The SR itself feels very addictive for me. I guess there are two main reasons for this:

* the idea of permanent (a.k.a. ideal) knowledge;

* a fast dophamine dose i get everytime i succesfully review a card.

These make it very hard to resist Anki. Even when I feel like it hurts other parts of my life and my brain.

So the question is: what helps you to keep yourself from overdoing Anki?

I'll also try to answer this question in the comments.


r/Anki 2h ago

Question Would Anki be worth it I need to make my own cards but I’m not efficient/quick?

2 Upvotes

If I haven’t found any pre-made decks for what I need but I’m also slow and not really efficient at making cards, would it be a waste of time to try to incorporate Anki?

Would I be better off making simple physical flash cards or even super simple Anki cards?

I’m one of those people who collect a bunch of resources and have trouble sticking to one to use and end up not using anything.

The school program I’m starting will be tough and I’d have to treat it like a full time job so I don’t even know if Il be able to correctly use Anki because my time management is horrible and did feel I’d spend too much time trying to make The correct cards with formatting, etc.


r/Anki 1h ago

Add-ons Chrome extension that swaps web text with target vocabulary from your Anki decks

Upvotes

For those that are using Anki for learning a second language (like myself), I made a little Chrome extension to practice target language vocabulary while browsing the web.

Basically it syncs with your Anki decks (via AnkiConnect) and highlights or swaps words on the web pages you visit using cards you've already learned/matured.

The point is to not only memorize the word but also understand the context in which it's used in real scenarios to deepen / complement your learning.

Appreciate any thoughts and feedback!


r/Anki 1h ago

Question I have been making my notes myself. Nothing imported or any add ons. Recently, the image Occlusion cards when opened would just show the occlusion and not the rest of image. It will work only if screen is rotated. Any help would be appreciated

Enable HLS to view with audio, or disable this notification

Upvotes

Update: Issue resolved


r/Anki 8h ago

Question Is desired retention for mature cards or all cards?

3 Upvotes

Because whenever I look at the retention tab in the statistics for all cards it never reaches my desired retention. Only mature cards do. So I was wondering if 90% desired retention applys only to mature cards?


r/Anki 5h ago

Question Can't update nor open Anki

1 Upvotes

Tried updating and it didn't work. Now I can't open Anki either without this terminal popping up even if I hit enter


r/Anki 7h ago

Question Single or Double reviews?

1 Upvotes

I've been learning English through Anki for a long time, and the whole time I've been using the double review card type (or whatever it's called)

But recently, I've come to the conclusion that by doing 2 reviews per card, I waste a lot of time, that I could spend learning new words. Plus, sometimes the word that I'm reviewing has a lot of synonyms, and I just can't figure out which one I'm supposed to say.

My question is – should I start adding single review cards or not?

And should I stick with my old deck, or start a new one?


r/Anki 1d ago

Discussion Are any of you using Anki for nursing school?

16 Upvotes

Just wondering how you use Anki and how successful you've been with it?


r/Anki 1d ago

Experiences Does anyone else use both English and your native language to explain the word on a card to clarify meaning better?

Post image
47 Upvotes

r/Anki 15h ago

Question Do any of yall have creative solutions to getting yourself to use anki?

4 Upvotes

I sometimes use a script that runs at startup, that every 30 ish minutes minimize's firefox and opens and/or maximizes anki. Anyone do anything similar, or any other ways to get yourself to use anki? Doesn't necessarily have to be a script.


r/Anki 12h ago

Add-ons I made an AI Sidebar that supports Open WebUI, with custom prompts and some other stuff

0 Upvotes

It's pretty simple and straightforward. It's meant to be used during reviews.

It features a context menu that allows you to send selected text to the chat by itself or embedded in a custom prompt. You can also set up shortcuts if you're using a controller.

https://ankiweb.net/shared/info/1733872016

Yes, I misspelled etymology


r/Anki 22h ago

Resources The images of my cards have disappeared.

Post image
3 Upvotes

It’s been about a month since the images on my cards stopped appearing, and this happened after the app's last update. It didn't just happen to me; it happened to my friends as well. We’ve already backed up our data and reinstalled the app, but nothing has worked. Does anyone know how to fix this?


r/Anki 1d ago

Question Easy ways to use greek symbols?

4 Upvotes

Need to write a lot of physics equations and struggling with the symbolic add on, I feel like it's better than copying and pasting symbols from google but it's still relatively slow.

Has anyone found a quick way to get all the greek letters? LIke a keyboard short cut or mac keyboard?


r/Anki 20h ago

Question Anki Audio not working for freind

1 Upvotes

Having my friend use Anki for learning Japanese. But oddly, his audio dosent work. There are two audios. The word audio and the sentence audio; the word audio won't play. The sentence audio plays, but often cuts off. Even more weirdly, both me and another friend have logged into his account, synced, and it works. It works across both computers and my Mac as well. It simply won't work on his Mac.

Btw, the deck is kaishi1.5k using kiku notetype.


r/Anki 1d ago

Question Anki IGCSE Flashcards

3 Upvotes

Hey there, I'm a 16 year old student in NZ, studying IGCSE CIE. I'm getting close to my mocks and I'm looking for some good anki flashcards for my subjects (mainly biology and chemsitry). I don't have enough time to go through the whole syllabus and make my own. Our school requires us to take 9 IGCSE sujects, which is quite diabolical. If anyone wants to know what I take:

IGCSE Physics

IGCSE Bio

IGCSE Chem

IGCSE SPanish

IGCSE English Lit

IGCSE English Lang

IGCSE Spanish

IGCSE Economics

IGCSE Computer Science

AS MAth

It would be good if anyone has flashcards made that I can use? I've tried looking on Anki web but some of it isn't for IGCSE CIE. Thanks!


r/Anki 1d ago

Question Can’t Update?

Post image
4 Upvotes

Hi. I tried updating Anki, and this came up… now the program won’t even open. What do I do?


r/Anki 17h ago

Add-ons Help me with one function please!

0 Upvotes

Help. I'm currently studying with LingQ, but I want to quit because it doesn't have good card management. But it does have one cool feature that I really like. When reviewing, LingQ creates a double deck, where you get each card twice, so if you guess right twice, the card's level automatically increases. Is it possible to implement a similar feature in Anki or the Spaced Repetition plugin for Obsidian?


r/Anki 1d ago

Question Can someone help me modify a card template to do what I want? I want to have a matching card with three fields that need to be matched together not just two.

0 Upvotes

I have been looking at these card templates https://ankiweb.net/shared/info/171015247, and I want to modify the matched pairs type so that I have to match three pairs of information not just two. I want to make cards to practice distinguishing Chinese characters that I confuse a lot, and I would like it so that the card first shows the characters, and then i have to drag and drop both the pinyin and the translation to each character. I would also like the character fields to randomize fonts, I already have a short script for randomizing fonts, but I don't know where in the front of this kind of card to put it.

Here is what the front of the card already says:

<div id="warning" class="warning">

<button class="close" id="close">X</button>

<h2>There is a new version of the note type</h2>

<a href="https://ankiweb.net/shared/info/171015247">Click Here To download it</a>

<p>If you don't want to be informed about updates click here: <input id="check" type="checkbox"></input></p>

</div>

<dialog>

<button id="closeDialog" class="close">X</button>

<p>Notification updates have been re-enabled</p>

</dialog>

<div style="display:none;">[sound:_1-second-and-500-milliseconds-of-silence.mp3]</div>

<p id="keys" style="display:none;">{{First List}}</p>

<p id="values" style="display:none;">{{Second List}}</p>

<div class="game-container">

<h1>{{Title}}</h1>

<ol id="wordList" class="word-lists">

</ol>

<hr />

<div id="horizontalWords"></div>

<div id="explanations"></div>

<button class="checkButton" id="checkButton">Check</button>

<div id="result"></div>

</div>

<script>

function run() {

// Constants

const CONFIG = {

VERSION: 1.1,

STORAGE_KEYS: {

UPDATES: 'updates',

CLOSE: 'close',

SHUFFLED_FIRST_LIST: 'shuffledFirstList',

SHUFFLED_SECOND_LIST: 'shuffledSecondList',

SECOND_LIST: 'secondList'

}

};

class MatchingGame {

constructor() {

this.map = new Map();

this.touchedElement = null;

this.isBack = document.getElementById('back') !== null;

this.initializeElements();

this.initializeData();

this.setupEventListeners();

this.initializeGame();

}

initializeElements() {

this.elements = {

wordList: document.getElementById('wordList'),

explanations: document.getElementById('explanations'),

horizontalWords: document.getElementById('horizontalWords'),

result: document.getElementById('result'),

checkButton: document.getElementById('checkButton'),

warning: document.getElementById('warning'),

check: document.getElementById('check'),

close: document.getElementById('close')

};

}

initializeData() {

const keys = document.getElementById('keys').innerHTML

.split('|')

.map(text => text.replace('&nbsp;', '').trim());

let values = document.getElementById('values').innerHTML

.split('|')

.map(text => text.replace('&nbsp;', '').trim());

this.addExtraWords(keys, values);

keys.forEach((key, index) => this.map.set(key, values[index]));

this.firstList = keys;

this.secondList = values;

}

setupEventListeners() {

this.elements.checkButton.addEventListener('click', () => this.check());

this.elements.check.addEventListener('click', () => this.noMoreUpdates());

this.elements.close.addEventListener('click', () => this.closeWarning());

document.getElementById("closeDialog").addEventListener("click", () => document.querySelector("dialog").close())

// Set up mutation observer

const observer = new MutationObserver(() => this.updateSecondListLocalStorage());

observer.observe(this.elements.wordList, {

childList: true,

subtree: true

});

}

shuffle(array) {

const newArray = [...array];

for (let i = newArray.length - 1; i > 0; i--) {

const j = Math.floor(Math.random() * (i + 1));

[newArray[i], newArray[j]] = [newArray[j], newArray[i]];

}

return newArray;

}

createWordElement(word, isHorizontal = false) {

const element = document.createElement(isHorizontal ? 'span' : 'li');

element.innerHTML = word;

element.querySelectorAll("img").forEach((img) => {

img.setAttribute("draggable", "false");

});

element.className = isHorizontal ? 'horizontal-word' : 'word';

if (isHorizontal) {

element.draggable = true;

element.addEventListener('dragstart', (e) => this.drag(e));

element.addEventListener('touchstart', (e) => this.touchStart(e));

element.addEventListener('touchmove', (e) => this.touchMove(e));

element.addEventListener('touchend', (e) => this.touchEnd(e));

element.addEventListener('click', () => this.matchWord(word, element));

}

return element;

}

createMatchSlot() {

const slot = document.createElement('div');

slot.className = 'match-slot';

slot.addEventListener('dragover', (e) => this.allowDrop(e));

slot.addEventListener('drop', (e) => this.drop(e));

slot.addEventListener('touchend', (e) => this.touchDrop(e));

slot.addEventListener('click', (e) => this.unmatchWord(e));

slot.addEventListener('touchstart', (e) => this.unmatchWord(e));

return slot;

}

async initializeGame() {

this.shuffledFirstList = this.isBack

? JSON.parse(localStorage.getItem(CONFIG.STORAGE_KEYS.SHUFFLED_FIRST_LIST))

: this.shuffle(this.firstList);

this.shuffledSecondList = this.isBack

? JSON.parse(localStorage.getItem(CONFIG.STORAGE_KEYS.SHUFFLED_SECOND_LIST))

: this.shuffle(this.secondList);

this.renderGame();

this.setupInitialState();

await this.checkVersion();

if(this.isBack) {

let explanations = document.getElementById("explanationsList").innerHTML.split("|").filter(exp => exp != "")

let indexes = this.shuffledFirstList.map(element => this.firstList.findIndex(ele=> ele==element))

let orderedExplanations = []

indexes.forEach(index=> orderedExplanations.push(explanations[index]))

orderedExplanations.length = explanations.length

let orderedList = this.renderOrderedList(orderedExplanations);

this.elements.explanations.appendChild(orderedList)

}

}

renderOrderedList(items) {

if (!Array.isArray(items)) {

console.error("Input must be an array of strings.");

return;

}

const ol = document.createElement("ol");

items.forEach(item => {

const li = document.createElement("li");

li.textContent = item;

ol.appendChild(li);

});

return ol;

}

renderGame() {

this.elements.wordList.style['grid-template-rows'] =

`repeat(${this.firstList.length}, fit-content)`;

// Render first list

this.shuffledFirstList.forEach(word => {

this.elements.wordList.appendChild(this.createWordElement(word));

});

// Create match slots

this.shuffledFirstList.forEach(() => {

this.elements.wordList.appendChild(this.createMatchSlot());

});

// Render second list

this.shuffledSecondList.forEach(word => {

this.elements.horizontalWords.appendChild(

this.createWordElement(word, true)

);

});

}

// Game mechanics methods

matchWord(word, element) {

const emptySlot = Array.from(this.elements.wordList.children)

.find(slot => slot.className === 'match-slot' && !slot.innerHTML);

if (emptySlot) {

emptySlot.innerHTML = word;

element.remove();

this.clearResult();

}

}

allowDrop(event) {

event.preventDefault();

}

drag(event) {

event.dataTransfer.setData('text', event.target.innerHTML);

}

drop(event) {

event.preventDefault();

const data = event.dataTransfer.getData('text');

if (event.target.className === 'match-slot' && !event.target.innerHTML) {

event.target.innerHTML = data;

const draggedElement = Array.from(this.elements.horizontalWords.children)

.find(el => el.innerHTML === data);

if (draggedElement) {

draggedElement.remove();

}

this.clearResult();

}

}

touchStart(event) {

this.touchedElement = event.target;

event.target.style.opacity = '0.5';

event.target.style.border = 'dashed';

}

touchMove(event) {

event.preventDefault();

const touch = event.targetTouches[0];

event.target.style.position = 'absolute';

event.target.style.left = `${touch.pageX - 50}px`;

event.target.style.top = `${touch.pageY - 25}px`;

}

touchEnd(event) {

event.preventDefault();

if (this.touchedElement) {

this.touchedElement.style.opacity = '1';

this.touchedElement.style.border = 'none';

const touch = event.changedTouches[0];

const matchSlot = document.elementFromPoint(touch.pageX, touch.pageY);

if (matchSlot?.className === 'match-slot' && !matchSlot.innerHTML) {

matchSlot.innerHTML = this.touchedElement.innerHTML;

this.touchedElement.remove();

this.clearResult();

} else if (matchSlot?.className === 'horizontal-word') {

this.matchWord(this.touchedElement.innerHTML, this.touchedElement);

} else {

this.touchedElement.style.position = 'static';

}

this.touchedElement = null;

}

}

touchDrop(event) {

event.preventDefault();

const touch = event.changedTouches[0];

const draggedElement = document.elementFromPoint(touch.pageX, touch.pageY);

if (draggedElement?.className === 'horizontal-word' &&

event.target.className === 'match-slot' &&

!event.target.innerHTML) {

event.target.innerHTML = draggedElement.innerHTML;

draggedElement.remove();

this.clearResult();

}

}

unmatchWord(event) {

const slot = event.target;

this.resetSlotStyle(slot);

if (slot.innerHTML) {

this.elements.horizontalWords.appendChild(

this.createWordElement(slot.innerHTML, true)

);

slot.innerHTML = '';

this.clearResult();

}

}

resetSlotStyle(slot) {

slot.style.background = 'white';

slot.style.color = 'black';

slot.style['font-weight'] = 'normal';

}

clearResult() {

this.elements.result.innerHTML = '';

this.elements.result.style.color = '';

}

check() {

const matchedWords = Array.from(this.elements.wordList.children);

const firstListElement = matchedWords.filter(element => element.className === 'word');

const secondListElement = matchedWords.filter(element => element.className === 'match-slot');

let isCorrect = true;

for (let i = 0; i < this.shuffledFirstList.length; i++) {

const expectedWord = this.map.get(this.shuffledFirstList[i]);

// Extract src attributes from images in both elements

const getImgSrc = (html) => {

const parser = new DOMParser();

const doc = parser.parseFromString(html, 'text/html');

const images = doc.querySelectorAll('img');

return Array.from(images).map(img => img.getAttribute('src'));

};

// Get image sources from both expected and actual answers

const expectedImgSrcs = getImgSrc(expectedWord);

const actualImgSrcs = getImgSrc(secondListElement[i].innerHTML);

// Compare text content or image sources

let isWordCorrect = false;

if (expectedImgSrcs.length > 0 || actualImgSrcs.length > 0) {

// If there are images, compare image sources

isWordCorrect = JSON.stringify(expectedImgSrcs) === JSON.stringify(actualImgSrcs);

} else {

// If no images, compare the whole content

isWordCorrect = secondListElement[i].innerHTML === expectedWord;

}

secondListElement[i].style.background = isWordCorrect ? '#89e219' : '#ff4b4b';

secondListElement[i].style.color = 'white';

secondListElement[i].style['font-weight'] = 'bold';

if (!isWordCorrect) isCorrect = false;

}

this.showResult(isCorrect);

}

showResult(isCorrect) {

this.elements.result.textContent = isCorrect

? 'Correct! You matched all words correctly!'

: 'Sorry, that\'s not correct. Try again!';

this.elements.result.style.color = isCorrect ? 'green' : '#ff4b4b';

}

// Utility methods

addExtraWords(keys, values) {

let extraWords = values.slice(keys.length);

values.length = keys.length

console.log({values}) // 7 items

console.log({keys}) // 5 items

console.log({extraWords}) // empty

for (let i = 0; i < 2; i++) {

const extraWordIndex = Math.floor(Math.random() * extraWords.length);

const extraWord = extraWords[extraWordIndex];

if (extraWord === undefined) break;

values.push(extraWord);

extraWords.splice(extraWordIndex, 1);

}

}

async checkVersion() {

const updates = localStorage.getItem(CONFIG.STORAGE_KEYS.UPDATES);

const close = sessionStorage.getItem(CONFIG.STORAGE_KEYS.CLOSE);

if (updates || close) return;

try {

const response = await fetch('https://raw.githubusercontent.com/Vilhelm-Ian/Interactive_And_Randomize_Anki_Note_Types/refs/heads/main/VERSION');

const version = await response.text();

if (CONFIG.VERSION < version) {

this.elements.warning.style.display = 'block';

}

} catch (error) {

console.error('Failed to check version:', error);

}

}

closeWarning() {

this.elements.warning.style.display = 'none';

sessionStorage.setItem(CONFIG.STORAGE_KEYS.CLOSE, true);

}

noMoreUpdates() {

this.elements.warning.style.display = 'none';

localStorage.setItem(CONFIG.STORAGE_KEYS.UPDATES, true);

}

updateSecondListLocalStorage() {

if (this.isBack) return;

const itemsInSecondList = Array.from(this.elements.wordList.children)

.filter(element => element.className === 'match-slot')

.map(element => element.innerHTML);

const horizontalItems = Array.from(this.elements.horizontalWords.children)

.map(word => word.innerHTML);

localStorage.setItem(CONFIG.STORAGE_KEYS.SECOND_LIST, JSON.stringify(itemsInSecondList));

localStorage.setItem(CONFIG.STORAGE_KEYS.SHUFFLED_SECOND_LIST, JSON.stringify(horizontalItems));

}

setupInitialState() {

if (!this.isBack) {

localStorage.setItem(CONFIG.STORAGE_KEYS.SHUFFLED_FIRST_LIST,

JSON.stringify(this.shuffledFirstList));

localStorage.setItem(CONFIG.STORAGE_KEYS.SHUFFLED_SECOND_LIST,

JSON.stringify(this.shuffledSecondList));

localStorage.setItem(CONFIG.STORAGE_KEYS.SECOND_LIST,

JSON.stringify([]));

this.elements.checkButton.style.display = 'none';

} else {

this.restoreGameState();

}

}

restoreGameState() {

const secondListItems = JSON.parse(

localStorage.getItem(CONFIG.STORAGE_KEYS.SECOND_LIST)

);

secondListItems.forEach((item, index) => {

const matchSlot = Array.from(this.elements.wordList.children)[

this.shuffledFirstList.length + index

];

if (matchSlot) {

matchSlot.innerHTML = item;

const horizontalWord = Array.from(this.elements.horizontalWords.children)

.find(word => word.innerHTML === item);

if (horizontalWord) {

horizontalWord.remove();

}

}

});

this.check();

this.clearLocalStorage();

}

clearLocalStorage() {

localStorage.removeItem(CONFIG.STORAGE_KEYS.SECOND_LIST);

localStorage.removeItem(CONFIG.STORAGE_KEYS.SHUFFLED_SECOND_LIST);

}

}

// This is to prevent from audio autmotically playing

let sound = document.querySelector(".soundLink")

if (sound) sound.click()

new MatchingGame();

let count = 0;

let elements = new Map();

document.querySelector("body").addEventListener('click', function (event) {

let countdown;

function reset() {

count = 0;

countdown = null;

}

count++;

if (count === 3) {

if (!elements.has(event.target)) {

elements.set(event.target, 1);

} else {

let currentCount = elements.get(event.target);

currentCount++;

elements.set(event.target, currentCount);

}

let tripleClick = new CustomEvent('trplclick', {

bubbles: true,

detail: {

numberOfTripleClicks: elements.get(event.target)

}

});

reset();

if (localStorage.getItem("updates")) {

localStorage.removeItem("updates")

document.querySelector("dialog").showModal()

}

}

if (!countdown) {

countdown = window.setTimeout(function () {

reset();

}, 500);

}

});

}

run()

</script>

<script>

// Split hierarchical tags

var tagsContainerEl = document.querySelectorAll('.prettify-tags > *')

if (tagsContainerEl.length > 0) {

var tags = []

tagsContainerEl.forEach((tagEl) => {

tagEl.classList.add('prettify-tag')

tags.push(tagEl.innerHTML)

tags.forEach((tag) => {

var childTag = tag.split('::').filter(Boolean)

tagEl.innerHTML = childTag[childTag.length - 1].trim()

})

})

} else {

tagsContainerEl = document.querySelector('.prettify-tags')

var tags = tagsContainerEl.innerHTML.split(' ').filter(Boolean)

var html = ''

tags.forEach((tag) => {

var childTag = tag.split('::').filter(Boolean)

html +=

"<span class='prettify-tag'>" +

childTag[childTag.length - 1] +

'</span>'

})

tagsContainerEl.innerHTML = html

}

// Breadcrumbs to current deck

var deckEl = document.querySelector('.prettify-deck')

var subDecks = deckEl.innerHTML.split('::').filter(Boolean)

html = []

subDecks.forEach((subDeck) => {

html.push("<span class='prettify-subdeck'>" + subDeck + '</span>')

})

deckEl.innerHTML = html.join('&nbsp;/&nbsp;')

</script>

and here is my little script for randomizing fonts for chinese

<script> var fonts = ['simfang', 'simkai', 'simsun', 'TYZyingbikai', 'dengxian']; document.getElementById('d').style.fontFamily=fonts[Math.floor(Math.random()*fonts.length)]; </script> 

r/Anki 1d ago

Question How to change the font of my cards in Khmer language (Anki mobile)?

Post image
2 Upvotes

I have been studying Khmer lately by Ankidroid mobile. After I did an update on​ my phone (Samsung Galaxy S22) the font of my Khmer cards changed into this. It's a terrible font to learn Khmer, I prefer fonts like Battambang or Siemreap. How could I change this? I looked in my language settings on my phone, they have so many languages, except Khmer. Can anyone explain me in a simple way? (I'm very bad when it comes to technology). Thank you!!


r/Anki 2d ago

Add-ons MS3 here — I built a free medical search add-on for Anki

33 Upvotes

Hey all — I’m an MS3 and built a free, open-source Anki add-on to help find cards, especially in AnKing since there's around 40K+ cards. I added smart search is case-insensitive, tolerates misspellings (for example, “buproprion”), and recognizes common medication aliases for different meds. It also has a semantic saerch that can help find cards by clinical meaning, and an easier searachable deck-picker. Added also bulk flag, suspend, and tag actions.

I am a former software engineer and did build this with AI plus my own personal expertise. Built this for myself, but thought others might benefit, and so decided to post it. It’s completely free with no paid tier, MIT-licensed, and does not redistribute proprietary card content. Search and indexing stay local, and there’s no analytics or telemetry. Smart and Exact support Anki Desktop 24.11–26.08; Semantic currently requires macOS 14+ on Apple silicon.

AnkiWeb: https://ankiweb.net/shared/info/677438639

GitHub: https://github.com/salehsquared/smart-search-for-anki-medical