diff options
Diffstat (limited to 'yaksh/static/yaksh/js/design_course.js')
-rw-r--r-- | yaksh/static/yaksh/js/design_course.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/yaksh/static/yaksh/js/design_course.js b/yaksh/static/yaksh/js/design_course.js new file mode 100644 index 0000000..2e2f6c9 --- /dev/null +++ b/yaksh/static/yaksh/js/design_course.js @@ -0,0 +1,28 @@ +$(document).ready(function(){ + var checked_vals = []; + $('input:checkbox[name="quiz_lesson"]').click(function() { + if($(this).prop("checked") == true){ + checked_vals.push($(this).val()); + } + else{ + checked_vals.pop($(this).val()); + } + }); + $('#design_course_form').submit(function(eventObj) { + var input_order = $("input[name*='order']"); + var order_list = [] + if (input_order){ + $(input_order).each(function(index) { + order_list.push($(this).data('item-id')+":"+$(this).val()); + }); + } + $(this).append('<input type="hidden" name="choosen_list" value='+checked_vals+'>'); + $(this).append('<input type="hidden" name="ordered_list" value='+order_list+'>'); + return true; + }); + var msg = "If the value is True, Check if Prerequisite is completed. \n" + + "If the value is False, Don't check for Prerequisite. \n" + + "Prerequisite can either be a Quiz or Lesson. \n" + + "Prerequisite is checked according to the order of Quiz or Lesson."; + $("#prereq_msg").attr("title", msg); +});
\ No newline at end of file |