日期:2014-05-17 浏览次数:20404 次
<script type="text/javascript"> function checkValue() { var flag=true; $("#hiddenresult").find("input[type=hidden]").each(function(i) { if (this.value == '' || this.value != document.getElementById(this.id).getAttribute("answer")) { flag=false; var msg = this.name; var str = msg.split("_"); var ii = parseInt(parseInt(str[1])+1); pageselectCallback(parseInt(str[1])); if (this.value != document.getElementById(this.id).getAttribute("answer") && this.value) { var ErrStr = '回答错误' } else { var ErrStr = '没有答' } $("#tishi").html('<span>第'+ii+'题'+ErrStr+'!正确答案是:'+document.getElementById(this.id).getAttribute("answer")+'</span>'); return false; } }); return flag; } function checkValue2(id1) { if (id1>=0) { var id2 = 'db_'+id1; var msg = document.getElementById(id2).getAttribute("name"); var str = msg.split("_"); var ii = parseInt(parseInt(str[1])+1); if (document.getElementById(id2).value == '' || document.getElementById(id2).value != document.getElementById(id2).getAttribute("answer")) { if (document.getElementById(id2).value != document.getElementById(id2).getAttribute("answer") && document.getElementById(id2).value) { $("#tishi").html('<span class="alert">第'+ii+'题回答错误!正确答案是:'+document.getElementById(id2).getAttribute("answertext")+'</span>'); } else { $("#tishi").html('<span class="alert">第'+ii+'题没有答!</span>'); } } else { $("#tishi").html('<span class="ok">第'+ii+'题回答正确!</span>'); } if (id1==9) { $("#Button2").hide(); $("#Button1").show(); } } } </script>