Additional Card Fields [Official thread]

background: in anki cards can be in three stages, see Studying - Anki Manual

I didnā€™t mean the card templates but info related to the card itself.

In the browser right click a row (card) in the table and from the context menu select ā€œInfo ā€¦ā€. This window shows some card properties in a human friendly formatted way.

I just uploaded an old add-on I once made for myself that shows the card properties in an unformatted way at copy card info (technical) - AnkiWeb.

with those you can check if your cards are new and which ease setting they have.

What ease values do you get for cards where the additional card fields add-on doesnā€™t work as expected?

The ease for the card is 250% and the
Number of reviews = 8

To get the html output I used {{info-Ease:}} and {{info-Reviews:}}

The forum limits size of email and number on same topic for first time users so blocked resend of images.

I donā€™t understand your problem anymore. you just said that the ease you see is 250 - but isnā€™t this what you expeced?

if the ease value is correct the factor value should also be correct (note to myself: relevant source code is at https://github.com/ijgnd/anki21__reviewer_additional_card_fields/blob/349dfbf6f2fe8ec00adff17cf7a3307db1052305/src/new_additional_card_fields.py#L222)

If you still think that you have a problem with a card I need the all the scheduling info about a card. Use my additional add-on that I mentioned yesterday for this. wehn you have this card for review use the context menu and select the entry ā€œcopy card info (technical)ā€. Then copy the text from the dialog that opens. Also post a screenshot of the card review where the ease value is wrong.

My browser shows all scheduling information and the values for Ease 250% and Reviews = 8 were read from the browser. As you say that is what I expect to see from my html that produced the out where you see from the image both came out a zero.
These zero values were output when I used {{info-Ease:}} etc in the html, they werenā€™t used to get the values above.

I should add that I had already used the add on on a slightly earlier version of Anki and got zeros then so updated to 2.1.49 to see if that was the problem.

I probably confused you with the brevity of my last message so hopefully my problem is now clear, however if not let me know and Iā€™ll do as you require. It is interesting to note that when I type the {{parameter}} commands into the html Anki informs you if the parameter is recognised or not, if itā€™s typed incorrectly it isnā€™t recognised but yours are recognised so the system knows they are there it is just that the returned values are zero.

Let me know if you still need me to get the other scheduling data. It seems in the forum that I may not be able to send a second message until you get back as Iā€™m a first time user. Cheers

are you sure that in the browser you looked at the same card you reviewed? one NOTE in anki can have multiple CARDS.

As I said I need the info from copy card info (technical) - AnkiWeb as well a new screenshot.

Problem solved whilst doing what you suggested! I didnā€™t realise that the parameters were only populated with the correct scheduling values at review time. I thought they would pick the current values up immediately I modified the html for the card even though it wasnā€™t yet due for review.

The fact that your Card Info (Technical) is run at review time meant that I then found the parameters were indeed correctly populated and appeared correctly at review time.

Thanks so much for your it is much appreciated!! Cheers

Dear ijgnd,

This may seems a dumb question to you but Iā€™d like to know if thereā€™d be any way to apply your API to Anki on iPadOs. The main purpose would be to show the card ease on the back of a card. If not possible, would you have any advice to do so ?

Regards,

AnkiMobile supports the v3 scheduler, so you can access card states with custom scheduling (last setting in Anki Desktop deck options):

let indicator = document.getElementById("easeIndicator");
if (!indicator) {
    indicator = document.createElement("div");
    indicator.setAttribute("id", "easeIndicator");
    document.body.prepend(indicator);
}
indicator.innerText = `ease: ${
    states.current.normal?.review?.easeFactor ||
    states.current.filtered?.rescheduling.originalState.review?.easeFactor ||
    "not available"}`;

You can style the indicator with #easeIndicator. If you want it to show at the bottom, swap ā€œprependā€ for ā€œappendā€. You could also write the indicator into your template and delete the DOM-manipulation part of the script.

Backside only

The custom scheduling script only executes on the front side, so youā€™ll need to store it for backside display.

For AnkiMobile and Anki Desktop, you can simply store the ease in globalThis:

globalThis.ease =
    states.current.normal?.review?.easeFactor ||
    states.current.filtered?.rescheduling.originalState.review?.easeFactor ||
    "not available";

and add the following to your back template:

<div id="easeIndicator"></div>

<script>
   document.getElementById("easeIndicator").innerText = `ease: ${globalThis.ease}`;
</script>
1 Like

Is it possible to display some values conditionally, so that they donā€™t take space in review mode? What I mean by this is that for example field content can be displayed conditionally:
{{#Field_name}}{{Field_name}}{{/Field_name}}

Could it be possible to have:

{{#info-Learning?:}}
{{info-Learning?:}}
{{/info-Learning?:}}

Second issue:
Would it be possible add separate display value for relearning, so that it can be displayed as word, not as numerical value like in this:

{{info-Type:}} - 0=suspended, 1=learning, 2=normal, 3=relearning

1 Like

I am not able to get anything to show up on 2.1.55qt6.

I couldnā€™t reproduce this in linux with 21.55qt6 beta 6.

could you try again

  • make sure you have beta6 installed
  • disable all other add-ons, restart anki
  • create a new basic note type.
  • put {{info-allfields:}} into the back card template of this newly created note type. allfields is not documented in the ankiweb listing but itā€™s useful for debugging purposes. You should get a nicely formatted table.
  • Do you see some info? Note that many fields often return/show nothing, e.g. LastReview returns an empty string for a new card. If yes, try other templates and/or identify which strings/fields in particular are broken.

correction: use beta7

I want the id to be part of the card, which can be seen when the anki field is exported, not just in the preview state, on the contrary, the ccid can also be seen in the editing state, not blank

Can you help me?


image

Hope there is content here

@1801211637 : My add-on canā€™t work here. As the name sais this add-on is about modifying CARDS. But in the editor you are working on a NOTE. This distinction between notes and cards is fundamental to anki, see e.g. Getting Started - Anki Manual or The fundamental principle of Anki card creation | Troyka

you seem to want an add-on that adds the NOTE ID to a field in the editor - maybe have a look at add-ons like Ze Add Note Id.

thanks

Hi, I appreciate all the work put in this add-on. I just canā€™t get it to work, nothing shows up where I insert the info fieldsā€¦
I tried disabling all other add-ons, re-installing this oneā€¦ Version āØ2.1.54

Any idea?
Thanks

when nothing is to show this add-on often just returns nothing. e.g. if you have a new card itā€™s supposed to look like this. I like this because then you can use js to conditionally hide a whole portion of text if something is totally empty.