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 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'yaksh/models.py') 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 -- cgit