GithubHelp home page GithubHelp logo

truongqtoan / automatically-flip-cards Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 1.0 483 KB

Automatically flip cards add on for anki

Home Page: https://ankiweb.net/shared/info/631932779

Python 100.00%
python anki addon mutagen

automatically-flip-cards's Introduction

Automatically-flip-cards

Description

This add-on automatically flips cards based on the lengths of the audios in the cards. If a card has no audio, it will wait for 3 second before flipping that card. It is suitable for every one who don't want to press keyboard buttons to flip card and especially helpful for those that are learning languages using the Glossika method.

Usage

  • Press j to start the add on.
  • Press k to stop it.
  • Press Shift-D to add silence after front card.
  • Press Shift-F to add silence after back card.
  • Press Shift-J to add silence after both front and back cards.
  • Press { to decrease the speeds of back cards' audios.
  • Press } to increase the speeds of back cards' audios.
  • Press < to decrease the speeds of both front and back cards' audios.
  • Press > to increase the speeds of both front and back cards' audios.
  • Press Ctrl+y to change mode. There are two modes. In the default mode, the add on will get time of the first audio in the card. In the other mode, it will get the time of all the audios.

Installation

  1. Place "Automatically_flip_cards.py" file and "mutagen" folder in this repository in the anki add folder.
OR
  1. Use the installation code: 631932779

Liscence

This add on uses code of Mutagen library to get lengths of mp3 files. Mutagen is licensed under the GPL version 2 or later.

automatically-flip-cards's People

Contributors

toantruong95 avatar truongqtoan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dmgerman

automatically-flip-cards's Issues

Menu Items

I noticed the add on menus are all displayed under Tools instead of its own 'submenu' under tools. I suggest adding a submenu instead to save space.

Settings to tweak default flip time

"If a card has no audio, it will wait for 3 seconds before flipping that card."

It would be good if you could add a simple option so we can specify the time it should be 5 seconds / 10 seconds etc.

Visual feedback when starting/stopping the addon

When the user does J or Shift+J, K or Shift+K the add on works well as it should.

It would be an improvement if the user is visually notified that the add-on is enabled/disabled.

For example: 'Automatically flip cards: now enabled', 'Automatically flip cards: now disabled'

Change flip from Again to good?

I just noticed on the addon page that the default mode is again. I was wondering if there was a way to switch it to good? Thanks!

"import decimal fails" on startup

Hi, on first installation I get this error:

An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.
When loading 'Automatically flip cards':
Traceback (most recent call last):
File "aqt/addons.py", line 80, in loadAddons
File "/home/lig/.local/share/Anki2/addons21/631932779/init.py", line 9, in
from .mutagen.mp3 import MP3
File "/home/lig/.local/share/Anki2/addons21/631932779/mutagen/init.py", line 22, in
from ._util import MutagenError
File "/home/lig/.local/share/Anki2/addons21/631932779/mutagen/_util.py", line 19, in
import decimal
ModuleNotFoundError: No module named 'decimal'

This happens on Lubuntu 19.04, have not yet tried in on a Windows machine.

Thanks

Getting errors with the add-on

Here is one of the errors I get with the addon

Traceback (most recent call last): File "aqt/progress.pyc", line 69, in handler File "/Users/Jessica/Library/Application Support/Anki2/addons/Automatically_flip_cards.py", line 213, in change_card mw.reviewer._answerCard(mw.reviewer._defaultEase()) File "aqt/reviewer.pyc", line 271, in _answerCard File "aqt/reviewer.pyc", line 105, in nextCard File "aqt/reviewer.pyc", line 221, in _showQuestion File "anki/hooks.pyc", line 26, in runHook File "/Users/Jessica/Library/Application Support/Anki2/addons/Automatically_flip_cards.py", line 227, in show_question set_time_limit() File "/Users/Jessica/Library/Application Support/Anki2/addons/Automatically_flip_cards.py", line 191, in set_time_limit audio_fields_q, audio_fields_a = split_audio_fields(card, model, audio_fields) File "/Users/Jessica/Library/Application Support/Anki2/addons/Automatically_flip_cards.py", line 119, in split_audio_fields t = m['tmpls'][card.ord] IndexError: list index out of range

better configuration for time before flipping/answering

first of all, thank you for the add on. I have been looking for a way to create a video of my anki cards to study language passively (listen to the audio only, but having the option to have the text of the card shown in case I don't remember it). The idea is to create a video of the anki deck (audio and anki window) that I can simply play in a loop in a computer/tv. If I don't recognize a word, I can look at the display and see what it is.

I was able to reuse your code to do that. The issue is that the time to wait until a card is fully played depends on the time of back of the card. But the back of the card is usually the same audio as the front of the card.

One feature I think it would be great to add (in the init file, not user interface) is a flag of whether the time to play the question depends on the answer or not (and vice-versa).

I can do the programming if you are interested.

nonetheless, thank you very much for the addon.

Update description

It wasn't 100% clear what the addon does on the addon page. After testing this out, it appears to flip BOTH sides of the card whereas my expected behaviour is only flipping the Front side. You may want to add this in for clarity.

I assume that it selects 'Again' when providing the answer to the card, please clarify.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.