diff options
Diffstat (limited to 'testapp/static/exam/js/show_quiz.js')
-rw-r--r-- | testapp/static/exam/js/show_quiz.js | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/testapp/static/exam/js/show_quiz.js b/testapp/static/exam/js/show_quiz.js index db48a37..55813c9 100644 --- a/testapp/static/exam/js/show_quiz.js +++ b/testapp/static/exam/js/show_quiz.js @@ -1,23 +1,39 @@ - function my_confirm(frm) - { - var r = confirm("Are you Sure ?"); - if(r==false) - { +function confirm_delete(frm) +{ + var n=0; + for (var i =0;i<frm.quiz.length;i++) + { + if (frm.quiz[i].checked == false) + n = n + 1 ; + } + if(n==frm.quiz.length) + { + alert("Please Select at least one Quiz"); + return false; + } + var r = confirm("Are you Sure ?"); + if(r==false) + { for(i=0;i<frm.quiz.length;i++) { frm.quiz[i].checked=false; } - location.replace("{{URL_ROOT}}/exam/manage/showquiz"); - } - } - function confirm_edit(frm) - { - var n = 0; - for (var i =0;i<frm.quiz.length;i++) - { + return false; + } +} +function confirm_edit(frm) +{ + var n = 0; + for (var i =0;i<frm.quiz.length;i++) + { if (frm.quiz[i].checked == false) n = n + 1 ; - } - if(n == frm.quiz.length) - location.replace("{{URL_ROOT}}/exam/manage/showquiz"); - } + } + if(n == frm.quiz.length) + { + alert("Please Select at least one Quiz"); + return false; + } + else + return true; +} |