Commit ad05af4e authored by Jakob Moser's avatar Jakob Moser
Browse files

Make getHandInToken a method of Test

parent 80f4a1aa
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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
@@ -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)
    }
}

/**
+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
@@ -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")