示例#1
0
 def cardAnswered(self, deck, card, ease):
     c = {}
     for key in ('id','question','answer'):
         c[key] = getattr(card, key)
     c['ease'] = ease
     c['time'] = datetime_as_str(dt.utcnow())
     self.cards_answered.append(c)
示例#2
0
 def studied(self, deck, cards):
     try:
         reply = self.post('/api/studylog', 
                           {"deck":     deck.name(),
                            "syncName": deck.syncName, 
                            "cards":    cards, 
                            "time":     datetime_as_str(dt.utcnow())
                            })
     #TODO : improve error handling/messages
     except ClientError, e:
         QMessageBox.warning(mw, "Annikki has a problem", "Submitting to Annikki failed.\n\n%s" % e.msg)