Option to Have Auto Advance on by Default

Hi all,

Thanks for all your work on the app. Ever since Auto Advance was built into the desktop app I’ve been using it every day and find it an invaluable addition to Anki.

It would be nice, however, if there was some kind of toggle to have Auto Advance on by default. It’s not a huge deal, but it’s a little tedious having to turn Auto Advance every time you open a deck, or come back to Anki after using a different application. Alternatively, having Anki remember your last selection might be a good option.

I did find a similar post by @RiceInRicin from a few months ago (“(AnkiMobile) Option to have Auto Advance Enabled by default”), however, their post was about AnkiMobile rather than the desktop app, so I thought I would add my voice in support of adding this feature to the desktop app.

Thanks again!

5 Likes

[Adding link for reference: (AnkiMobile) Option to have Auto Advance Enabled by default]

5 Likes

Would also like to see this. It’s the only thing stopping me from replacing the Speed Focus addon with the official auto advance feature. Needing to enable auto advance every time is quite an annoyance.

2 Likes

I was thinking the same, if it is not planned to be officially incorporated I think I will develop an add-on. For now I have only developed a function to auto stop Auto Advance. (because I want to auto-stop when review is interrupted by my add-on)

1 Like

This can be done using a card template.

A script that runs the function after a specified time has elapsed.

Summary
<script>
	function createTimer(delay) {
		setTimeout(function() {
		nameFunction();
		}, delay);
	}

	createTimer(20000);

</script>

A script showing the answer.

Summary
<script>
  try {
    // AnkiDroid
    showAnswer();
  } catch {
    // Desktop
    pycmd("ans");
  }
</script>

A function for responding to a card.

Summary
<script>

  function rateAnswer(rating) {

    pycmd('ease ' + rating);
  }
</script>

An alternative taken from here
https://ankiweb.net/shared/info/510199145

Summary
<script>
 //determine platform
 platform = '';
 if (!document.documentElement.classList.contains("mobile")) {
	 platform = 'desk';
 } else if (document.documentElement.classList.contains("android")) {
	 //var jsApiContract = { version: "0.0.3", developer: "eltaurus@inbox.lt" };
	 //var api = new AnkiDroidJS(jsApiContract);
	 platform = 'android';
}
</script>

<script>




function answerAgain() {

		if (platform === 'desk') {
			pycmd('ease1');
		} else if (platform === 'android') {
			buttonAnswerEase1();
		}
}
function answerHard() {

		if (platform === 'desk') {
			pycmd('ease2');
		} else if (platform === 'android') {
			buttonAnswerEase2();
		}
}

function answerGood() {

		if (platform === 'desk') {
			pycmd('ease3');
		} else if (platform === 'android') {
			buttonAnswerEase3();
		}
}

function answerEasy() {

		if (platform === 'desk') {
			pycmd('ease4');
		} else if (platform === 'android') {
			buttonAnswerEase4();
		}
}
1 Like

I have not tested this solution.

To summarize all of the above

Front

<script>
	function createTimer(delay) {
		setTimeout(function() {
		try {
			// AnkiDroid
			showAnswer();
		} catch {
			// Desktop
			pycmd("ans");
		}

		}, delay);
	}

	createTimer(20000); // 20 seconds

</script>

Back

<script>
	function createTimer(delay) {
		setTimeout(function() {
		try {
			// AnkiDroid
			buttonAnswerEase1();
		} catch {
			// Desktop
			pycmd('ease1');
		}

		}, delay);
	}

	createTimer(20000); // 20 seconds

</script>

Substitute your value instead of 20000 (20 seconds).

Again:
buttonAnswerEase1();
pycmd(‘ease1’);

Hard:
buttonAnswerEase2();
pycmd(‘ease2’);

Good:
buttonAnswerEase3();
pycmd(‘ease3’);
Easy:
buttonAnswerEase4();
pycmd(‘ease4’);

1 Like

If your cards have auto-playing audio, then the javascript auto-advance will cut off currently playing audio when the timer finishes.

You’d need to turn off audio auto-play in the deck options and instead implement audio auto-play in javascript so that the auto-advance javascript would have access to the audio playing state and be able to wait for audio playing to end before advancing.

The code in this post could be a helpful starting point: Is it possible to load audio dynamically with JavaScript? - #10 by srghma

3 Likes

I didn’t plan on going that far.
Will not be friends with {{FrontSide}}.

<script>
;(async function() {
	// AnkiMobile && AnkiDroid / Anki 2.1
	const elements = Array.from(document.querySelectorAll(".soundLink, .replacebutton"))
	const wait = t => new Promise(s => setTimeout(s, t))
	let index = 0
	for (let index = 0; index < elements.length; index++) {
	
		const element = elements[index]
		element.click()
		await wait(2500)
	} 
	
		await wait(10000)
		try {
			// AnkiDroid
			showAnswer()
		} catch {
			// Desktop
			pycmd("ans")
		}
})();
</script>

I’d love that as well! It worked like that on Android before the last update, and the update-downgrade made me sad :frowning:

The workarounds aren’t viable - what if you have multiple decks? What if I want to disable just for this session and I’m on mobile? These cases are covered already in the “Auto Advance” functionality, no need to reinvent the wheel. All we need is the ability to change the default.

2 Likes

This would make Anki so much better. I find myself needing to edit a card multiple times per review session, and having to re-enable auto-advance every time, while not the end of the world, feels like an unnecessary inconvenience.

Wish the native auto advance would have the sound alert

For the time being, there’s Speed Focus Mode (auto-alert, auto-reveal, auto-answer), which plays by default

Note: In order to get to the add-on’s settings, you’ll need to draw up the classic deck options screen. Sadly this is a bit hidden, but here is how to get to the screen:

  1. From Anki’s main window (where your list of decks is shown), click on the gear icon of the deck you want to enable Speed Focus Mode for. This should draw up a small floating context menu with a few entries.
  2. Click on the “Options” entry while holding down the Shift key on your keyboard. This will make Anki draw up the classic deck options view, where you’ll find Speed Focus Mode’s options under the “General” tab