summaryrefslogtreecommitdiff
path: root/testapp/static/exam/js
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/static/exam/js')
-rw-r--r--testapp/static/exam/js/show_quiz.js22
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;
+
+
}