Embedding programming code in choices
-
Hey Dan! Me again!
I would like to embed source code into the question choices. I was looking through the source code to see how tags were being handled and was wondering if maybe introducing something like an [ec][/ec] pair for encoded content so that everything between the tags is base64 encoded.
I am using prism.js for the source code embedding. This works in Qwizcards as content to be displayed to the student before the choices are displayed, but not when embedded.
Here is a sample test page I was using.
<h3 id="quiz1">Quiz 1</h3> This is both the question and the first answer: <pre class="language-java"><code>for ( int i = 1; i <= 10; i++ ) ia[i] = i * 3;</code></pre> [qwiz repeat_incorrect="false" random="true"] [h]Arrays [i]Answer all the questions by selecting the best possible answer. [q multiple_choice="true"]Below is also the first answer: <pre class="language-java"><code>for ( int i = 1; i <= 10; i++ ) ia[i] = i * 3;</code></pre> [c]<pre class="language-java"><code>for ( int i = 1; i <= 10; i++ ) ia[i] = i * 3;</code></pre> [c]<pre class="language-java"><code>for ( int i = 1; i < 11; i++ ) ia[i] = i * 3;</code></pre> [c*]<pre class="language-java"><code>for ( int i = 0; i < 10; i++ ) ia[i] = i * 3;</code></pre> [c]<pre class="language-java"><code>for ( int i = 0; i <= 10; i++ ) ia[i] = i * 3;</code></pre> [fx]no [x]The quiz is now complete. Click the button below to repeat this quiz. [restart] [/qwiz]
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Embedding programming code in choices’ is closed to new replies.