Merge pull request #32 from CharlesHenry/master
Add guiStartCardTimer function
This commit is contained in:
commit
c0a04c6815
@ -631,6 +631,18 @@ class AnkiBridge:
|
||||
}
|
||||
|
||||
|
||||
def guiStartCardTimer(self):
|
||||
if not self.guiReviewActive():
|
||||
return False
|
||||
|
||||
card = self.reviewer().card
|
||||
|
||||
if card is not None:
|
||||
card.startTimer()
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def guiShowQuestion(self):
|
||||
if self.guiReviewActive():
|
||||
self.reviewer()._showQuestion()
|
||||
@ -894,6 +906,11 @@ class AnkiConnect:
|
||||
return self.anki.guiCurrentCard()
|
||||
|
||||
|
||||
@webApi
|
||||
def guiStartCardTimer(self):
|
||||
return self.anki.guiStartCardTimer()
|
||||
|
||||
|
||||
@webApi
|
||||
def guiAnswerCard(self, ease):
|
||||
return self.anki.guiAnswerCard(ease)
|
||||
|
16
README.md
16
README.md
@ -672,6 +672,22 @@ Below is a list of currently supported actions. Requests with invalid actions or
|
||||
}
|
||||
```
|
||||
|
||||
* **guiStartCardTimer**
|
||||
|
||||
Starts or resets the 'timerStarted' value for the current card. This is useful for deferring the start time to when it is displayed via the API, allowing the recorded time taken to answer the card to be more accurate when calling guiAnswerCard.
|
||||
|
||||
*Sample request*:
|
||||
```
|
||||
{
|
||||
"action": "guiStartCardTimer"
|
||||
}
|
||||
```
|
||||
|
||||
*Sample response*:
|
||||
```
|
||||
true
|
||||
```
|
||||
|
||||
* **guiShowQuestion**
|
||||
|
||||
Shows question text for the current card; returns `true` if in review mode or `false` otherwise.
|
||||
|
Loading…
Reference in New Issue
Block a user