Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 35 lines (33 sloc) 1.508 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<!DOCTYPE html>
<html data-require="math word-problems">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Composite numbers</title>
    <script src="../khan-exercise.js"></script>
</head>
<body>
    <div class="exercise">
        <div class="vars">
            <var id="COMPOSITE">rand( 5 ) === 0 ? getEvenComposite() : getOddComposite()</var>
            <var id="PRIMES">shuffle( primes, 4 )</var>
            <var id="CHOICES">shuffle( PRIMES.concat([ COMPOSITE ]) )</var>
        </div>

        <div class="problems">
            <div>
                <p class="question">Which of these numbers is composite?</p>
                <p><code>\large{<var>CHOICES.join( ",\\ " )</var>}</code></p>
                <p class="solution"><code><var>COMPOSITE</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 composite number is a number that has more than two factors (including 1 and itself).</p>
            <p><var>toSentence( _.filter( CHOICES, function( p ) { return p !== COMPOSITE; } ) )</var> each have only two factors.</p>
            <p>The factors of <var>COMPOSITE</var> are <var>toSentence( getFactors( COMPOSITE ) )</var>.</p>
            <p>Thus, <var>COMPOSITE</var> is the composite number.</p>
        </div>
    </div>
</body>
</html>
Something went wrong with that request. Please try again.