diff options
author | Hardik Ghaghada | 2013-04-26 16:40:34 +0530 |
---|---|---|
committer | Hardik Ghaghada | 2013-04-26 16:40:34 +0530 |
commit | c8b68813ca80aee16261e5f02d541ed48712feae (patch) | |
tree | 85ee9038f09b7aab4fb1b57cbb444108736f708e /testapp/static | |
parent | 1dd9573cfaa0587cd3217495847a0b456ceb6223 (diff) | |
download | online_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')
-rw-r--r-- | testapp/static/exam/js/add_questionpaper.js | 25 | ||||
-rw-r--r-- | testapp/static/exam/js/add_quiz.js | 8 | ||||
-rw-r--r-- | testapp/static/exam/js/edit_question.js | 13 | ||||
-rw-r--r-- | testapp/static/exam/js/question.js | 27 |
4 files changed, 46 insertions, 27 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"; + } +} diff --git a/testapp/static/exam/js/add_quiz.js b/testapp/static/exam/js/add_quiz.js new file mode 100644 index 0000000..56b0e95 --- /dev/null +++ b/testapp/static/exam/js/add_quiz.js @@ -0,0 +1,8 @@ +function test() +{ + if (document.getElementById("id_description").value != "") + { + alert("reached condition"); + document.getElementById("submit").innerHTML = "Save"; + } +} diff --git a/testapp/static/exam/js/edit_question.js b/testapp/static/exam/js/edit_question.js index 69e0d97..acba384 100644 --- a/testapp/static/exam/js/edit_question.js +++ b/testapp/static/exam/js/edit_question.js @@ -33,6 +33,19 @@ function decrease(frm,n) } } +function grade_data(showHideDiv) +{ + var ele=document.getElementById(showHideDiv); + if (ele.style.display=="block") + { + ele.style.display = "none"; + } + else + { + ele.style.display = "block"; + } +} + function data(showContent,showHideDiv,a,summary) { diff --git a/testapp/static/exam/js/question.js b/testapp/static/exam/js/question.js index 3078c64..ba3f6d2 100644 --- a/testapp/static/exam/js/question.js +++ b/testapp/static/exam/js/question.js @@ -8,33 +8,6 @@ function submitCode() x.value = "Checking Answer ..."; document.getElementById("skip").disabled = true; } - -function secs_to_time(secs) -{ - var h = Math.floor(secs/3600); - var h_s = (h > 0) ? h+'h:' : ''; - var m = Math.floor((secs%3600)/60); - var m_s = (m > 0) ? m+'m:' : ''; - var s_s = Math.floor(secs%60) + 's'; - return h_s + m_s + s_s; -} - -function update_time() -{ - var time_left = document.getElementById("time").value; - time_left -= 1; - if (time_left) - { - var elem = document.getElementById("time_left"); - var t_str = secs_to_time(time_left); - elem.innerHTML = "<strong>" + t_str + "</strong>"; - setTimeout("update_time()", 1000); - } - else - { - document.forms["code"].submit(); - } -} function setSelectionRange(input, selectionStart, selectionEnd) { |