Memrise card template [support thread]

for some reason neither disabling autoplay nor the method you provided @fabmir79 helped me.. As for the window through which I think this problem arises, it pops up before the back of the card appears, that is, at the very moment when you confirm the answer you have entered, and this window lets you know whether it was correct or not (photo 1). I would like to try to turn it off, because I don’t really care if the template is similar to the Memrise app. I just want the back of the card to be displayed immediately after entering the answer (photo 2).

If I understand correctly, what you are referring to, this should be possible by changing the following class on the back side code from “frontside” to “backside”:

image

This has nothing to do with audio playback, however. I’ll have to see a screen recording of your process or the note type to understand what this is about. (If you share the latter, please make sure to include “deck presets” during export.) For now, the only other suggestions I have are to try enabling “Skip question when replaying answer” option in the deck settings and check if you have any video files in your fields.

I realized that the doubling of answer sounds was caused by another add-on I use, AwesomeTTS, which pronounces the word I need to learn, because after turning it off, the answer sounds stopped doubling. But the problem is not 100% due to this add-on. Because with my other type of notes, these two add-ons (Advanced Answer Sounds / Awesome TTS) work correctly. But there is another nuance, namely, after turning off AwesomeTTS, the automatic pronunciation of the words I need to learn, which, as I understand it, is programmed by your code, began to double. But I kind of deleted it in the script because I don’t like this machine voice. You will immediately understand what I am talking about after watching my screen recording

How can I turn off this machine voice at all?

