diff options
author | jayparikh111 | 2012-11-01 13:43:21 +0530 |
---|---|---|
committer | jayparikh111 | 2012-11-01 13:43:21 +0530 |
commit | 56bd985701bee1e4c9ed8a694c5b2ff1258e2aad (patch) | |
tree | d69abb58318e41cf38d4cb3d11f99e32c1a8c8c9 /testapp/static | |
parent | cad1366b66a4079a22eb3a6f0b41c2705a6e0a0b (diff) | |
download | online_test-56bd985701bee1e4c9ed8a694c5b2ff1258e2aad.tar.gz online_test-56bd985701bee1e4c9ed8a694c5b2ff1258e2aad.tar.bz2 online_test-56bd985701bee1e4c9ed8a694c5b2ff1258e2aad.zip |
Removed Global variables for Quiz & Questions
Diffstat (limited to 'testapp/static')
-rw-r--r-- | testapp/static/exam/js/show_quiz.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/testapp/static/exam/js/show_quiz.js b/testapp/static/exam/js/show_quiz.js index 55813c9..2e6e2de 100644 --- a/testapp/static/exam/js/show_quiz.js +++ b/testapp/static/exam/js/show_quiz.js @@ -1,12 +1,13 @@ function confirm_delete(frm) { var n=0; - for (var i =0;i<frm.quiz.length;i++) + quiz = document.getElementsByName('quiz'); + for (var i =0;i<quiz.length;i++) { - if (frm.quiz[i].checked == false) + if (quiz[i].checked == false) n = n + 1 ; } - if(n==frm.quiz.length) + if(n==quiz.length) { alert("Please Select at least one Quiz"); return false; @@ -14,9 +15,9 @@ function confirm_delete(frm) var r = confirm("Are you Sure ?"); if(r==false) { - for(i=0;i<frm.quiz.length;i++) + for(i=0;i<quiz.length;i++) { - frm.quiz[i].checked=false; + quiz[i].checked=false; } return false; } @@ -24,16 +25,19 @@ function confirm_delete(frm) function confirm_edit(frm) { var n = 0; - for (var i =0;i<frm.quiz.length;i++) + quiz = document.getElementsByName('quiz'); + for (var i =0;i<quiz.length;i++) { - if (frm.quiz[i].checked == false) + if (quiz[i].checked == false) n = n + 1 ; } - if(n == frm.quiz.length) + if(n == quiz.length) { - alert("Please Select at least one Quiz"); + alert("Please Select at least one Question"); return false; } else return true; + + } |