Khan/khan-exercises

intro proofs vertical case working

1 parent 99d4689 commit 63161681fe45b0d1445fef2d96570a05a969a30d mwittels committed Jul 10, 2012
Showing with 29 additions and 11 deletions.
1. +2 −2 exercises/geometry_proofs_1.html
2. +17 −7 exercises/geometry_proofs_intro.html
3. +10 −2 utils/proofs.js
 @@ -397,12 +397,12 @@
Fill in the blanks in this proof that FINISHED .
-
[outputKnownProof()]
+
1
return FILL_BLANKS_NUM==0;
- + return outputKnownProof();
 @@ -160,17 +160,19 @@ return; } - var verifyTriangles = verifyStatementArgs(thing1+"="+thing2, reason, "triangle congruence"); - var verifyAngles = verifyStatementArgs(thing1+"="+thing2, reason, "angle equality"); - var verifySegments = verifyStatementArgs(thing1+"="+thing2, reason, "segment equality"); + var verifyTriangles = thing1.length === 3 && thing2.length === 3 ? verifyStatementArgs(thing1+"="+thing2, reason, "triangle congruence") : false; + var verifyAngles = thing1.length === 3 && thing2.length === 3 ? verifyStatementArgs(thing1+"="+thing2, reason, "angle equality") : false; + var verifySegments = thing1.length === 2 && thing2.length === 2 ? verifyStatementArgs(thing1+"="+thing2, reason, "segment equality") : false; if(verifyTriangles === true || verifyAngles === true || verifySegments === true){ \$(".statements").html(outputKnownProof()); _.each(\$(".statements code"), function(tag){ \$.tmpl.type.code()(tag); }); - console.log("thinks statement is true"); + console.log("thinks statement is true " + reason); \$("#thing1").val(""); \$("#thing2").val(""); \$("#reason").val(""); + \$("#symbol1").html(""); + \$("#symbol2").html(""); if(userProofDone === true){ \$(".nextStatement").hide(); \$("#hint").attr("disabled", true); @@ -193,8 +195,16 @@ \$("#symbol1").html(" \\triangle "); \$("#symbol2").html(" \\triangle "); } - \$("#symbol1").html(" \\angle "); + else if(curVal === "vertical angles" || curVal === "alternate angles"){ + \$("#symbol1").html(" \\angle "); + \$("#symbol2").html(" \\angle "); + } + else{ + \$("#symbol1").html(""); + \$("#symbol2").html(""); + } \$.tmpl.type.code()(\$("#symbol1")[0]); + \$.tmpl.type.code()(\$("#symbol2")[0]); \$(".nextStatement input").keyup(); }); @@ -239,12 +249,12 @@
When you enter the next statement in the proof, and a valid reason, that statement will be added to the proof. When you're done, hit check answer.
-
[knownEqualities]
+
1
return isProofDone();
- + return knownEqualities;
 @@ -197,6 +197,7 @@ function verifyStatement() { } function verifyStatementArgs(statement, reason, category) { + console.log("verifyStatementArgs with ", statement, reason, category); if (userProofDone) { //return false; } @@ -240,6 +241,9 @@ function verifyStatementArgs(statement, reason, category) { else if (triangle1Permutation != triangle2Permutation) { return false; } + else if (eqIn([triangle1, triangle2], knownEqualities)){ + return "that's already in the proof!"; + } else { toReturn = checkTriangleCongruent(triangle1, triangle2, reason); } @@ -260,7 +264,9 @@ function verifyStatementArgs(statement, reason, category) { if (ang1 == null || ang2 == null) { return "those angles aren't in this figure..."; } - + else if (eqIn([ang1, ang2], knownEqualities)){ + return "that's already in the proof!"; + } else { toReturn = checkAngEqual(ang1, ang2, reason); } @@ -283,7 +289,9 @@ function verifyStatementArgs(statement, reason, category) { if (seg1 == null || seg2 == null) { return "those segments aren't in this figure..."; } - + else if (eqIn([seg1, seg2], knownEqualities)){ + return "that's already in the proof!"; + } else { toReturn = checkSegEqual(seg1, seg2, reason); }