summaryrefslogtreecommitdiff
path: root/testapp/static/exam/js
diff options
context:
space:
mode:
authorhardythe12012-03-22 17:50:34 +0530
committerhardythe12012-03-22 17:50:34 +0530
commit246478f4ef75ae713e96a64d210bd3710bed3df9 (patch)
treec09755a4861bb734b035c685e2f5782952e3d9b1 /testapp/static/exam/js
parentb1ba290f249d84989cb3cc38d018482794582a46 (diff)
downloadonline_test-246478f4ef75ae713e96a64d210bd3710bed3df9.tar.gz
online_test-246478f4ef75ae713e96a64d210bd3710bed3df9.tar.bz2
online_test-246478f4ef75ae713e96a64d210bd3710bed3df9.zip
Tagging functionality in quiz
Diffstat (limited to 'testapp/static/exam/js')
-rw-r--r--testapp/static/exam/js/show_question.js60
-rw-r--r--testapp/static/exam/js/show_quiz.js50
2 files changed, 71 insertions, 39 deletions
diff --git a/testapp/static/exam/js/show_question.js b/testapp/static/exam/js/show_question.js
index ccacbdd..e3ed1cc 100644
--- a/testapp/static/exam/js/show_question.js
+++ b/testapp/static/exam/js/show_question.js
@@ -1,23 +1,39 @@
function confirm_delete(frm)
- {
- var r = confirm("Are you Sure ?");
- if(r==false)
- {
- for(i=0;i<frm.question.length;i++)
- {
- frm.question[i].checked=false;
- }
- location.replace("{{URL_ROOT}}/exam/manage/showquestion");
- }
- }
- function confirm_edit(frm)
- {
- var n = 0;
- for(i=0;i<frm.question.length;i++)
- {
- if(frm.question[i].checked==true)
- n = n+1;
- }
- if(n==0)
- location.replace("{{URL_ROOT}}/exam/manage/showquestion");
- }
+{
+ var n=0;
+ for (var i =0;i<frm.question.length;i++)
+ {
+ if (frm.question[i].checked == false)
+ n = n + 1 ;
+ }
+ if(n==frm.question.length)
+ {
+ alert("Please Select at least one Question");
+ return false;
+ }
+ var r = confirm("Are you Sure ?");
+ if(r==false)
+ {
+ for(i=0;i<frm.question.length;i++)
+ {
+ frm.question[i].checked=false;
+ }
+ return false;
+ }
+}
+function confirm_edit(frm)
+{
+ var n = 0;
+ for (var i =0;i<frm.question.length;i++)
+ {
+ if (frm.question[i].checked == false)
+ n = n + 1 ;
+ }
+ if(n == frm.question.length)
+ {
+ alert("Please Select at least one Question");
+ return false;
+ }
+ else
+ return true;
+}
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;
+}