From 5de740ab5d376e0f2a987ac5bf1ea2c0d001d03d Mon Sep 17 00:00:00 2001 From: wangmingsunrise Date: Tue, 15 Dec 2015 18:23:58 +0800 Subject: [PATCH] sunrise-fixbug-properties_of_incenters --- exercises/properties_of_incenters.html | 52 ++++++++++++++++---------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/exercises/properties_of_incenters.html b/exercises/properties_of_incenters.html index 2d87216f..1006f86b 100644 --- a/exercises/properties_of_incenters.html +++ b/exercises/properties_of_incenters.html @@ -65,7 +65,7 @@ { var j=i; for(;j if(document.getElementById("t1").style.display=="") { - if(document.getElementById("t1").value.replace(/\s+/g,"")=="AE"||document.getElementById("t1").value.replace(/\s+/g,"")=="EA") + if($('#t1').val().replace(/\s+/g,"").split('').sort().join("")=="AE") {} - else + else{ return false; + } } if(document.getElementById("t2").style.display=="") { - if(document.getElementById("t2").value.replace(/\s+/g,"")=="BF"||document.getElementById("t2").value.replace(/\s+/g,"")=="FB") + if($('#t2').val().replace(/\s+/g,"").split('').sort().join("")=="BF") {} - else + else{ return false; + } } if(document.getElementById("t3").style.display=="") { - if(document.getElementById("t3").value.replace(/\s+/g,"")=="CG"||document.getElementById("t3").value.replace(/\s+/g,"")=="GC") + if($('#t3').val().replace(/\s+/g,"").split('').sort().join("")=="CG") {} - else + else{ return false; + } } if(document.getElementById("t4").style.display=="") { - if(document.getElementById("t4").value.replace(/\s+/g,"")=="DH"||document.getElementById("t4").value.replace(/\s+/g,"")=="HD") + if($('#t4').val().replace(/\s+/g,"").split('').sort().join("")=="DH") {} - else + else{ return false; + } } if(document.getElementById("t5").style.display=="") { - if(document.getElementById("t5").value.replace(/\s+/g,"")=="AH"||document.getElementById("t5").value.replace(/\s+/g,"")=="HA") + if($('#t5').val().replace(/\s+/g,"").split('').sort().join("")=="AH") {} - else + else{ return false; + } } if(document.getElementById("t6").style.display=="") { - if(document.getElementById("t6").value.replace(/\s+/g,"")=="BF"||document.getElementById("t6").value.replace(/\s+/g,"")=="FB") + if($('#t6').val().replace(/\s+/g,"").split('').sort().join("")=="BF") {} - else + else{ return false; + } } if(document.getElementById("t7").style.display=="") { - if(document.getElementById("t7").value.replace(/\s+/g,"")=="DG"||document.getElementById("t7").value.replace(/\s+/g,"")=="GD") + if($('#t7').val().replace(/\s+/g,"").split('').sort().join("")=="DG"||$('#t7').val().replace(/\s+/g,"").split('').sort().join("")=="CG") {} - else + else{ return false; + } } if(document.getElementById("t8").style.display=="") { - if(document.getElementById("t8").value.replace(/\s+/g,"")=="CG"||document.getElementById("t8").value.replace(/\s+/g,"")=="GC") + if($('#t8').val().replace(/\s+/g,"").split('').sort().join("")=="CG"||$('#t8').val().replace(/\s+/g,"").split('').sort().join("")=="DG") {} - else + else{ return false; + } + } + if(document.getElementById("t7").style.display=="" && document.getElementById("t8").style.display==""){ + if($('#t7').val().replace(/\s+/g,"").split('').sort().join("") == $('#t8').val().replace(/\s+/g,"").split('').sort().join("")){ + return false; + } } if(document.getElementById("t9").style.display=="") { - if(document.getElementById("t9").value.replace(/\s+/g,"")=="AB"||document.getElementById("t3").value.replace(/\s+/g,"")=="BA") + if($('#t9').val().replace(/\s+/g,"").split('').sort().join("")=="AB") {} - else + else{ return false; + } } return true;