Skip to content
course-kit
Menu

<practice-tree>

A tree question: a snippet and its DOM tree with blanks to fill in.

Practice worksheets

Examples

Tree question

Color scheme
Width

Open on its own

Source
<practice-tree :@q="({&quot;id&quot;:&quot;2.3&quot;,&quot;kind&quot;:&quot;tree&quot;,&quot;prompt&quot;:&quot;Fill in the tree for this markup.&quot;,&quot;why&quot;:&quot;A tree shows each element inside its parent.&quot;,&quot;lang&quot;:&quot;html&quot;,&quot;code&quot;:&quot;<ul><li>One</li></ul>&quot;,&quot;nodes&quot;:[{&quot;depth&quot;:&quot;0&quot;,&quot;label&quot;:&quot;ul&quot;},{&quot;blank&quot;:&quot;0&quot;,&quot;depth&quot;:&quot;1&quot;,&quot;name&quot;:&quot;2.3-blank-0&quot;,&quot;blankLabel&quot;:&quot;Blank 1 — the list item&quot;,&quot;display&quot;:&quot;li&quot;}],&quot;blanks&quot;:[{&quot;label&quot;:&quot;Blank 1 — the list item&quot;,&quot;accept&quot;:[&quot;li&quot;],&quot;display&quot;:&quot;li&quot;}],&quot;answers&quot;:{&quot;blanks&quot;:[[&quot;li&quot;]]},&quot;sources&quot;:[],&quot;codeHtml&quot;:&quot;<span class=\&quot;token tag\&quot;><span class=\&quot;token tag\&quot;><span class=\&quot;token punctuation\&quot;>&amp;lt;</span>ul</span><span class=\&quot;token punctuation\&quot;>></span></span><span class=\&quot;token tag\&quot;><span class=\&quot;token tag\&quot;><span class=\&quot;token punctuation\&quot;>&amp;lt;</span>li</span><span class=\&quot;token punctuation\&quot;>></span></span>One<span class=\&quot;token tag\&quot;><span class=\&quot;token tag\&quot;><span class=\&quot;token punctuation\&quot;>&amp;lt;/</span>li</span><span class=\&quot;token punctuation\&quot;>></span></span><span class=\&quot;token tag\&quot;><span class=\&quot;token tag\&quot;><span class=\&quot;token punctuation\&quot;>&amp;lt;/</span>ul</span><span class=\&quot;token punctuation\&quot;>></span></span>&quot;})"></practice-tree>

Props

Write them with the @ prefix, and :@ for an expression. A prop in square brackets is optional.

Name Type Description
q object a prepared tree question

Color tokens

The tokens this component's styles read. Set one in _data/theme.json to change it everywhere.

Pick a color to try it in every example above.

Token Colors Try a color
--color-accent Brand color: fills, buttons, rules, the masthead wash
--color-border Lines, rules and borders
--color-error Error: wrong answers, failures