From de0f0be2f5963da2f03616c192dfe339c021eff6 Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 2 Jan 2018 15:51:36 +0530 Subject: Changes in views, models, templates and js - Rename learning_type to type in Lesson model - Change error message in views and change redirection - Change templates to rename learning_type to type for unit - Add new dialog for embedding Video URL --- yaksh/models.py | 13 ++++-- yaksh/static/yaksh/js/design_course.js | 6 +-- yaksh/static/yaksh/js/lesson.js | 4 +- yaksh/templates/manage.html | 2 +- yaksh/templates/user.html | 4 +- yaksh/templates/yaksh/add_lesson.html | 4 ++ yaksh/templates/yaksh/add_module.html | 37 +++++++++++----- yaksh/templates/yaksh/courses.html | 56 +++++++++++++++++------- yaksh/templates/yaksh/design_course_session.html | 33 ++++++++++---- yaksh/views.py | 8 ++-- 10 files changed, 116 insertions(+), 51 deletions(-) diff --git a/yaksh/models.py b/yaksh/models.py index 7ed87fe..5eca3d1 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -609,11 +609,18 @@ class Course(models.Model): demo_que_ppr = QuestionPaper() demo_que_ppr.create_demo_quiz_ppr(demo_quiz, user) success = True - ordered_unit = LearningUnit.objects.create( + demo_lesson = Lesson.objects.create( + name="Demo lesson", description="demo lesson", + html_data="demo lesson", creator=user) + quiz_unit = LearningUnit.objects.create( order=1, type="quiz", quiz=demo_quiz) + lesson_unit = LearningUnit.objects.create( + order=2, type="lesson", lesson=demo_lesson) learning_module = LearningModule.objects.create( - name="demo module", description="demo module", creator=user) - learning_module.learning_unit.add(ordered_unit) + name="demo module", description="demo module", creator=user, + html_data="demo module") + learning_module.learning_unit.add(quiz_unit) + learning_module.learning_unit.add(lesson_unit) course.learning_module.add(learning_module) else: success = False diff --git a/yaksh/static/yaksh/js/design_course.js b/yaksh/static/yaksh/js/design_course.js index 2e2f6c9..7b01491 100644 --- a/yaksh/static/yaksh/js/design_course.js +++ b/yaksh/static/yaksh/js/design_course.js @@ -20,9 +20,7 @@ $(document).ready(function(){ $(this).append(''); 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."; + var msg = "Check Prerequisite is set to Yes by default \n" + + "To change, select the Change checkbox and Click Change Prerequisite button \n"; $("#prereq_msg").attr("title", msg); }); \ No newline at end of file diff --git a/yaksh/static/yaksh/js/lesson.js b/yaksh/static/yaksh/js/lesson.js index 82552b0..6f873b9 100644 --- a/yaksh/static/yaksh/js/lesson.js +++ b/yaksh/static/yaksh/js/lesson.js @@ -42,8 +42,8 @@ $(document).ready(function(){ } $("#embed").click(function() { - $("#dialog").toggle(); - $("#dialog").dialog({ + $("#dialog_iframe").toggle(); + $("#dialog_iframe").dialog({ resizable: false, height: '300', width: '450' diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html index 9aa0a54..17ce23e 100644 --- a/yaksh/templates/manage.html +++ b/yaksh/templates/manage.html @@ -39,7 +39,7 @@ -