Element which stores the solution typed by the user

Here is some code to test if sessionStorage works on iPhone app:
front template:

<div id="pid-display">{{Front}}</div>

isFront = !document.getElementById("front-container");
if (isFront) {
	pid = Array.from({length:5}, () => String.fromCharCode(Math.floor(Math.random() * 94) + 33)).join('');
	sessionStorage.setItem("page-id", pid);
} else {
	pid = sessionStorage.getItem("page-id");
document.getElementById("pid-display").innerText = pid;

back template:

<div id="front-container">

it is supposed to replace the respective code in the Basic Anki Note Type. You can make several cards with this and try flipping through them in a review. If everything works correctly, the back of each card will show the same string of random characters as its front. Otherwise, the back sides will probably appear empty.

On a side note, I see that the contents of the info screen on your recording appear to be centred. Did you modify card’s CSS, or did the template styles got overwritten by the iPhone app itself?

The audio button also appears different. As I understand you have some means of inspecting card’s HTML as it is displayed inside the app? Could you copy here the relevant piece of code with the audio button (or even the full HTML for the back of a card)?

1 Like