summaryrefslogtreecommitdiff
path: root/testapp/static/exam/js/add_questionpaper.js
diff options
context:
space:
mode:
authorHardik Ghaghada2013-04-26 16:40:34 +0530
committerHardik Ghaghada2013-04-26 16:40:34 +0530
commitc8b68813ca80aee16261e5f02d541ed48712feae (patch)
tree85ee9038f09b7aab4fb1b57cbb444108736f708e /testapp/static/exam/js/add_questionpaper.js
parent1dd9573cfaa0587cd3217495847a0b456ceb6223 (diff)
downloadonline_test-c8b68813ca80aee16261e5f02d541ed48712feae.tar.gz
online_test-c8b68813ca80aee16261e5f02d541ed48712feae.tar.bz2
online_test-c8b68813ca80aee16261e5f02d541ed48712feae.zip
Dumped JS from HTML pages to separate JS files
Diffstat (limited to 'testapp/static/exam/js/add_questionpaper.js')
-rw-r--r--testapp/static/exam/js/add_questionpaper.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/testapp/static/exam/js/add_questionpaper.js b/testapp/static/exam/js/add_questionpaper.js
new file mode 100644
index 0000000..6185dd5
--- /dev/null
+++ b/testapp/static/exam/js/add_questionpaper.js
@@ -0,0 +1,25 @@
+function load_data()
+{
+ var url_root = document.getElementById('url_root').value;
+ var value = document.getElementById('mode').value;
+ var pathArray = window.location.pathname.split( '/' );
+ length = pathArray.length;
+ var digit = parseInt(pathArray[length-2]);
+
+ if (! isNaN(digit) && value == 'Automatic')
+ {
+ window.location = url_root + "/exam/manage/designquestionpaper/automatic/" + digit;
+ }
+ else if(!isNaN(digit) && value == 'Manual')
+ {
+ window.location = url_root + "/exam/manage/designquestionpaper/manual/" + digit;
+ }
+ else if(value == 'Automatic')
+ {
+ window.location = window.location.pathname + "automatic";
+ }
+ else if( value == 'Manual')
+ {
+ window.location = window.location.pathname + "manual";
+ }
+}