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 @@
-
+
diff --git a/yaksh/templates/yaksh/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html
index 01233fa..d9bc1e7 100644
--- a/yaksh/templates/yaksh/add_lesson.html
+++ b/yaksh/templates/yaksh/add_lesson.html
@@ -48,7 +48,11 @@
{% endif %}
+ {% if course_id %}
+ {% else %}
+
+ {% endif %}
diff --git a/yaksh/templates/yaksh/add_module.html b/yaksh/templates/yaksh/add_module.html
index 9ce854e..4efccf7 100644
--- a/yaksh/templates/yaksh/add_module.html
+++ b/yaksh/templates/yaksh/add_module.html
@@ -7,12 +7,12 @@
-
+
{% endblock %}
{% block css %}
-
+
{% endblock %}
{% block content %}
@@ -86,7 +86,7 @@
-
@@ -99,15 +99,24 @@
- Select |
+ Select |
Quiz/Lesson |
- Order |
- Check Prerequisite
+ | Order |
+ Check Prerequisite
+
What's This
|
+
+
+ |
+ |
+ |
+ Currently |
+ Change |
+
{% for unit in learning_units %}
@@ -125,8 +134,14 @@
|
{% endif %}
-
- {{unit.check_prerequisite}}
+ {% if unit.check_prerequisite %}
+ Yes
+ {% else %}
+ No
+ {% endif %}
+ |
+
+
|
@@ -136,9 +151,9 @@
- Remove from Module
- Change Order
- Change Prerequisite
+ Remove from Module
+ Change Order
+ Change Prerequisite
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
index 3d26d14..0efa72a 100644
--- a/yaksh/templates/yaksh/courses.html
+++ b/yaksh/templates/yaksh/courses.html
@@ -29,7 +29,7 @@
-
+
+{% if type == "courses" %}
{% if not courses %}
No new Courses created
@@ -60,7 +61,7 @@
Courses |
- Lessons/Quizzes |
+ Modules |
{% for course in courses %}
@@ -97,6 +98,11 @@
+ -
+ Design Course
+
+
+
-
Edit Course
@@ -110,11 +116,6 @@
Add Teacher
- -
- Design Course Session
-
-
-
-
{% if course.active %}Deactivate Course {% else %} Activate Course {% endif %}
@@ -131,8 +132,8 @@
{% if course.get_learning_modules %}
- Learning Modules |
- Design Learning module |
+ Module |
+ Module Design |
Lessons/Quizzes |
{% for module in course.get_learning_modules %}
@@ -186,7 +187,7 @@
Courses |
- Lessons/Quizzes |
+ Modules |
{% for course in allotted_courses %}
@@ -227,6 +228,11 @@
+ -
+ Design Course
+
+
+
-
Edit Course
@@ -257,8 +263,9 @@
{% if course.get_learning_modules %}
- Learning Modules |
- Design Learning module |
+ Module |
+ Module Design |
+ Lessons/Quizzes |
{% for module in course.get_learning_modules %}
@@ -271,6 +278,21 @@
Add Quizzes/Lessons for {{module.name}}
+
+ {% for unit in module.get_learning_units %}
+
+ {% endfor %}
+ |
{% endfor %}
{% else %}
@@ -284,7 +306,8 @@
{% endif %}
-
+{% endif %}
+
@@ -308,7 +331,8 @@
{{forloop.counter}} |
- {{ quiz.description }}
+ {{ quiz.description }}
+
{% if quiz.active %}
Active
{% else %}
diff --git a/yaksh/templates/yaksh/design_course_session.html b/yaksh/templates/yaksh/design_course_session.html
index 41c235c..1aabd6c 100644
--- a/yaksh/templates/yaksh/design_course_session.html
+++ b/yaksh/templates/yaksh/design_course_session.html
@@ -58,26 +58,34 @@
- Add to course
+ Add to course
- Choosen Lessons and quizzes: (Change Order)
+ Choosen Lessons and quizzes:
- Select |
+ Select |
Learning Module |
- Order |
- Check Prerequisite
+ | Order |
+ Check Prerequisite
+
What's This
|
+
+ |
+ |
+ |
+ Currently |
+ Change |
+
{% for module in added_learning_modules %}
@@ -99,9 +114,9 @@
- Remove from course
- Change Order
- Change Prerequisite
+ Remove from course
+ Change Order
+ Change Prerequisite
diff --git a/yaksh/views.py b/yaksh/views.py
index f9a43ba..295b983 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -337,8 +337,10 @@ def prof_manage(request, msg=None):
rights/permissions and log in."""
user = request.user
ci = RequestContext(request)
- if not user.is_authenticated() and not is_moderator(user):
- return my_redirect('/exam/login/')
+ if not user.is_authenticated():
+ return my_redirect('/exam/login')
+ if not is_moderator(user):
+ return my_redirect('/exam/')
courses = Course.objects.filter(creator=user, is_trial=False)
trial_paper = AnswerPaper.objects.filter(
@@ -467,7 +469,7 @@ def start(request, questionpaper_id=None, attempt_num=None, course_id=None,
)
# allowed to start
if not quest_paper.can_attempt_now(user, course_id):
- msg = "You cannot attempt {0} quiz more than {1} times".format(
+ msg = "You cannot attempt {0} quiz more than {1} time(s)".format(
quest_paper.quiz.description, quest_paper.quiz.attempts_allowed)
if is_moderator(user):
return prof_manage(request, msg=msg)
--
cgit
|