summaryrefslogtreecommitdiff
path: root/yaksh/static
diff options
context:
space:
mode:
authorCruiseDevice2020-04-29 22:11:19 +0530
committerCruiseDevice2020-04-29 22:11:19 +0530
commitf050dd919d5719874aafadf0a674d816a25bc9eb (patch)
treed57fc06ab7b9f5c802ddb4b4394d48c80c34b644 /yaksh/static
parent53a0c4ad3e733f3960000527f83565f2fd8fc412 (diff)
downloadonline_test-f050dd919d5719874aafadf0a674d816a25bc9eb.tar.gz
online_test-f050dd919d5719874aafadf0a674d816a25bc9eb.tar.bz2
online_test-f050dd919d5719874aafadf0a674d816a25bc9eb.zip
Fix: #696
Diffstat (limited to 'yaksh/static')
-rw-r--r--yaksh/static/yaksh/js/add_question.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js
index 6cd8b48..1358710 100644
--- a/yaksh/static/yaksh/js/add_question.js
+++ b/yaksh/static/yaksh/js/add_question.js
@@ -192,3 +192,30 @@ function autosubmit()
}
}
+
+$(document).ready(() => {
+ let option = $('#id_language').val();
+ if(option === 'other') {
+ $('#id_topic').closest('tr').show();
+ } else {
+ $('#id_topic').closest('tr').hide();
+ }
+ $('#id_language').change(function() {
+ let value = $(this).val();
+ if (value === "other") {
+ $('#id_topic').closest('tr').show();
+ $('#id_type').children("option[value='code']").hide();
+ } else {
+ $('#id_topic').closest('tr').hide();
+ $('#id_type').children("option[value='code']").show();
+ }
+ });
+ $('#id_type').change(function() {
+ let value = $(this).val();
+ if (value === "code") {
+ $('#id_language').children("option[value='other']").hide();
+ } else {
+ $('#id_language').children("option[value='other']").show();
+ }
+ })
+}); \ No newline at end of file