Loading static/js/exercises.api.mjs +16 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,22 @@ class Test { return this.exercises[nextUnsolvedExerciseIndex] } } /** * Return if the welcome message was already read in the current state */ wasWelcomeRead(currentState) { // TODO Properly implement this for each test separately return !currentState.firstStart } /** * Marks the welcome message as read, modifying the given current state */ markWelcomeAsRead(currentState) { // TODO Properly implement this for each test separately currentState.firstStart = false } } /** Loading static/js/yalikejazz.mjs +4 −2 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ function initActionLinks() { }, "begin": function () { document.body.classList.remove("overlay-shown") currentState.firstStart = false currentTest.markWelcomeAsRead(currentState) }, "continue": function () { document.body.classList.remove("overlay-shown") Loading Loading @@ -114,11 +114,13 @@ export function main() { if(currentTest.welcomeHtml) { document.querySelector("#welcome").innerHTML = currentTest.welcomeHtml const exerciseCnt = document.querySelector("#exerciseCnt") if (exerciseCnt) { exerciseCnt.textContent = currentTest.exercises.length } if (currentState.firstStart) { if (!currentTest.wasWelcomeRead(currentState)) { document.body.classList.add("overlay-shown") } } else { Loading Loading
static/js/exercises.api.mjs +16 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,22 @@ class Test { return this.exercises[nextUnsolvedExerciseIndex] } } /** * Return if the welcome message was already read in the current state */ wasWelcomeRead(currentState) { // TODO Properly implement this for each test separately return !currentState.firstStart } /** * Marks the welcome message as read, modifying the given current state */ markWelcomeAsRead(currentState) { // TODO Properly implement this for each test separately currentState.firstStart = false } } /** Loading
static/js/yalikejazz.mjs +4 −2 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ function initActionLinks() { }, "begin": function () { document.body.classList.remove("overlay-shown") currentState.firstStart = false currentTest.markWelcomeAsRead(currentState) }, "continue": function () { document.body.classList.remove("overlay-shown") Loading Loading @@ -114,11 +114,13 @@ export function main() { if(currentTest.welcomeHtml) { document.querySelector("#welcome").innerHTML = currentTest.welcomeHtml const exerciseCnt = document.querySelector("#exerciseCnt") if (exerciseCnt) { exerciseCnt.textContent = currentTest.exercises.length } if (currentState.firstStart) { if (!currentTest.wasWelcomeRead(currentState)) { document.body.classList.add("overlay-shown") } } else { Loading