randRange(1, 15) randRange(1, 16 - A) randRange(1, 17 - A - B) A + B + C randRange(0, 1) === 0 ? 10 : TOTAL - 10 TOTAL - D randRange(0, 1)

Fill in the blanks to make the equations true.

// Focus the first input $('.problem-equation input').eq(0).focus() Khan.scratchpad.disable();

`A` | `+` | `B` | `+` | `C` | `=` |  | `+` | `D`
`A` | `+` | `B` | `+` | `C` | `=` | `D` | `+` |
`A` | `+` | `B` | `+` | `C` | `=` |

Fill in the blanks with the correct numbers.
_.map($("div.problem input"), function(el) { return $(el).val(); })
if (guess[0] === "" || guess[1] === "") { return "Fill in both blanks."; } var validator1 = Khan.answerTypes.number.createValidatorFunctional(E, {}); var validator2 = Khan.answerTypes.number.createValidatorFunctional(TOTAL, {}); var result1 = validator1(guess[0]); var result2 = validator2(guess[1]); if (result1.empty) { return result1.message || ""; } if (result2.empty) { return result2.message || ""; } return result1.correct && result2.correct;
$("div.problem input").val(guess);

We have `\blue{A}` blue dot `\blue{A}` blue dots and `\green{B}` green dot `\green{B}` green dots and `\purple{C}` purple dot `\purple{C}` purple dots.

init({ range: [[-0.5, 16.5], [-1, 3]], scale: [30, 30] }); var x = 0; var y = 2; var drawDots = function(n) { for (var i = 0; i < n; i++) { circle([x, y], 0.25); x++; } } style({ stroke: BLUE, fill: BLUE }); drawDots(A); style({ stroke: GREEN, fill: GREEN }); y--; x = 0; drawDots(B); style({ stroke: PURPLE, fill: PURPLE }); y--; x = 0; drawDots(C);

We can arrange the dots to make them easier to count.

init({ range: [[-0.5, 11], [-1, 2]], scale: [30, 30] }); var x = 0; var y = 1; var drawDots = function(n) { for (var i = 0; i < n; i++) { circle([x, y], 0.25); x++; if (x > 9) { x = 0; y--; } } } style({ stroke: BLUE, fill: BLUE }); drawDots(A); style({ stroke: GREEN, fill: GREEN }); drawDots(B); style({ stroke: PURPLE, fill: PURPLE }); drawDots(C); label([9.5, 1], "10", "right");

We have `10` dots in the top row. How many in the second row?

There is `TOTAL - 10` dot in the second row, so `A + B + C = 10 + TOTAL - 10`.

There are `TOTAL - 10` dots in the second row, so `A + B + C = 10 + TOTAL - 10`.

How many dots in total?

There are `TOTAL` dots in total. So the missing numbers are `E` and `TOTAL`.

randRange(1, 15) randRange(1, 16 - A) randRange(1, 17 - A - B) A + B + C randRange(0, 1) MISSING === 0 ? [10, 10 - C] : [10 - C, 10]

Fill in the blanks to make the equations true.

// Focus the first input $('.problem-equation input').eq(0).focus() Khan.scratchpad.disable();

`TOTAL` | `-` | `A` | `-` | `B` | `=` |  | `-` | `E`
`TOTAL` | `-` | `A` | `-` | `B` | `=` | `10` | `-` |
`TOTAL` | `-` | `A` | `-` | `B` | `=` |

Fill in the blanks with the correct numbers.
_.map($("div.problem input"), function(el) { return $(el).val(); })
if (guess[0] === "" || guess[1] === "") { return "Fill in both blanks."; } var validator1 = Khan.answerTypes.number.createValidatorFunctional(D, {}); var validator2 = Khan.answerTypes.number.createValidatorFunctional(C, {}); var result1 = validator1(guess[0]); var result2 = validator2(guess[1]); if (result1.empty) { return result1.message || ""; } if (result2.empty) { return result2.message || ""; } return result1.correct && result2.correct;
$("div.problem input").val(guess);

First arrange `TOTAL` dots into rows of `10`.

init({ range: [[-0.5, 10.5], [-1, 2]], scale: [30, 30] }); var x = 0; var y = 1; var drawDots = function(n) { for (var i = 0; i < n; i++) { circle([x, y], 0.25); x++; if (x > 9) { x = 0; y--; } } } style({ stroke: BLUE, fill: BLUE }); drawDots(TOTAL);

We need to subtract `A` and then subtract another `B`, so in total, we need to subtract `A + B`.

First subtract enough dots to leave `10` remaining. How many have we subtracted?

var x = 0; var y = 0; var crossOutDots = function(n) { for (var i = 0; i < n; i++) { path([[x - 0.3, y - 0.3], [x + 0.3, y + 0.3]]); path([[x - 0.3, y + 0.3], [x + 0.3, y - 0.3]]); x++; } } style({ stroke: RED }); crossOutDots(TOTAL - 10);

We have subtracted `TOTAL - 10`, so we need to subtract another `[E, D][MISSING]`.

`TOTAL - A - B = 10 - [E, D][MISSING]`.

After subtracting the remaining `[E, D][MISSING]`, we have `C` left.

`TOTAL - A - B = C`.

var x = 0; var y = 1; var crossOutDots = function(n) { for (var i = 0; i < n; i++) { path([[x - 0.3, y - 0.3], [x + 0.3, y + 0.3]]); path([[x - 0.3, y + 0.3], [x + 0.3, y - 0.3]]); x++; } } style({ stroke: RED }); crossOutDots([E, D][MISSING]);