Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Additional card Fields #4676

Closed
popo63301 opened this issue Jul 28, 2017 · 8 comments · Fixed by #6393
Closed

Feature Request: Additional card Fields #4676

popo63301 opened this issue Jul 28, 2017 · 8 comments · Fixed by #6393

Comments

@popo63301
Copy link

Would it be possible to add this plugin to the app?: https://ankiweb.net/shared/info/441235634

Especially "{{info::Reviews}} - the amount of reviews that you had on a card".

Thanks in advance ! :D

@adlew44
Copy link

adlew44 commented Dec 23, 2018

I would also find this very useful, and have given it a thumbs up. I feel sure that sometimes cards appear weeks or months before they are due; I have no objection to that, but I'd like to know when it happens, so the ability to add relevant special fields to cards would be welcome.

@mikehardy
Copy link
Member

mikehardy commented Dec 23, 2018

This is the sort of thing that could likely fit into the "hooks" architecture:

https://github.com/ankidroid/Anki-Android/tree/master/AnkiDroid/src/main/java/com/ichi2/libanki/hooks

You'd want to create a CardInfo (or similar) Hook subclass registering for the "mungeQA" hook (I believe), that scanned for {{info:: and replaced it with info it looked up. The hook would be passed all it needs in order to lookup info the "args" Object array, this function is where it is called so you can see the args content:
https://github.com/mikehardy/Anki-Android/blob/1187dddac916f75d952bdb683931df489fcef985/AnkiDroid/src/main/java/com/ichi2/libanki/Collection.java#L1055

An example is here:
https://github.com/ankidroid/Anki-Android/blob/master/AnkiDroid/src/main/java/com/ichi2/libanki/hooks/HebrewFixFilter.java

This is a plugin on desktop, so would not normally make it in to the codebase for AnkiDroid, but we do have a hook infrastructure already and there's no other way to do plugins during review. So if someone proposed a clean PR for this, it could work.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2020

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@david-allison
Copy link
Member

Let's keep this open for a little bit.

@infinyte7 - pinging for informational purposes, as this is very close to the area you're working in

@krmanik
Copy link
Member

krmanik commented Jun 3, 2020

Next weekend I will look into this.

@david-allison
Copy link
Member

No rush or action intended if you don't want to, but thanks!!

@krmanik
Copy link
Member

krmanik commented Jun 4, 2020

I looked into it. But is there any information stored for particular cards info (eg. reviews). The information stored that when it will appear next for reviewing. But for count number of reviews for particular cards, where to look/add code?

Is this?
https://github.com/ankidroid/Anki-Android/wiki/Database-Structure#database-schema

reps            integer not null,
      -- number of reviews

@david-allison
Copy link
Member

david-allison commented Jun 4, 2020

Yeah, reps is already available on the card object. no need for database work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants