Skip to content
Newer
Older
100644 58 lines (52 sloc) 1.78 KB
d4e52bd @jeresig I got something to draw! A chart is showing up now, rendering content…
jeresig authored May 17, 2011
1 <!DOCTYPE html>
2 <html data-require="math graph">
3 <head>
4 <title>Limits 1</title>
5 <script src="../khan-exercise.js"></script>
6 </head>
7 <body><div id="raphael_container"></div>
8 <div id="vars">
9 <var id="q_lcoef">nonZeroRandomInt(-3, 3)</var>
10 <var id="edge">floor(sqrt(abs(10 / q_lcoef)))</var>
11 <var id="l_cons">nonZeroRandomInt(-1 * edge, edge)</var>
12 <var id="quadratic">q_lcoef + 'x^2'</var>
13 <var id="line">cleanMath('(x + ' + l_cons + ')')</var>
14 <var id="curFunc">function(x) {
15 return truncate_to_max(q_lcoef * Math.pow(x, 2), 4);
16 }</var>
17 <var id="a">-1 * l_cons</var>
18 <var id="limtoa">curFunc(a)</var>
19 <var id="l_limtoa">limtoa</var>
20 <var id="r_limtoa">limtoa</var>
21 <var id="blah">(function(){
22 RaphaelWrapper.init(400, 400);
23 RaphaelWrapper.drawPlane( -10, 10, -10, 10 )
24
25 present.fontsize = "15";
26 present.fontfamily = "sans-serif";
27 present.fontstyle = "bold";
28
29 present.stroke = "blue";
30
31 present.plot('(' + quadratic + line + ')/' + line);
32 present.ASdot([a, limtoa], 4, "black", "white");
33 })()</var>
34 </div>
35
36 <div id="problems">
37 <div id="original" class="problem">
38 <div class="problem">
39
40 </div>
41 <p class="question"><code>\lim_{x\to<var>a</var>} \dfrac{<var>quadratic</var><var>line</var>}{<var>line</var>} = ?</code></p>
42 <p class="solution"><code><var>limtoa</var></code></p>
43 <ul class="choices" data-show="5" data-none="true">
44 <li><code>0</code></li>
45 <li><code><var>nonZeroRandomInt(-3, 3)</var></code></li>
46 <li><code><var>nonZeroRandomInt(-3, 3)</var></code></li>
47 <li><code><var>q_lcoef</var></code></li>
48 <li><code><var>l_cons</var></code></li>
49 <li><code><var>curFunc(0)</var></code></li>
50 <li>Does not exist.</li>
51 </ul>
52 <div class="hint"></div>
53 </div>
54 </div>
55
56 <div id="hints"></div>
57 </body>
58 </html>
Something went wrong with that request. Please try again.