Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Show prime number hints in same order as multiple choice, maybe fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcia committed Sep 21, 2011
1 parent da42824 commit 25e5b1a
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions exercises/prime_numbers.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 25e5b1a

Please sign in to comment.