add fields to guiCurrentCard (#11)
This commit is contained in:
parent
0b9fae13fd
commit
0507add4c6
@ -466,10 +466,17 @@ class AnkiBridge:
|
|||||||
|
|
||||||
reviewer = self.reviewer()
|
reviewer = self.reviewer()
|
||||||
card = reviewer.card
|
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:
|
if card is not None:
|
||||||
return {
|
return {
|
||||||
'cardId': card.id,
|
'cardId': card.id,
|
||||||
|
'fields': fields,
|
||||||
'question': card._getQA()['q'],
|
'question': card._getQA()['q'],
|
||||||
'answer': card._getQA()['a'],
|
'answer': card._getQA()['a'],
|
||||||
'buttons': map(lambda b: b[0], self.window().reviewer._answerButtonList()),
|
'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",
|
"question": "front content",
|
||||||
"deckName": "Default",
|
"deckName": "Default",
|
||||||
"modelName": "Basic",
|
"modelName": "Basic",
|
||||||
|
"fields": {
|
||||||
|
"Front": "front content",
|
||||||
|
"Back": "back content"
|
||||||
|
},
|
||||||
"cardId": 1498938915662,
|
"cardId": 1498938915662,
|
||||||
"buttons": [1, 2, 3]
|
"buttons": [1, 2, 3]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user