aqt.reviewer
============

.. py:module:: aqt.reviewer


Attributes
----------

.. autoapisummary::

   aqt.reviewer.RUN_STATE_MUTATION


Classes
-------

.. autoapisummary::

   aqt.reviewer.RefreshNeeded
   aqt.reviewer.ReviewerBottomBar
   aqt.reviewer.V3CardInfo
   aqt.reviewer.AnswerAction
   aqt.reviewer.QuestionAction
   aqt.reviewer.Reviewer


Functions
---------

.. autoapisummary::

   aqt.reviewer.replay_audio


Module Contents
---------------

.. py:class:: RefreshNeeded(*args, **kwds)

   Bases: :py:obj:`enum.Enum`


   Create a collection of name/value pairs.

   Example enumeration:

   >>> class Color(Enum):
   ...     RED = 1
   ...     BLUE = 2
   ...     GREEN = 3

   Access them by:

   - attribute access:

     >>> Color.RED
     <Color.RED: 1>

   - value lookup:

     >>> Color(1)
     <Color.RED: 1>

   - name lookup:

     >>> Color['RED']
     <Color.RED: 1>

   Enumerations can be iterated over, and know how many members they have:

   >>> len(Color)
   3

   >>> list(Color)
   [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

   Methods can be added to enumerations, and members can have their own
   attributes -- see the documentation for details.


   .. py:attribute:: NOTE_TEXT


   .. py:attribute:: QUEUES


   .. py:attribute:: FLAG


.. py:class:: ReviewerBottomBar(reviewer: Reviewer)

   .. py:attribute:: reviewer


.. py:function:: replay_audio(card: anki.cards.Card, question_side: bool) -> None

.. py:class:: V3CardInfo

   Stores the top of the card queue for the v3 scheduler.

   This includes current and potential next states of the displayed card,
   which may be mutated by a user's custom scheduling.


   .. py:attribute:: queued_cards
      :type:  anki.scheduler.v3.QueuedCards


   .. py:attribute:: states
      :type:  anki.scheduler.v3.SchedulingStates


   .. py:attribute:: context
      :type:  anki.scheduler.v3.SchedulingContext


   .. py:method:: from_queue(queued_cards: anki.scheduler.v3.QueuedCards) -> V3CardInfo
      :staticmethod:



   .. py:method:: top_card() -> anki.scheduler.v3.QueuedCards.QueuedCard


   .. py:method:: counts() -> tuple[int, list[int]]

      Returns (idx, counts).



   .. py:method:: rating_from_ease(ease: int) -> anki.scheduler.v3.CardAnswer.Rating.V
      :staticmethod:



.. py:class:: AnswerAction(*args, **kwds)

   Bases: :py:obj:`enum.Enum`


   Create a collection of name/value pairs.

   Example enumeration:

   >>> class Color(Enum):
   ...     RED = 1
   ...     BLUE = 2
   ...     GREEN = 3

   Access them by:

   - attribute access:

     >>> Color.RED
     <Color.RED: 1>

   - value lookup:

     >>> Color(1)
     <Color.RED: 1>

   - name lookup:

     >>> Color['RED']
     <Color.RED: 1>

   Enumerations can be iterated over, and know how many members they have:

   >>> len(Color)
   3

   >>> list(Color)
   [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

   Methods can be added to enumerations, and members can have their own
   attributes -- see the documentation for details.


   .. py:attribute:: BURY_CARD
      :value: 0



   .. py:attribute:: ANSWER_AGAIN
      :value: 1



   .. py:attribute:: ANSWER_GOOD
      :value: 2



   .. py:attribute:: ANSWER_HARD
      :value: 3



   .. py:attribute:: SHOW_REMINDER
      :value: 4



.. py:class:: QuestionAction(*args, **kwds)

   Bases: :py:obj:`enum.Enum`


   Create a collection of name/value pairs.

   Example enumeration:

   >>> class Color(Enum):
   ...     RED = 1
   ...     BLUE = 2
   ...     GREEN = 3

   Access them by:

   - attribute access:

     >>> Color.RED
     <Color.RED: 1>

   - value lookup:

     >>> Color(1)
     <Color.RED: 1>

   - name lookup:

     >>> Color['RED']
     <Color.RED: 1>

   Enumerations can be iterated over, and know how many members they have:

   >>> len(Color)
   3

   >>> list(Color)
   [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

   Methods can be added to enumerations, and members can have their own
   attributes -- see the documentation for details.


   .. py:attribute:: SHOW_ANSWER
      :value: 0



   .. py:attribute:: SHOW_REMINDER
      :value: 1



.. py:class:: Reviewer(mw: aqt.AnkiQt)

   .. py:attribute:: mw


   .. py:attribute:: web


   .. py:attribute:: card
      :type:  anki.cards.Card | None
      :value: None



   .. py:attribute:: previous_card
      :type:  anki.cards.Card | None
      :value: None



   .. py:attribute:: typeCorrect
      :type:  str | None
      :value: None



   .. py:attribute:: state
      :type:  Literal['question', 'answer', 'transition'] | None
      :value: None



   .. py:attribute:: bottom


   .. py:attribute:: auto_advance_enabled
      :value: False



   .. py:method:: show() -> None


   .. py:method:: lastCard() -> anki.cards.Card | None


   .. py:method:: cleanup() -> None


   .. py:method:: refresh_if_needed() -> None


   .. py:method:: op_executed(changes: anki.collection.OpChanges, handler: object | None, focused: bool) -> bool


   .. py:method:: nextCard() -> None


   .. py:method:: get_scheduling_states() -> anki.scheduler.v3.SchedulingStates


   .. py:method:: get_scheduling_context() -> anki.scheduler.v3.SchedulingContext


   .. py:method:: set_scheduling_states(request: anki.scheduler.v3.SetSchedulingStatesRequest) -> None


   .. py:method:: replayAudio() -> None


   .. py:method:: revHtml() -> str


   .. py:method:: autoplay(card: anki.cards.Card) -> bool


   .. py:method:: korean_shortcuts() -> collections.abc.Sequence[tuple[str, collections.abc.Callable] | tuple[Qt.Key, collections.abc.Callable]]


   .. py:method:: on_pause_audio() -> None


   .. py:attribute:: seek_secs
      :value: 5



   .. py:method:: on_seek_backward() -> None


   .. py:method:: on_seek_forward() -> None


   .. py:method:: onEnterKey() -> None


   .. py:attribute:: typeAnsPat
      :value: '\\[\\[type:(.+?)\\]\\]'



   .. py:method:: typeAnsFilter(buf: str) -> str


   .. py:method:: typeAnsQuestionFilter(buf: str) -> str


   .. py:method:: typeAnsAnswerFilter(buf: str) -> str


   .. py:method:: onLeech(suspended: bool = False) -> None


   .. py:method:: check_timebox() -> bool

      True if answering should be aborted.



   .. py:method:: showContextMenu() -> None


   .. py:method:: onOptions() -> None


   .. py:method:: on_previous_card_info() -> None


   .. py:method:: on_card_info() -> None


   .. py:method:: set_flag_on_current_card(desired_flag: int) -> None


   .. py:method:: set_flag_func(desired_flag: int) -> collections.abc.Callable


   .. py:method:: toggle_mark_on_current_note() -> None


   .. py:method:: on_set_due() -> None


   .. py:method:: suspend_current_note() -> None


   .. py:method:: suspend_current_card() -> None


   .. py:method:: bury_current_note() -> None


   .. py:method:: bury_current_card() -> None


   .. py:method:: forget_current_card() -> None


   .. py:method:: on_create_copy() -> None


   .. py:method:: delete_current_note() -> None


   .. py:method:: onRecordVoice() -> None


   .. py:method:: onReplayRecorded() -> None


   .. py:method:: toggle_auto_advance() -> None


   .. py:method:: auto_advance_if_enabled() -> None


   .. py:attribute:: onBuryCard


   .. py:attribute:: onBuryNote


   .. py:attribute:: onSuspend


   .. py:attribute:: onSuspendCard


   .. py:attribute:: onDelete


   .. py:attribute:: onMark


   .. py:attribute:: setFlag


.. py:data:: RUN_STATE_MUTATION
   :value: Multiline-String

   .. raw:: html

      <details><summary>Show Value</summary>

   .. code-block:: python

      """
      anki.mutateNextCardStates('{key}', async (states, customData, ctx) => {{
          {js}
          }}).finally(() => bridgeCommand('statesMutated'));
      """

   .. raw:: html

      </details>



