diff options
author | adityacp | 2017-11-22 12:02:49 +0530 |
---|---|---|
committer | adityacp | 2017-11-22 12:02:49 +0530 |
commit | acce9174639224234325c007f30d5679712e4c2c (patch) | |
tree | ea3e8a7e83b9964f9c289f63a7f54ca1243fdfe7 /yaksh/templates | |
parent | 8e5354fb2fdab96780bfd147ba5b1724eebd673b (diff) | |
download | online_test-acce9174639224234325c007f30d5679712e4c2c.tar.gz online_test-acce9174639224234325c007f30d5679712e4c2c.tar.bz2 online_test-acce9174639224234325c007f30d5679712e4c2c.zip |
Change forms.py, models.py, views.py, templates, templatetags
- Add start_time, end_time enrollement in course form
- Change get_quiz_details in course model
- Add validation to check if course is active and not expired
- Template changes for cleaner dashboard
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/add_course.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/complete.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/courses.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/moderator_dashboard.html | 51 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 23 | ||||
-rw-r--r-- | yaksh/templates/yaksh/quizzes_user.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_video.html | 25 |
7 files changed, 58 insertions, 51 deletions
diff --git a/yaksh/templates/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html index 904cf5f..47a637d 100644 --- a/yaksh/templates/yaksh/add_course.html +++ b/yaksh/templates/yaksh/add_course.html @@ -15,7 +15,7 @@ <form name=frm id=frm action="" method="post" > {% csrf_token %} <center> - <table class=span1> + <table class="table table-bordered"> {{ form.as_table }} </table> <br/> @@ -25,7 +25,7 @@ </script> </center> - <center><button class="btn primary" type="submit" id="submit" name="questionpaper">Add Course</button> + <center><button class="btn primary" type="submit" id="submit" name="questionpaper">Save</button> <button class="btn primary" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses");'>Cancel</button> </center> </form> {% endblock %} diff --git a/yaksh/templates/yaksh/complete.html b/yaksh/templates/yaksh/complete.html index 242b6da..c99b8f0 100644 --- a/yaksh/templates/yaksh/complete.html +++ b/yaksh/templates/yaksh/complete.html @@ -36,7 +36,7 @@ <br><center><h4>You may now close the browser.</h4></center><br> {% endif %} <a href="{{URL_ROOT}}/exam/" id="home" class="btn btn-success"> Home </a> - {% if module_id %} + {% if module_id and not user == "moderator" %} {% if first_unit %} <a href="{{URL_ROOT}}/exam/next_unit/{{course_id}}/{{module_id}}/{{learning_unit.id}}/1" class="btn btn-info"> Next Unit <span class="glyphicon glyphicon-chevron-right"> diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html index 50c845b..5daf944 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -66,7 +66,7 @@ {% for course in courses %} <tr> <td width="30%"> - <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }} + <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}">{{ course.name }} </a> {% if course.active %} <span class="label label-success">Active</span> diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html index 490ec83..17a4924 100644 --- a/yaksh/templates/yaksh/moderator_dashboard.html +++ b/yaksh/templates/yaksh/moderator_dashboard.html @@ -1,4 +1,5 @@ {% extends "manage.html" %} +{% load custom_filters %} {% block pagetitle %} Moderator's Dashboard {% endblock pagetitle %} {% block script %} @@ -9,27 +10,43 @@ <center><h4>List of quizzes! Click on the given links to have a look at answer papers for a quiz.</h4></center> <table class="table table-bordered"> - <th>Course</th> - <th>Quiz</th> - <th>Taken By</th> - <th>No. of users Passed</th> - <th>No. of users Failed</th> - {% for course, quiz, answer_papers, users_passed, users_failed in users_per_paper %} + <th>Courses</th> + <th>Quizzes</th> + {% for course in courses %} <tr> <td> + <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}"> {{ course }} + </a> </td> <td> - <a href="{{URL_ROOT}}/exam/manage/monitor/{{ quiz.id }}/{{course.id}}">{{ quiz.description }}</a> - </td> - <td> - {{ answer_papers }} user(s) - </td> - <td> - {{ users_passed }} - </td> - <td> - {{ users_failed }} + {% get_course_details course as course_details %} + {% if course_details %} + <table class="table table-bordered"> + <th>Quiz</th> + <th>Taken By</th> + <th>No. of users Passed</th> + <th>No. of users Failed</th> + {% for quiz, users_no, passed, failed in course_details %} + <tr> + <td> + <a href="{{URL_ROOT}}/exam/manage/monitor/{{ quiz.id }}/{{course.id}}">{{ quiz.description }}</a> + </td> + <td> + {{users_no}} user(s) + </td> + <td> + {{passed}} + </td> + <td> + {{failed}} + </td> + </tr> + {% endfor %} + </table> + {% else %} + No Quizzes + {% endif %} </td> </tr> {% endfor %} @@ -47,7 +64,7 @@ <span class="glyphicon glyphicon-question-sign"></span> What's This </a> <div id="help" class="collapse"> - <ul> + <ul class="list"> <li>A Demo Course and Demo Quiz will be created (Click Courses link on nav bar to view courses).</li> <li>Some Demo Questions are also created for you (Click Questions link on nav bar to view questions).</li> <li>In Courses you can view Demo Quiz.</li> diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index eab3289..12f5da6 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -110,23 +110,18 @@ module_id = "{{module.id}}" {% endif %} {% if unit.learning_type == "quiz" %} - {% if status == "completed" %} - <a href="{{ URL_ROOT }}/exam/start/{{unit.quiz.questionpaper_set.get.id}}/{{learning_module.id}}/{{course.id}}"> + <a href="{{ URL_ROOT }}/exam/start/{{unit.quiz.questionpaper_set.get.id}}/{{learning_module.id}}/{{course.id}}"> {{ unit.quiz.description }} - </a> - <span class="glyphicon glyphicon-ok" style="color: #7CFC00;"></span> - {% else %} - {{ unit.quiz.description }} - {% endif %} + </a> {% else %} - {% if status == "completed" %} - <a href="{{ URL_ROOT }}/exam/show_video/{{unit.lesson.id}}/{{learning_module.id}}/{{course.id}}"> + <a href="{{ URL_ROOT }}/exam/show_video/{{unit.lesson.id}}/{{learning_module.id}}/{{course.id}}"> {{ unit.lesson.name }} - </a> - <span class="glyphicon glyphicon-ok" style="color: #7CFC00;"></span> - {% else %} - {{ unit.lesson.name }} - {% endif %} + </a> +{% endif %} +{% if status == "completed" %} + <span class="glyphicon glyphicon-ok" style="color: #7CFC00;"></span> +{% else %} + <span class="glyphicon glyphicon-remove" style="color: #FF0000"></span> {% endif %} </li> </span> diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index d564a8f..3c4b985 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -5,7 +5,7 @@ {% block main %} {% if msg %} <div class="alert alert-warning" role="alert"> - {{ msg }} + <center>{{ msg }}</center> </div> {% endif %} {% if 'Enrolled Courses' not in title%} diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html index fa80ddb..ffb0c68 100644 --- a/yaksh/templates/yaksh/show_video.html +++ b/yaksh/templates/yaksh/show_video.html @@ -15,27 +15,22 @@ {% get_unit_status course learning_module unit user as status %} {% if unit.id == current_unit.id %} - <span class="glyphicon glyphicon-pencil" data-toggle="tooltip" title="Current Unit"> + <span class="glyphicon glyphicon-pencil" data-toggle="tooltip" title="Currently on"> </span> {% endif %} {% if unit.learning_type == "quiz" %} - {% if status == "completed" %} - <a href="{{ URL_ROOT }}/exam/start/{{unit.quiz.questionpaper_set.get.id}}/{{learning_module.id}}/{{course.id}}"> - {{ unit.quiz.description }} - </a> - <span class="glyphicon glyphicon-ok" style="color: #7CFC00;"></span> - {% else %} + <a href="{{ URL_ROOT }}/exam/start/{{unit.quiz.questionpaper_set.get.id}}/{{learning_module.id}}/{{course.id}}"> {{ unit.quiz.description }} - {% endif %} + </a> {% else %} - {% if status == "completed" %} <a href="{{ URL_ROOT }}/exam/show_video/{{unit.lesson.id}}/{{learning_module.id}}/{{course.id}}"> {{ unit.lesson.name }} </a> - <span class="glyphicon glyphicon-ok" style="color: #7CFC00;"></span> - {% else %} - {{ unit.lesson.name }} - {% endif %} +{% endif %} +{% if status == "completed" %} + <span class="glyphicon glyphicon-ok" style="color: #7CFC00;"></span> +{% else %} + <span class="glyphicon glyphicon-remove" style="color: #FF0000"></span> {% endif %} </li> </span> @@ -57,7 +52,7 @@ </div> </div> <div style="text-align: center;"> - <a href="{{ URL_ROOT }}/exam/next_unit/{{course.id}}/{{learning_module.id}}/{{first_unit.id}}/1" class="btn btn-primary">Next Unit + <a href="{{ URL_ROOT }}/exam/next_unit/{{course.id}}/{{learning_module.id}}/{{first_unit.id}}/1" class="btn btn-info">Next Unit <span class="glyphicon glyphicon-chevron-right"> </span> </a> @@ -70,7 +65,7 @@ </div> </div> <div style="text-align: center;"> - <a href="{{ URL_ROOT }}/exam/next_unit/{{course.id}}/{{learning_module.id}}/{{current_unit.id}}" class="btn btn-primary" style="display: inline-block;">Next Unit + <a href="{{ URL_ROOT }}/exam/next_unit/{{course.id}}/{{learning_module.id}}/{{current_unit.id}}" class="btn btn-info" style="display: inline-block;">Next Unit <span class="glyphicon glyphicon-chevron-right"> </span> </a> |