You should look for any mentions of {{tts-filtered fields in your code. I didn’t put anything related to TTS into the template, so it must be another consequence of you using the modified version. The doubling itself is likely to be caused by the field being inserted into the template twice in different places.

I found the original version, but the problem remains. I really need 2 add-ons (Advanced Answer Sounds / TTS), but the sound when analyzing the correct or incorrect answer is repeated, which is actually very annoying (video 1). Again, everything is fine in my note type (video 2)

So, I have even turned off the TTS add-on, and the sound is still duplicated when I answer correctly or incorrectly. I don’t understand anything anymore…

In the version you’ve sent previously, at least, there was one hidden at the very bottom of the backside code. You can use that as a reference.

If you imported it into an Anki profile that already had a Note Type with the same name, it is possible that the Note Types were merged and the changes from the modified version persisted since they have a more recent date of the last edit. For the purity of the experiment, you should try making a clean user profile (File → Switch Profile → Add → …), import the original template, and test it there.

I don’t actually hear any tts sounds in the first video. Only a single Answer Sound beep.

Turning AwesomeTTS off does not stop Anki from using TTS, it only reverts it to the default TTS voices available in your operating system.

The sound is repeated in Answer Sounds, in the first video you may not hear it very well because I compressed it to upload it here, but the sound really doubles. If you listen again to the sound that plays in the first video and the sound that plays in the second, you will hear that in the first video, after a millisecond, the sound plays again, as if I had entered 2 answers in a row. But really, because of the video compression, both the picture and the sound are very deteriorated. Perhaps I could send you the video by email or messenger?

Now that you pointed it out, I hear it as well, yes.
I’ve replicated this issue with Advanced Sounds, and the cause seems to be in the function that triggers the flip to the backside. The stock Anki {{type:Learnable}} typing flips the card when Enter is pressed, but because the template is supposed to handle all input by itself, it has a separate method that duplicates this functionality. Normally, this doesn’t cause any problems, because calling a flip two times instead of one produces the same outcome – the backside of the card is being displayed. With Advanced Sounds, however, it triggers the associated sound effect twice. To prevent it, you can redefine the flip function by adding the following to the “user posterior scripts” section on the front side of your template:

function flipToBack() {
	if (!isFrontSide) return;
	if (platform === 'desk') {
//		pycmd("ans");
	} else if (platform === 'android') {
		showAnswer();
	} else if (platform === 'ankiweb') {
		const ankiwebButtons = document.querySelectorAll('.btn.btn-primary.btn-lg');
		if (ankiwebButtons.length === 1) {
			ankiwebButtons[0].click();
		} else {
			console.log(ankiwebButtons.length < 1 ? "can't flip to back: ankiweb button not found" : "can't flip to back: can't single out the ankiweb button");
		}
	}
	console.log('flip');
}

As for the TTS issue, I wasn’t able to replicate it, so my recommendations remain the same: recheck your template carefully for the presence of multiple instances of TTS tags or test the original unmodified version of the template on a fresh Anki profile.

nothing has changed.. https://drive.google.com/file/d/19mvUs9uB1OPmnRPeDcOqCDbRatUfJPmM/view?usp=sharing

just for comparison, here is the sound on my type of notes without TTS for better sound https://drive.google.com/file/d/1E0bs55-84UoaGQaV_6KibQ4kn0I7r1OJ/view?usp=sharing

How many “posterior scripts” instances does your Note Type have on the front side?
The one you shared previously included all the scripts twice, for some reason. The fact that in the recording, your flipToBack() function is not at the very bottom of the page indicates that this is still the case. So, likely your redefinition of the flip function gets redefined back again by the second copy of the template scripts. I don’t know if that was put there intentionally, but you should probably delete everything below the closing </script> tag of the “posterior scripts” section. Having duplicate scripts can lead to all sorts of bugs, not just this one.

1 Like

I’m sorry, this is really what the problem is with the non-original version. I tried all the same steps on yours and it worked. I am infinitely grateful to you :face_holding_back_tears:

A few days earlier, I contacted you with the problem of a “pop-up” window before displaying the backside of the card. You advised me to change the class in the script to backside. But I still don’t like the way the field with my entered answer flashes when switching to the back of the card. Is there anything I can do to make the back of the card by default, but leave this field (just so it doesn’t blink)? https://drive.google.com/file/d/1JkxIIV-SbDnJ8t0H-wnSmk2Obyp8OAOl/view?usp=sharing

Also, please tell me where I can change the styling of the Learnable input field, because it takes up more space than I need

1 Like

As far as I can tell, there are two different flashes happening in succession.

First is a blink of an empty screen. It is caused by the Advanced Sounds add-on, which adds fade-in animations to every card. As far as I can tell, there is no way to disable these animations completely from the configs. Both setting “enable” to 0 and setting “time” to 0 give the same result of an animation with 0s duration being inserted into the reviewer. In practice, 0s last until a card finishes loading, and display an empty screen in the process.
If you don’t want these animations, they can be disabled by commenting out the respective lines in the source code:

gui_hooks.card_will_show.append(card_will_show)

and a bit lower two more:

gui_hooks.reviewer_did_show_question.append(lambda c:  card_will_fadein("fadein question"))
gui_hooks.reviewer_did_show_answer.append(lambda c:  card_will_fadein("fadein answer"))

All three in the __init__.py file (to comment the lines, put # character in front of each of them).

The second flicker is due to the delay in displaying the typed answer at the top of a card. It was introduced to avoid some issues with MathJax in AnkiDroid. If you don’t use either of them, you can safely revert that change by replacing this line on the back side of the template:

setTimeout(()=>document.getElementsByClassName("mem-alert")[0].innerText = userAns, 100); // "a<b" and "b>a" in plain text

with this:

document.getElementsByClassName("mem-alert")[0].innerText = userAns;

I had a problem with the second flicker and this helped, thank you for the hundredth time!!!

1 Like

Speaking of the android version. I was reading the requests from other users that I found above, and there you wrote about the update for Android, namely this one. I just wanted to test the template on my phone, but my card still looks like yours in the first photo and + for some reason the tooltip button doesn’t work https://drive.google.com/file/d/1zOxb5nCWr7O03SxT35fl9iZbwJA6rVxd/view?usp=sharing

Looks like you missed the instruction to turn on the Type answer into the card in the app’s settings.

I’m so inattentive :neutral_face: sorry for the questions you answered long ago.. and once again, thank you very much for such a great job and quick responses to even the most stupid questions :face_holding_back_tears:

1 Like

You are welcome :hugs:
Please feel free to come back with any other questions you might have in the future.

1 Like

If possible, I would like to ask a few more stupid questions :grinning_face:

You have helped me a lot to make using your wonderful, convenient, and simply incredible template as comfortable as possible, and the hint button is what I was missing, and I didn’t even realize it. But what I’m still missing is the ability to press the hint button with a key combination, or even better, with a single key. How can I do that? I tried to figure it out with the help of the GPT chat, but it completely breaks the code with its help :call_me_hand:

1 Like

Also regarding the visualization, I would like to reduce the size of all the fields on the back of the card, because all the information I need does not fit on the card and I have to constantly scroll up/down the side of the card. And I also need to remove the “Type the correct answer” on the front of the card and raise all the fields on this side a little higher