Bỏ qua đến nội dung

Field Modifier: Random Item (Fork for 2.1)

Chờ xử lý #anki #addon #field #modifier #random #item #fork
https://forums.ankiweb.net/t/enhanced-cloze-unmaintained-fork-for-2-1/850
11/4/2019

Cách tải addon Field Modifier: Random Item (Fork for 2.1)

Bạn có thể tải addon bằng một trong hai cách sau:

Click nút Copy bên dưới để copy code vào clipboard

1940275457

Sau đó mở Anki → Tools → Add-ons → Get Add-ons → Dán code → OK

Mở trang addon trên AnkiWeb và tìm mã code ở cuối trang

Mở trên AnkiWeb

Cuộn xuống cuối trang AnkiWeb, tìm dòng có mã code 1940275457 và copy

7

Mô tả chi tiết

temporary upload of Field Modifier: Random Item for 2.1 until the original add-on is updated. I just renamed the file. I don’t maintain this add-on. Future Anki updates will most likely break this add-on and then I can’t and won’t help.

you should not use this add-on.

Add-ons don’t work in Ankimobile (ios) or Ankidroid(Android). If you plan to review with these apps you might want to look for a different solution (that uses javascript - maybe “Closet For Anki” or this(I didn’t test it))?.

original description: Picks a random item from the field. Useful for images. Usage: {{random:Field Name}} Items are separated by commas.

all credit goes to the original unknown author


Liên kết hỗ trợ


Reviews (7)

👍 2023-05-10

For anyone who wants to achieve the same without an add-on. Add this code to your card template:

<span id=“question”>{{Question}}</span>

<script>

function split_and_pick(id) {

const element = document.getElementById(id);

if (element.innerHTML.includes(’|’)) {

const options = element.innerHTML.split(’|’);

element.innerHTML = options[Math.floor(Math.random() * options.length)];

}

}

split_and_pick(‘question’);

</script>

For example, if your field {{Question}} has t

👍 2022-10-29

I dont know how to use it 😕 can somebody explain it?

👍 2022-02-14

Thanks! ^_^

So cool it’s basically a one-liner. If you want to change it so you don’t have only one item but all items in a random order, put the following instead

’,‘.join(random.sample(txt.split(’,’), len(txt.split(’,’))))

If you want to change the splitting string change it in the two text.split()s and if you want to change the joining string change it before .join.

👍 2021-02-26

This addon is what I’ve spent years looking for, but is it possible to change the Item Separator from a comma to a less used key (maybe a pipe | or really anything else)

Edit: Figured out how to change it myself. For anyone else wondering, you’ll have to download python from online.

Next, open Anki and go to tools->addons-> select this add on and hit view files.

Now, on your pc, start python. Hit file->open and copy and paste the file destination that Anki pulled up from the previous ste

👍 2019-11-15

Great addon

👍 2019-11-15

very usefull

👍 2019-05-27

Awesome