diff options
author | mahesh | 2017-03-21 16:38:31 +0530 |
---|---|---|
committer | mahesh | 2017-03-21 16:38:31 +0530 |
commit | 72061d5f4ceae8e848a1fb12ab245be93db75435 (patch) | |
tree | 0cee9facaa3cd8d7701eff36de044ceac960acfe /yaksh/static | |
parent | 977399542df00349cc87917191af343226c44596 (diff) | |
parent | 49a4cbac480f8a9e3fafcd50e6ce2fa41a5d8699 (diff) | |
download | online_test-72061d5f4ceae8e848a1fb12ab245be93db75435.tar.gz online_test-72061d5f4ceae8e848a1fb12ab245be93db75435.tar.bz2 online_test-72061d5f4ceae8e848a1fb12ab245be93db75435.zip |
rebase changes for simple question types
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/js/add_question.js | 36 | ||||
-rw-r--r-- | yaksh/static/yaksh/js/question_paper_creation.js | 14 |
2 files changed, 41 insertions, 9 deletions
diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js index 8ca22eb..05752b4 100644 --- a/yaksh/static/yaksh/js/add_question.js +++ b/yaksh/static/yaksh/js/add_question.js @@ -111,16 +111,34 @@ function textareaformat() }); - $('#id_type').bind('focus', function(event){ - var type = document.getElementById('id_type'); - type.style.border = '1px solid #ccc'; - }); + $('#id_type').bind('focus', function(event){ + var type = document.getElementById('id_type'); + type.style.border = '1px solid #ccc'; + }); + + $('#id_language').bind('focus', function(event){ + var language = document.getElementById('id_language'); + language.style.border = '1px solid #ccc'; + }); + document.getElementById('my').innerHTML = document.getElementById('id_description').value ; - $('#id_language').bind('focus', function(event){ - var language = document.getElementById('id_language'); - language.style.border = '1px solid #ccc'; - }); - document.getElementById('my').innerHTML = document.getElementById('id_description').value ; + + if (document.getElementById('id_grade_assignment_upload').checked || + document.getElementById('id_type').val() == 'upload'){ + $("#id_grade_assignment_upload").prop("disabled", false); + } + else{ + $("#id_grade_assignment_upload").prop("disabled", true); + } + + $('#id_type').change(function() { + if ($(this).val() == "upload"){ + $("#id_grade_assignment_upload").prop("disabled", false); + } + else{ + $("#id_grade_assignment_upload").prop("disabled", true); + } + }); } function autosubmit() diff --git a/yaksh/static/yaksh/js/question_paper_creation.js b/yaksh/static/yaksh/js/question_paper_creation.js index 898e491..430ec4b 100644 --- a/yaksh/static/yaksh/js/question_paper_creation.js +++ b/yaksh/static/yaksh/js/question_paper_creation.js @@ -46,4 +46,18 @@ $(document).ready(function(){ $("#random").click(); }); + var checked_vals = []; + $('input:checkbox[name="questions"]').click(function() { + if($(this).prop("checked") == true){ + checked_vals.push(parseInt($(this).val())); + } + else{ + checked_vals.pop(parseInt($(this).val())); + } + }); + $('#design_q').submit(function(eventObj) { + $(this).append('<input type="hidden" name="checked_ques" value='+checked_vals+'>'); + return true; +}); + });//document |