diff options
author | mahesh | 2018-01-19 13:13:25 +0530 |
---|---|---|
committer | maheshgudi | 2018-03-16 15:15:50 +0530 |
commit | 1f06442fba1420e03f54604bffe8029bb098169c (patch) | |
tree | 7721d023ad314c4b96a65f170a9ce5520961c9d6 /yaksh | |
parent | 03e74a964504e98cb0f01678ce12a626581a406b (diff) | |
download | online_test-1f06442fba1420e03f54604bffe8029bb098169c.tar.gz online_test-1f06442fba1420e03f54604bffe8029bb098169c.tar.bz2 online_test-1f06442fba1420e03f54604bffe8029bb098169c.zip |
Disable/enable shuffle testcase option based on question type
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/static/yaksh/js/add_question.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js index 346991a..579904b 100644 --- a/yaksh/static/yaksh/js/add_question.js +++ b/yaksh/static/yaksh/js/add_question.js @@ -126,8 +126,9 @@ function textareaformat() document.getElementById('my').innerHTML = document.getElementById('id_description').value ; document.getElementById('rend_solution').innerHTML = document.getElementById('id_solution').value ; + var question_type = document.getElementById('id_type').value if (document.getElementById('id_grade_assignment_upload').checked || - document.getElementById('id_type').value == 'upload'){ + question_type == 'upload'){ $("#id_grade_assignment_upload").prop("disabled", false); } else{ @@ -142,6 +143,23 @@ function textareaformat() $("#id_grade_assignment_upload").prop("disabled", true); } }); + + if (document.getElementById('id_shuffle_testcases').checked || + question_type == "mcc" || question_type == "mcq"){ + $("#id_shuffle_testcases").prop("disabled", false); + } + else{ + $("#id_shuffle_testcases").prop("disabled", true); + } + + $('#id_type').change(function() { + if ($(this).val() == "mcc" || $(this).val() == "mcq"){ + $("#id_shuffle_testcases").prop("disabled", false); + } + else{ + $("#id_shuffle_testcases").prop("disabled", true); + } + }); } function autosubmit() |