diff options
author | adityacp | 2020-08-28 10:52:51 +0530 |
---|---|---|
committer | adityacp | 2020-08-28 10:52:51 +0530 |
commit | 620df8d25a82ceb99eb7cd17535c20998e212191 (patch) | |
tree | 8202f64768c4589afba97094c6ccf966750d310d /yaksh/static | |
parent | ebe75b31c225eaa71d6963b8ac493e37a63efb50 (diff) | |
parent | 574e92a8586d4fc900be2c0d8f5114c93e826358 (diff) | |
download | online_test-620df8d25a82ceb99eb7cd17535c20998e212191.tar.gz online_test-620df8d25a82ceb99eb7cd17535c20998e212191.tar.bz2 online_test-620df8d25a82ceb99eb7cd17535c20998e212191.zip |
Merge branch 'master' of https://github.com/FOSSEE/online_test into multiple_fixes
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/js/question_paper_creation.js | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/yaksh/static/yaksh/js/question_paper_creation.js b/yaksh/static/yaksh/js/question_paper_creation.js index 9d04728..871d6cc 100644 --- a/yaksh/static/yaksh/js/question_paper_creation.js +++ b/yaksh/static/yaksh/js/question_paper_creation.js @@ -57,7 +57,38 @@ $(document).ready(function(){ $('#design_q').submit(function(eventObj) { $(this).append('<input type="hidden" name="checked_ques" value='+checked_vals+'>'); return true; -}); + }); + + $('#add_checkall').change(function () { + if($(this).prop("checked")) { + $("#fixed-available input:checkbox").each(function(index, element) { + if(isNaN($(this).val())) {return}; + $(this).prop("checked", true); + checked_vals.push(parseInt($(this).val())) + }); + } else { + $("#fixed-available input:checkbox").each(function(index, element){ + $(this).prop('checked', false); + checked_vals.pop(parseInt($(this).val())); + }); + } + }); + + $('#remove_checkall').change(function () { + if($(this).prop("checked")) { + $("#fixed-added input:checkbox").each(function (index, element) { + if(isNaN($(this).val())) { return }; + $(this).prop('checked', true); + checked_vals.push(parseInt($(this).val())); + }); + } else { + $("#fixed-added input:checkbox").each(function (index, element) { + console.log('unchecked'); + $(this).prop('checked', false); + checked_vals.pop(parseInt($(this).val())); + }); + } + }); });//document function append_tag(tag){ @@ -69,3 +100,4 @@ function append_tag(tag){ tag_name.value = tag.value; } } + |