Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure addition_4 always requires carrying #FIXIT

Reviewers: emily

Reviewed By: emily

Differential Revision: http://phabricator.khanacademy.org/D425
  • Loading branch information...
commit df41e309f6da9c138c1a9c5ed7f37ec2681b040e 1 parent cf70efb
@beneater beneater authored
Showing with 25 additions and 19 deletions.
  1. +25 −19 exercises/addition_4.html
View
44 exercises/addition_4.html
@@ -6,36 +6,42 @@
<script src="../khan-exercise.js"></script>
</head>
<body>
- <div class="exercise">
- <div class="vars" data-ensure="A >= B">
- <var id="A_1000">randRangeWeighted( 0, 9, 0, 0.25 )*1000</var>
- <var id="A_100">randRange( 0, 9 )*100</var>
- <var id="A_10">randRange( 0, 9 )*10</var>
- <var id="A_1">randRange ( 0, 9 )*1</var>
- <var id="B_1000" data-ensure="B_1000<=A_1000">randRangeWeighted( 0, 9, 0, 0.25 )*1000</var>
- <var id="B_100">randRange( 0, 9 )*100</var>
- <var id="B_10">randRange( 0, 9 )*10</var>
- <var id="B_1">randRange ( 0, 9 )*1</var>
- <var id="A">A_1000+A_100+A_10+A_1</var>
- <var id="B">B_1000+B_100+B_10+B_1</var>
- <var id="DUMMY">[]</var>
- </div>
+<div class="exercise">
+ <div class="vars" data-ensure="A >= B && (
+ (A_1 + B_1 > 10 && B >= 10) ||
+ (A_10 + B_10 > 100 && B >= 100) ||
+ (A_100 + B_100 > 1000 && B >= 1000))">
+ <var id="A_1000">randRangeWeighted(0, 9, 0, 0.25) * 1000</var>
+ <var id="A_100">randRange(0, 9) * 100</var>
+ <var id="A_10">randRange(0, 9) * 10</var>
+ <var id="A_1">randRange(0, 9) * 1</var>
+ <var id="B_1000" data-ensure="B_1000 <= A_1000">
+ randRangeWeighted(0, 9, 0, 0.25) * 1000
+ </var>
+ <var id="B_100">randRange(0, 9) * 100</var>
+ <var id="B_10">randRange(0, 9) * 10</var>
+ <var id="B_1">randRange(0, 9) * 1</var>
+ <var id="A">A_1000 +A_100 + A_10 + A_1</var>
+ <var id="B">B_1000 +B_100 + B_10 + B_1</var>
+ <var id="NUM_HINTS">0</var>
+ </div>
<div class="problems">
- <div>
+ <div id="addition-4">
<div class="graphie" id="numbers">
- graph.adder = new Adder( A, B );
+ graph.adder = new Adder(A, B);
graph.adder.show();
- DUMMY = Array( graph.adder.getNumHints() );
+ NUM_HINTS = graph.adder.getNumHints();
</div>
<div class="solution" data-forms="integer"><var>A + B</var></div>
</div>
</div>
+
<div class="hints">
- <div class="graphie" data-update="numbers" data-each="DUMMY as dummy">
+ <div class="graphie" data-update="numbers" data-each="NUM_HINTS times">
graph.adder.showHint();
</div>
</div>
- </div>
+</div>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.