diff options
author | adityacp | 2020-11-18 15:35:03 +0530 |
---|---|---|
committer | adityacp | 2020-11-18 15:35:03 +0530 |
commit | a149bf483fe724deb6427cad781279bef28da9fe (patch) | |
tree | 39de4e7389d9857df2af885d3e7decbd8eac05e4 /yaksh/static | |
parent | eda9184c193f3a6779b834ace796efbb6dad8b7b (diff) | |
download | online_test-a149bf483fe724deb6427cad781279bef28da9fe.tar.gz online_test-a149bf483fe724deb6427cad781279bef28da9fe.tar.bz2 online_test-a149bf483fe724deb6427cad781279bef28da9fe.zip |
Add dropdown selection for lesson video options
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/js/add_question.js | 7 | ||||
-rw-r--r-- | yaksh/static/yaksh/js/lesson.js | 19 |
2 files changed, 19 insertions, 7 deletions
diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js index 479e8da..d5a6121 100644 --- a/yaksh/static/yaksh/js/add_question.js +++ b/yaksh/static/yaksh/js/add_question.js @@ -220,11 +220,4 @@ $(document).ready(() => { $('#id_language').children("option[value='other']").show(); } }) - $('#add_more').click(function() { - var form_idx = $(tc_type).val(); - $('#form_set').append($('#empty_form').html().replace(/__prefix__/g, form_idx)); - $(tc_type).val(parseInt(form_idx) + 1); - var form_type = "#id_"+'{{tc_class}}'+"_set-"+form_idx+"-type"; - $(form_type).val($("#id_"+'{{tc_class}}'+"_set-0-type").val()); - }); });
\ No newline at end of file diff --git a/yaksh/static/yaksh/js/lesson.js b/yaksh/static/yaksh/js/lesson.js index 64ac4da..d562197 100644 --- a/yaksh/static/yaksh/js/lesson.js +++ b/yaksh/static/yaksh/js/lesson.js @@ -16,6 +16,25 @@ $(document).ready(function() { } ); }); + var completion_msg = "Add Youtube and Vimeo video ID, for Others add "+ + "video file url e.g https://example.com/video.mp4" + $("#video_msg").attr("title", completion_msg); + $("#video_msg").tooltip(); + $("#submit-lesson").click(function() { + var video_option = $("#id_video_option").val(); + var video_url = $("#id_video_url").val(); + if(video_option != "---") { + if(!video_url.trim()) { + $('#id_video_url').prop('required', true); + } + else { + $("#id_video_path").val("{'"+video_option+"': '"+video_url+"'}"); + } + } else { + $('#id_video_url').prop('required', false); + $("#id_video_path").val(null); + } + }); const player = new Plyr('#player'); var timer = $("#vtimer"); var totalSeconds; |