add fields to guiCurrentCard (#11)

This commit is contained in:
Alex Yatskov 2017-07-02 17:52:57 -07:00
parent 0b9fae13fd
commit 0507add4c6
2 changed files with 11 additions and 0 deletions

View File

@ -466,10 +466,17 @@ class AnkiBridge:
reviewer = self.reviewer()
card = reviewer.card
model = card.model()
note = card.note()
fields = {}
for info in model['flds']:
fields[info['name']] = note.fields[info['ord']]
if card is not None:
return {
'cardId': card.id,
'fields': fields,
'question': card._getQA()['q'],
'answer': card._getQA()['a'],
'buttons': map(lambda b: b[0], self.window().reviewer._answerButtonList()),

View File

@ -334,6 +334,10 @@ Below is a list of currently supported actions. Requests with invalid actions or
"question": "front content",
"deckName": "Default",
"modelName": "Basic",
"fields": {
"Front": "front content",
"Back": "back content"
},
"cardId": 1498938915662,
"buttons": [1, 2, 3]
}