The code extracted from the <code> elements nested in the <code-cell> at start-up. This is used to set up the editor, prepend setup code to student code, and run tests.

Example

<ck-code-cell>
<code slot="setup">
# This code will be prepended to the student's code before it is run.
</code>
<code slot="prompt">
# This code will be shown to the student as a prompt.
</code>
<code data-type="solution">
# This code will be shown to the student as a solution.
</code>
<code data-type="test">
# This code will be run as a test.
</code>
</ck-code-cell>

Hierarchy

  • IExerciseSpec

Properties

prompt?: string

The code to show to the student as a prompt.

setup?: string

The code to prepend to the student's code before it is run.

solution?: string

The solution to test against.

test?: string

The code to run as a test.

Generated using TypeDoc