From 3bbaff2ebca026042cce3deb025effb9e83e0859 Mon Sep 17 00:00:00 2001 From: adityacp Date: Wed, 28 Feb 2018 16:54:22 +0530 Subject: Change forms.py, models.py, test_models.py and templates - Add help text for timezone field in user registration form - Add new method in course model to get days remaining to start a course - Show start time and end time of a course to the students - Disallow to enroll to a course which is not active - Add model test for the new course method --- yaksh/templates/yaksh/course_modules.html | 166 +++++++++++++++--------------- yaksh/templates/yaksh/quizzes_user.html | 35 +++++-- yaksh/templates/yaksh/view_profile.html | 4 + 3 files changed, 113 insertions(+), 92 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/course_modules.html b/yaksh/templates/yaksh/course_modules.html index fad1be0..afbae75 100644 --- a/yaksh/templates/yaksh/course_modules.html +++ b/yaksh/templates/yaksh/course_modules.html @@ -18,102 +18,100 @@ {% endif %} {% if learning_modules %} - {% for module in learning_modules %} -
- - - - - - -
- - {{module.name|title}} - - - - - - View Lessons/Quizzes/Exercises - - {% get_module_status user module course as module_status %} - Status: - {% if module_status == "completed" %} - - {{module_status|title}} - - {% elif module_status == "inprogress" %} - - {{module_status|title}} - - {% else %} - - {{module_status|title}} - - {% endif %} -
-
-
- - - - - - - - {% for unit in module.get_learning_units %} +
Lesson/Quiz/ExerciseStatusTypeView AnswerPaper
+ {% for module in learning_modules %} - - - - {% endfor %} -
- {% if unit.type == "quiz" %} - {{unit.quiz.description}} - {% else %} - {{unit.lesson.name}} - {% endif %} + + {{module.name|title}} - {% get_unit_status course module unit user as status %} - {% if status == "completed" %} - {{status|title}} + - {% elif status == "inprogress" %} - {{status|title}} + - {% else %} - {{status|title}} - - {% endif %} - - {% if unit.type == "quiz" %} - {% if unit.quiz.is_exercise %} - Exercise - {% else %} - Quiz - {% endif %} - {% else %} - Lesson - {% endif %} + + View Lessons/Quizzes/Exercises +
+ + + + + + + + {% for unit in module.get_learning_units %} + + + + + + + {% endfor %} +
Lesson/Quiz/ExerciseStatusTypeView AnswerPaper
+ {% if unit.type == "quiz" %} + {{unit.quiz.description}} + {% else %} + {{unit.lesson.name}} + {% endif %} + + {% get_unit_status course module unit user as status %} + {% if status == "completed" %} + {{status|title}} + + {% elif status == "inprogress" %} + {{status|title}} + + {% else %} + {{status|title}} + + {% endif %} + + {% if unit.type == "quiz" %} + {% if unit.quiz.is_exercise %} + Exercise + {% else %} + Quiz + {% endif %} + {% else %} + Lesson + {% endif %} + + {% if unit.type == "quiz" %} + {% if unit.quiz.view_answerpaper %} + + Can View + {% else %} + + Cannot view now + {% endif %} + {% else %} + ------ + {% endif %} +
+
- {% if unit.type == "quiz" %} - {% if unit.quiz.view_answerpaper %} - Can View + {% get_module_status user module course as module_status %} + Status: + {% if module_status == "completed" %} + + {{module_status|title}} + + {% elif module_status == "inprogress" %} + + {{module_status|title}} + {% else %} - - Cannot view now + + {{module_status|title}} + {% endif %} - {% else %} - ------ - {% endif %}
-
- {% endfor %} + {% endfor %} + {% else %}

No lectures found

{% endif %} diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index cf08752..05af528 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -39,25 +39,44 @@ No Courses to display
- {% if not course.active %} - Closed - {% endif %} {% if user in course.requests.all %} Request Pending {% elif user in course.rejected.all %}Request Rejected {% elif user in course.students.all %}Enrolled {% else %} - {% if course.is_active_enrollment %} - {% if course.is_self_enroll %} - Enroll + {% if course.active %} + {% if course.is_active_enrollment %} + {% if course.is_self_enroll %} + Enroll + {% else %} + Enroll + {% endif %} {% else %} - Enroll + + Enrollment Closed + {% endif %} {% else %} - Enrollment Closed + + Course is not activated + {% endif %} {% endif %}
+
+ {% if course.days_remain_to_start != 0 %} + + {{course.days_remain_to_start}} day(s) to start + + {% endif %} +
+ {% if course.is_active_enrollment %} +
+ Start Date : {{course.start_enroll_time}} +
+ End Date  : {{course.end_enroll_time}} +
+ {% endif %} {% if course.instructions %}
diff --git a/yaksh/templates/yaksh/view_profile.html b/yaksh/templates/yaksh/view_profile.html index 5f06135..ce95226 100644 --- a/yaksh/templates/yaksh/view_profile.html +++ b/yaksh/templates/yaksh/view_profile.html @@ -31,6 +31,10 @@ + + + + Edit Profile {% endblock %} -- cgit From b0df46ec36a043d3c51014cf5746d7def9cb17b9 Mon Sep 17 00:00:00 2001 From: adityacp Date: Thu, 8 Mar 2018 14:34:17 +0530 Subject: Change model method name in course model --- yaksh/templates/yaksh/quizzes_user.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index 05af528..49f8d2d 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -63,9 +63,9 @@ No Courses to display {% endif %}
- {% if course.days_remain_to_start != 0 %} + {% if course.days_before_start != 0 %} - {{course.days_remain_to_start}} day(s) to start + {{course.days_before_start}} day(s) to start {% endif %}
-- cgit