Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use graph object for The Complex Plane.

Summary: In response to D2032.

Test Plan:
locally, Chrome/OS X
- open in debug mode
- put in some incorrect answers, then a correct one
- click "Problem history" and see that the history is correct

Reviewers: eater, alpert

Reviewed By: eater

CC: stephanie

Differential Revision: http://phabricator.khanacademy.org/D2034
  • Loading branch information...
commit e4a2b8c70d960b87c55b5f1e4ade615cdc720edb 1 parent d7d00c2
Michael Chang cbhl authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 exercises/the_complex_plane.html
16 exercises/the_complex_plane.html
View
@@ -30,8 +30,8 @@
label([0.5, 5], "Im", "right");
addMouseLayer();
- this.movablePoint = addMovablePoint({constraints: {}, snapX: 0.5, snapY: 0.5});
- movablePoint.onMove = function(x, y) {
+ graph.movablePoint = addMovablePoint({constraints: {}, snapX: 0.5, snapY: 0.5});
+ graph.movablePoint.onMove = function(x, y) {
if (x < LOWER_BOUND || x > UPPER_BOUND || y < LOWER_BOUND || y > UPPER_BOUND) {
return false;
}
@@ -39,13 +39,13 @@
</div>
<div class="solution" data-type="custom">
<div class="guess">
- movablePoint.coord
+ graph.movablePoint.coord
</div>
<div class="validator-function">
- return movablePoint.coord.join() === [REAL, IMAG].join();
+ return graph.movablePoint.coord.join() === [REAL, IMAG].join();
</div>
<div class="show-guess">
- movablePoint.setCoord(guess);
+ graph.movablePoint.setCoord(guess);
</div>
</div>
<div class="hints">
@@ -60,7 +60,7 @@
<div class="graphie" data-update="gauss-plane">
style({stroke: ORANGE, strokeWidth: 2.0});
line([REAL, LOWER_BOUND - 1], [REAL, UPPER_BOUND + 1]);
- movablePoint.visibleShape.toFront();
+ graph.movablePoint.visibleShape.toFront();
</div>
<p>The vertical <strong class="hint_orange">orange</strong> line represents all complex numbers with real part <code><var>REAL</var></code> (including <code><var>REP</var></code>).
</div>
@@ -68,13 +68,13 @@
<div class="graphie" data-update="gauss-plane">
style({stroke: BLUE, strokeWidth: 2.0});
line([LOWER_BOUND - 1, IMAG], [UPPER_BOUND + 1, IMAG]);
- movablePoint.visibleShape.toFront();
+ graph.movablePoint.visibleShape.toFront();
</div>
<p>The horizontal <strong class="hint_blue">blue</strong> line represents all complex numbers with imaginary part <code><var>IMAG</var></code>, also including <code><var>REP</var></code>.
</div>
<div>
<div class="graphie" data-update="gauss-plane">
- movablePoint.moveTo(REAL, IMAG);
+ graph.movablePoint.moveTo(REAL, IMAG);
</div>
<p>
The only complex number with real part <code><var>REAL</var></code> and imaginary part <code><var>IMAG</var></code> is <code><var>REP</var></code>,
Please sign in to comment.
Something went wrong with that request. Please try again.