Permalink
Browse files

fixed bug with proof representation, removed console.logs

  • Loading branch information...
1 parent ce26ed2 commit c6d038852e2faba9ecadf0a93ab72b44ae5c4c7d @mwittels mwittels committed Jul 10, 2012
Showing with 11 additions and 16 deletions.
  1. +1 −7 exercises/geometry_proofs_intro.html
  2. +10 −9 utils/proofs.js
View
8 exercises/geometry_proofs_intro.html
@@ -2,7 +2,7 @@
<html data-require="math graphie graphie-helpers graphie-geometry math-format interactive proofs congruency">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Geometry Proofs 1</title>
+ <title>Simple Geometry Proofs</title>
<script src="../khan-exercise.js"></script>
<style type="text/css">
input[type=text] {
@@ -169,7 +169,6 @@
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 " + reason);
$("#thing1").val("");
$("#thing2").val("");
$("#reason").val("");
@@ -193,7 +192,6 @@
else{
hintCategory = "bad format";
}
- console.log(hintCategory);
});
$("#reason").change(function(){
<!-- var curVal = $("#reason").val();
@@ -438,7 +436,6 @@
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 " + reason);
$("#thing1").val("");
$("#thing2").val("");
$("#reason").val("");
@@ -462,7 +459,6 @@
else{
hintCategory = "bad format";
}
- console.log(hintCategory);
});
$("#reason").change(function(){
<!-- var curVal = $("#reason").val();
@@ -717,7 +713,6 @@
}
$(".statements").html(outputKnownProof());
_.each($(".statements code"), function(tag){ $.tmpl.type.code()(tag); });
- console.log("thinks statement is true " + reason);
$("#thing1").val("");
$("#thing2").val("");
$("#reason").val("");
@@ -741,7 +736,6 @@
else{
hintCategory = "bad format";
}
- console.log(hintCategory);
});
$("#reason").change(function(){
<!-- var curVal = $("#reason").val();
View
19 utils/proofs.js
@@ -335,9 +335,6 @@ function nextStatementHint() {
// look for something that can be proven with the statements already known
// that is in finishedEqualities
var tryProving = hintKeys[KhanUtil.randRange(0, hintKeys.length - 1)];
- console.log("trying hint for " + tryProving);
- console.log(tryProving in knownEqualities);
- console.log(hintKeys);
// awful, terrible hacky way to deal with javascript object hashes
if (tryProving[0] === "t") {
@@ -1829,7 +1826,6 @@ function checkTriangleCongruent(triangle1, triangle2, reason) {
// Checks to see if the two given segments are equal by checking to see if they belong to
// congruent triangles.
function checkSegEqual(seg1, seg2, reason) {
- console.log("cse");
//if this is already known
if (eqIn([seg1, seg2], knownEqualities)) {
return true;
@@ -2195,13 +2191,18 @@ function sortEqualityList(equalityList, equalityObject) {
dupCheck[equalityList[i]] = true;
}
}
- var sortedEqualityList = _.clone(newEqualityList);
- for (var i = 0; i < newEqualityList.length; i++) {
- if (equalityObject[newEqualityList[i]] === "vertical angles are equal" || equalityObject[newEqualityList[i]] === "alternate interior angles are equal") {
- sortedEqualityList[i - 1] = newEqualityList[i];
- sortedEqualityList[i] = newEqualityList[i - 1];
+ if(equalityObject === finishedEqualities) {
+ var sortedEqualityList = _.clone(newEqualityList);
+ for (var i = 0; i < newEqualityList.length; i++) {
+ if (equalityObject[newEqualityList[i]] === "vertical angles are equal" || equalityObject[newEqualityList[i]] === "alternate interior angles are equal") {
+ sortedEqualityList[i - 1] = newEqualityList[i];
+ sortedEqualityList[i] = newEqualityList[i - 1];
+ }
}
}
+ else{
+ var sortedEqualityList = newEqualityList;
+ }
return sortedEqualityList;
}

0 comments on commit c6d0388

Please sign in to comment.