Permalink
Browse files

intro proofs vertical case working

  • Loading branch information...
1 parent 99d4689 commit 63161681fe45b0d1445fef2d96570a05a969a30d @mwittels 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 @@
<div class="instruction">
Fill in the blanks in this proof that <var> FINISHED </var>.
</div>
- <div class="guess">[outputKnownProof()]</div>
+ <div class="guess">1</div>
<div class="validator-function">
return FILL_BLANKS_NUM==0;
</div>
<div class="show-guess">
-
+ return outputKnownProof();
</div>
</div>
<div class="hints">
@@ -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 @@
<div class="instruction">
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.
</div>
- <div class="guess">[knownEqualities]</div>
+ <div class="guess">1</div>
<div class="validator-function">
return isProofDone();
</div>
<div class="show-guess">
-
+ return knownEqualities;
</div>
</div>
<div class="hints">
View
@@ -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);
}

0 comments on commit 6316168

Please sign in to comment.