diff options
author | adityacp | 2018-01-02 15:51:36 +0530 |
---|---|---|
committer | adityacp | 2018-01-02 15:51:36 +0530 |
commit | de0f0be2f5963da2f03616c192dfe339c021eff6 (patch) | |
tree | fafaac934e42e5f877257c6a9700074f7bff8822 /yaksh/models.py | |
parent | 8a062d48a0347ae43b1b9d5b1ca532387d8ad3d9 (diff) | |
download | online_test-de0f0be2f5963da2f03616c192dfe339c021eff6.tar.gz online_test-de0f0be2f5963da2f03616c192dfe339c021eff6.tar.bz2 online_test-de0f0be2f5963da2f03616c192dfe339c021eff6.zip |
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
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 13 |
1 files changed, 10 insertions, 3 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 |