Loading static/js/exercises.api.mjs +7 −4 Original line number Diff line number Diff line Loading @@ -243,10 +243,12 @@ class Test { /** * @param {string} name Human-readable name of the test * @param {Exercise[]} exercises The exercises this test consists of * @param {boolean} handInEnabled If handing in is enabled (usually yes, but maybe not for practice tests) */ constructor(name, exercises) { constructor(name, exercises, handInEnabled) { this.name = name this.exercises = exercises this.handInEnabled = handInEnabled } /** Loading Loading @@ -275,8 +277,9 @@ class Test { */ export function test(name, exerciseCreationFunction) { const exerciseCollector = { const testConfigCollector = { exercises: [], handInEnabled: true, /** * Add an exercise. Loading @@ -291,7 +294,7 @@ export function test(name, exerciseCreationFunction) { } } exerciseCreationFunction.bind(exerciseCollector)() exerciseCreationFunction.bind(testConfigCollector)() return new Test(name, exerciseCollector.exercises) return new Test(name, testConfigCollector.exercises, testConfigCollector.handInEnabled) } Loading
static/js/exercises.api.mjs +7 −4 Original line number Diff line number Diff line Loading @@ -243,10 +243,12 @@ class Test { /** * @param {string} name Human-readable name of the test * @param {Exercise[]} exercises The exercises this test consists of * @param {boolean} handInEnabled If handing in is enabled (usually yes, but maybe not for practice tests) */ constructor(name, exercises) { constructor(name, exercises, handInEnabled) { this.name = name this.exercises = exercises this.handInEnabled = handInEnabled } /** Loading Loading @@ -275,8 +277,9 @@ class Test { */ export function test(name, exerciseCreationFunction) { const exerciseCollector = { const testConfigCollector = { exercises: [], handInEnabled: true, /** * Add an exercise. Loading @@ -291,7 +294,7 @@ export function test(name, exerciseCreationFunction) { } } exerciseCreationFunction.bind(exerciseCollector)() exerciseCreationFunction.bind(testConfigCollector)() return new Test(name, exerciseCollector.exercises) return new Test(name, testConfigCollector.exercises, testConfigCollector.handInEnabled) }