Loading static/js/exercises.api.mjs +9 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ import { getTerminalContents, runCommand } from "./jslinux.api.mjs" import { arrayEquals } from "./util.mjs" import { getHandInToken } from "./snakeoil.mjs" /** * An exercise. It has a human-readable name and an `execute` function Loading Loading @@ -284,6 +285,14 @@ class Test { // TODO Properly implement this for each test separately currentState.firstStart = false } /** * Get the hand-in token to hand in this test */ getHandInToken(currentState) { // TODO Properly implement this for each test separately return getHandInToken(currentState) } } /** Loading static/js/yalikejazz.mjs +1 −2 Original line number Diff line number Diff line import { currentState } from "./state.mjs" import { pooltest, practice } from "./exercises.mjs" import { getHandInToken } from "./snakeoil.mjs" import { createExerciseCard, displayAsSolved, displayAsNonCurrent, displayAsCurrent } from "./exercises.cards.mjs" let currentTest = null Loading Loading @@ -73,7 +72,7 @@ function initActionLinks() { document.querySelectorAll("[data-action]").forEach(el => { const handler = { "hand-in": function () { alert("Bitte schreibe eine Mail an die GT mit dem folgenden Token als Inhalt: " + getHandInToken(currentState)) alert("Bitte schreibe eine Mail an die GT mit dem folgenden Token als Inhalt: " + currentTest.getHandInToken(currentState)) }, "begin": function () { document.body.classList.remove("overlay-shown") Loading Loading
static/js/exercises.api.mjs +9 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ import { getTerminalContents, runCommand } from "./jslinux.api.mjs" import { arrayEquals } from "./util.mjs" import { getHandInToken } from "./snakeoil.mjs" /** * An exercise. It has a human-readable name and an `execute` function Loading Loading @@ -284,6 +285,14 @@ class Test { // TODO Properly implement this for each test separately currentState.firstStart = false } /** * Get the hand-in token to hand in this test */ getHandInToken(currentState) { // TODO Properly implement this for each test separately return getHandInToken(currentState) } } /** Loading
static/js/yalikejazz.mjs +1 −2 Original line number Diff line number Diff line import { currentState } from "./state.mjs" import { pooltest, practice } from "./exercises.mjs" import { getHandInToken } from "./snakeoil.mjs" import { createExerciseCard, displayAsSolved, displayAsNonCurrent, displayAsCurrent } from "./exercises.cards.mjs" let currentTest = null Loading Loading @@ -73,7 +72,7 @@ function initActionLinks() { document.querySelectorAll("[data-action]").forEach(el => { const handler = { "hand-in": function () { alert("Bitte schreibe eine Mail an die GT mit dem folgenden Token als Inhalt: " + getHandInToken(currentState)) alert("Bitte schreibe eine Mail an die GT mit dem folgenden Token als Inhalt: " + currentTest.getHandInToken(currentState)) }, "begin": function () { document.body.classList.remove("overlay-shown") Loading