diff options
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/models.py | 26 | ||||
-rw-r--r-- | yaksh/templates/yaksh/add_lesson.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/demo_video.html | 11 |
3 files changed, 32 insertions, 9 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 1e5492c..49a2384 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -208,7 +208,7 @@ def write_templates_to_zip(zipfile, template_path, data, filename, filepath): str(rendered_template)) -def render_template(template_path, data): +def render_template(template_path, data=None): with open(template_path) as f: template_data = f.read() template = Template(template_data) @@ -855,16 +855,28 @@ class Course(models.Model): demo_que_ppr = QuestionPaper() demo_que_ppr.create_demo_quiz_ppr(demo_quiz, user) success = True + file_path = os.sep.join( + (os.path.dirname(__file__), "templates", "yaksh", + "demo_video.html") + ) + rendered_text = render_template(file_path) + lesson_data = "Demo Lesson\n{0}".format(rendered_text) demo_lesson = Lesson.objects.create( - name="Demo lesson", description="demo lesson", - html_data="demo lesson", creator=user) + name="Demo Lesson", description=lesson_data, + html_data=lesson_data, creator=user + ) quiz_unit = LearningUnit.objects.create( - order=1, type="quiz", quiz=demo_quiz) + order=1, type="quiz", quiz=demo_quiz, check_prerequisite=False + ) lesson_unit = LearningUnit.objects.create( - order=2, type="lesson", lesson=demo_lesson) + order=2, type="lesson", lesson=demo_lesson, + check_prerequisite=False + ) learning_module = LearningModule.objects.create( - name="demo module", description="demo module", creator=user, - html_data="demo module") + name="Demo Module", description="<center>Demo Module</center>", + creator=user, html_data="<center>Demo Module</center>", + check_prerequisite=False + ) learning_module.learning_unit.add(quiz_unit) learning_module.learning_unit.add(lesson_unit) course.learning_module.add(learning_module) diff --git a/yaksh/templates/yaksh/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html index ebc3ed7..2f8e733 100644 --- a/yaksh/templates/yaksh/add_lesson.html +++ b/yaksh/templates/yaksh/add_lesson.html @@ -5,11 +5,11 @@ {% block script %} <script src="{{ URL_ROOT }}/static/yaksh/js/lesson.js"></script> -<script src="https://code.jquery.com/ui/1.9.1/jquery-ui.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-ui.js"></script> {% endblock %} {% block css %} -<link rel="stylesheet" href="{{URL_ROOT}}/static/yaksh/css/jquery-ui.css"> +<link rel="stylesheet" href="{{URL_ROOT}}/static/yaksh/css/jquery-ui/jquery-ui.css"> <link rel="stylesheet" href="{{URL_ROOT}}/static/yaksh/css/lesson.css"> {% endblock %} diff --git a/yaksh/templates/yaksh/demo_video.html b/yaksh/templates/yaksh/demo_video.html new file mode 100644 index 0000000..74fd7c8 --- /dev/null +++ b/yaksh/templates/yaksh/demo_video.html @@ -0,0 +1,11 @@ +<br>
+<center>
+<div id="iframe_div">
+ <div style="width: 640px; height: 480px; position: relative;">
+ <iframe id="video_frame" src="https://www.youtube.com/embed/oHmm3mPxg6Y" width="640" height="480" frameborder="0" allowfullscreen>
+ </iframe>
+ <div style="width: 80px; height: 80px; position: absolute; opacity: 0; right: 0px; top: 0px;">
+ </div>
+ </div>
+</div>
+</center>
\ No newline at end of file |