summaryrefslogtreecommitdiff
path: root/yaksh/static
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/static')
-rw-r--r--yaksh/static/yaksh/js/add_course.js16
-rw-r--r--yaksh/static/yaksh/js/add_grades.js14
-rw-r--r--yaksh/static/yaksh/js/add_question.js7
-rw-r--r--yaksh/static/yaksh/js/add_quiz.js13
-rw-r--r--yaksh/static/yaksh/js/lesson.js19
5 files changed, 61 insertions, 8 deletions
diff --git a/yaksh/static/yaksh/js/add_course.js b/yaksh/static/yaksh/js/add_course.js
new file mode 100644
index 0000000..0fba2e9
--- /dev/null
+++ b/yaksh/static/yaksh/js/add_course.js
@@ -0,0 +1,16 @@
+$(document).ready(function () {
+ $(function() {
+ tinymce.init({
+ selector: 'textarea#id_instructions',
+ setup : function(ed) {
+ ed.on('change', function(e) {
+ tinymce.triggerSave();
+ });
+ },
+ max_height: 400,
+ height: 400,
+ plugins: "image code link",
+ convert_urls: false
+ });
+ });
+});
diff --git a/yaksh/static/yaksh/js/add_grades.js b/yaksh/static/yaksh/js/add_grades.js
new file mode 100644
index 0000000..151fef1
--- /dev/null
+++ b/yaksh/static/yaksh/js/add_grades.js
@@ -0,0 +1,14 @@
+$(function() {
+ tinymce.init({
+ selector: 'textarea#id_description',
+ setup : function(ed) {
+ ed.on('change', function(e) {
+ tinymce.triggerSave();
+ });
+ },
+ max_height: 400,
+ height: 400,
+ plugins: "image code link",
+ convert_urls: false
+ });
+ });
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/add_quiz.js b/yaksh/static/yaksh/js/add_quiz.js
index dab5a3d..38a9dc8 100644
--- a/yaksh/static/yaksh/js/add_quiz.js
+++ b/yaksh/static/yaksh/js/add_quiz.js
@@ -1,6 +1,5 @@
function test()
{
-
document.getElementById('id_duration').setAttribute('class','mini-text form-control');
document.getElementById('id_pass_criteria').setAttribute('class','mini-text form-control');
if (document.getElementById("id_description").value != "")
@@ -13,6 +12,18 @@ function test()
document.getElementById('rendered_text').innerHTML = document.getElementById('id_instructions').value ;
});
document.getElementById('rendered_text').innerHTML = document.getElementById('id_instructions').value ;
+ tinymce.init({
+ selector: 'textarea#id_instructions',
+ setup : function(ed) {
+ ed.on('change', function(e) {
+ tinymce.triggerSave();
+ });
+ },
+ max_height: 400,
+ height: 400,
+ plugins: "image code link",
+ convert_urls: false
+ });
}
String.prototype.beginsWith = function (string) {
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;