I installed a add One for ‘multiple type cloze’ (only for cloze text cards) and one for ‘multiple type fields’ (available for every card)
- Multiple type cloze (github available)
- Multiple type field (github available)
Problem:
If the Add On’s are activated individually the work perfectly . But they interfere with each other when both activated. The Add On ‘multiple type fields’ breaks the other one ‘multiple type cloze’, only the add on multiple type fields is working currently.
Approach:
I tried deactivating the add on ‘multiple type fields’ as soon as the card type is a ‘cloze type’.
Therefore I edited the file __init__.py
from:
from . import Multiple_type_fields_on_card_for_2_1.py
To:
from anki.hooks import addHook
from aqt.reviewer import Reviewer
from . import Multiple_type_fields_on_card_for_2_1
def is_clozetype_card(card):
return 'ClozeType' in card.note_type()['name']
def modify_reviewer_for_clozetype(reviewer):
Multiple_type_fields_on_card_for_2_1.modify_reviewer(reviewer)
def my_show_question(reviewer, card):
if is_clozetype_card(card):
modify_reviewer_for_clozetype(reviewer)
addHook("showQuestion", my_show_question)
I tried several code structures for a week (endless hours) now, but i am too dumb, i am not able to structure the code, in order to deactivate the add on ‘multiple type fields’ for cloze text cards (which was my previous attempt above) or find a solution to suurround this problem. Help