add fields to guiCurrentCard (#11)
This commit is contained in:
parent
0b9fae13fd
commit
0507add4c6
@ -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()),
|
||||
|
@ -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]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user