Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Show prime number hints in same order as multiple choice, maybe fix #…

  • Loading branch information...
commit 25e5b1a83a6643d897210d44d496750334f2ceeb 1 parent da42824
@marcia marcia authored
Showing with 8 additions and 21 deletions.
  1. +8 −21 exercises/prime_numbers.html
View
29 exercises/prime_numbers.html
@@ -7,43 +7,30 @@
</head>
<body>
<div class="exercise">
- <div class="vars">
+ <div class="vars" data-ensure="WRONG_1 !== WRONG_2 && WRONG_2 !== WRONG_3">
<var id="PRIME">getPrime()</var>
- <var id="PRIME_FACTORS">toSentence( getFactors( PRIME ) )</var>
-
<var id="WRONG_1">getOddComposite()</var>
- <var id="WRONG_1_FACTORS">toSentence( getFactors( WRONG_1 ) )</var>
-
<var id="WRONG_2">getOddComposite()</var>
- <var id="WRONG_2_FACTORS">toSentence( getFactors( WRONG_2 ) )</var>
-
<var id="WRONG_3">getOddComposite()</var>
- <var id="WRONG_3_FACTORS">toSentence( getFactors( WRONG_3 ) )</var>
-
<var id="WRONG_4">getEvenComposite()</var>
- <var id="WRONG_4_FACTORS">toSentence( getFactors( WRONG_4 ) )</var>
+
+ <var id="CHOICES">shuffle( [ PRIME, WRONG_1, WRONG_2, WRONG_3, WRONG_4 ] )</var>
</div>
<div class="problems">
<div>
<p class="question">Which of these numbers is prime?</p>
- <p class="solution"><var>PRIME</var></p>
- <ul class="choices">
- <li><var>WRONG_1</var></li>
- <li><var>WRONG_2</var></li>
- <li><var>WRONG_3</var></li>
- <li><var>WRONG_4</var></li>
+ <p><code>\large{<var>CHOICES.join( "," )</var>}</code></p>
+ <p class="solution"><code><var>PRIME</var></code></p>
+ <ul class="choices" data-category="true">
+ <li data-each="CHOICES as CHOICE"><code><var>CHOICE</var></code></li>
</ul>
</div>
</div>
<div class="hints">
<p>A prime number has exactly two factors: 1 and itself.</p>
- <p>The factors of <var>WRONG_1</var> are <var>WRONG_1_FACTORS</var>.</p>
- <p>The factors of <var>WRONG_2</var> are <var>WRONG_2_FACTORS</var>.</p>
- <p>The factors of <var>WRONG_3</var> are <var>WRONG_3_FACTORS</var>.</p>
- <p>The factors of <var>WRONG_4</var> are <var>WRONG_4_FACTORS</var>.</p>
- <p>The factors of <var>PRIME</var> are <var>PRIME_FACTORS</var>.</p>
+ <p data-each="CHOICES as CHOICE">The factors of <var>CHOICE</var> are <var>toSentence( getFactors( CHOICE ) )</var>.</p>
<p>Thus, <var>PRIME</var> is a prime number.</p>
</div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.