diff --git a/lms/plugins.py b/lms/plugins.py index cc4fb359..cecef2f1 100644 --- a/lms/plugins.py +++ b/lms/plugins.py @@ -15,6 +15,7 @@ be loaded in a webpage. """ import frappe +from urllib.parse import quote class PageExtension: @@ -138,7 +139,9 @@ def youtube_video_renderer(video_id): def video_renderer(src): - return f"" + return ( + f"" + ) def assignment_renderer(detail): diff --git a/lms/www/batch/edit.js b/lms/www/batch/edit.js index 306b9580..2e9145a1 100644 --- a/lms/www/batch/edit.js +++ b/lms/www/batch/edit.js @@ -263,6 +263,10 @@ class YouTubeVideo { `; } + validate(savedData) { + return !savedData.youtube || !savedData.youtube.trim() ? false : true; + } + save(block_content) { return { youtube: this.data.youtube || this.youtube, @@ -329,6 +333,10 @@ class Quiz { `; } + validate(savedData) { + return !savedData.quiz || !savedData.quiz.trim() ? false : true; + } + save(block_content) { return { quiz: this.data.quiz || this.quiz, @@ -385,6 +393,10 @@ class Upload { } } + validate(savedData) { + return !savedData.file_url || !savedData.file_url.trim() ? false : true; + } + save(block_content) { return { file_url: this.data.file_url || this.file_url,