Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 53 lines (45 sloc) 2.078 kb
af417c3 @marcia Add prime numbers
marcia authored
1 <!DOCTYPE html>
2 <html data-require="math">
3 <head>
4 <title>Prime Numbers</title>
5 <script src="../khan-exercise.js"></script>
6 </head>
7 <body>
8 <div id="vars">
9 <var id="PRIME">getPrime()</var>
10 <var id="PRIME_FACTORS">getFactors( PRIME ).join( ", " )</var>
11
12 <!-- TODO: Pass in function that generates wrong answers,
13 and keep calling until have enough unique answers -->
14 <var id="WRONG_1">getOddComposite()</var>
15 <var id="WRONG_1_FACTORS">getFactors( WRONG_1 ).join( ", " )</var>
16
17 <var id="WRONG_2">getOddComposite()</var>
18 <var id="WRONG_2_FACTORS">getFactors( WRONG_2 ).join( ", " )</var>
19
20 <var id="WRONG_3">getOddComposite()</var>
21 <var id="WRONG_3_FACTORS">getFactors( WRONG_3 ).join( ", " )</var>
22
23 <var id="WRONG_4">getEvenComposite()</var>
24 <var id="WRONG_4_FACTORS">getFactors( WRONG_4 ).join( ", " )</var>
25
26 </div>
27
28 <div id="problems">
29 <div class="problem">
30 <p class="question">Which of these numbers is prime?</p>
31 <p class="solution"><var>PRIME</var></p>
32 <!-- TODO: no data-none doesn't seem to work -->
33 <ul class="choices" data-show="5" data-none="true">
34 <li><var>WRONG_1</var></li>
35 <li><var>WRONG_2</var></li>
36 <li><var>WRONG_3</var></li>
37 <li><var>WRONG_4</var></li>
38 </ul>
39 </div>
40 </div>
41
42 <div id="hints">
43 <p>A prime number has exactly two factors: 1 and itself.</p>
44 <p>The factors of <var>WRONG_1</var> are <var>WRONG_1_FACTORS</var>.</p>
45 <p>The factors of <var>WRONG_2</var> are <var>WRONG_2_FACTORS</var>.</p>
46 <p>The factors of <var>WRONG_3</var> are <var>WRONG_3_FACTORS</var>.</p>
47 <p>The factors of <var>WRONG_4</var> are <var>WRONG_4_FACTORS</var>.</p>
48 <p>The factors of <var>PRIME</var> are <var>PRIME_FACTORS</var>.</p>
49 <p>Thus, <var>PRIME</var> is a prime number.</p>
50
51 </div>
52 </body>
53 </html>
Something went wrong with that request. Please try again.