Internal tag - Solutions

When creating an exercise we can use <solution> tag inside <codeblock> to show the solution code to the user. The code inside <solution> tag will be used for the evaluation of the code.

Example

<codeblock language="html" type="exercise" testMode="fixedInput">
<code>
<table>
  <tr>
    <td>Boxing</td>
    <td>Gloves</td>
  </tr>
  <tr>
    <td>Archery</td>
    <td>Arrow</td>
  </tr>
</table>
</code>

<solution>
<table>
  <tr>
    <th>Sport</th>
    <th>Equipment</th>
  </tr>
  <tr>
    <td>Boxing</td>
    <td>Gloves</td>
  </tr>
  <tr>
    <td>Archery</td>
    <td>Arrow</td>
  </tr>
</table>
</solution>
</codeblock>

This will render a Solution button clicking on which will display the solution code to the user.

Solution tag rendered example.

Can't find what you're looking for?