diff options
author | adityacp | 2017-12-14 12:00:51 +0530 |
---|---|---|
committer | adityacp | 2017-12-14 12:00:51 +0530 |
commit | 209dd65b0bf97bdac883881c4d96b7670cd902a2 (patch) | |
tree | d7e851f8f912a86d5d1bd0133f76cc40f9d7da7d | |
parent | 5d368b02d3fb8016084d431090b57a4e1aa18428 (diff) | |
download | online_test-209dd65b0bf97bdac883881c4d96b7670cd902a2.tar.gz online_test-209dd65b0bf97bdac883881c4d96b7670cd902a2.tar.bz2 online_test-209dd65b0bf97bdac883881c4d96b7670cd902a2.zip |
Change templates
- Add new template to view course modules
- Change glyphicon in question.html and show_video.html
- Change button name in add_module.html
- Remove unnecessary js file
- Change button in intro.html
- Change quizzes_user.html to display only courses
-rw-r--r-- | yaksh/static/yaksh/js/add_lesson.js | 11 | ||||
-rw-r--r-- | yaksh/templates/yaksh/add_module.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/course_modules.html | 112 | ||||
-rw-r--r-- | yaksh/templates/yaksh/intro.html | 14 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/quizzes_user.html | 77 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_video.html | 8 |
7 files changed, 135 insertions, 91 deletions
diff --git a/yaksh/static/yaksh/js/add_lesson.js b/yaksh/static/yaksh/js/add_lesson.js deleted file mode 100644 index 4ad6e4d..0000000 --- a/yaksh/static/yaksh/js/add_lesson.js +++ /dev/null @@ -1,11 +0,0 @@ -$(document).ready(function(){ - $("#submit").click(function(){ - var selected_quiz = $("#id_quiz :selected").text(); - var video_session = $("#id_video_session").val(); - if(selected_quiz == "---------" && video_session.length == 0) { - $("#alert").toggle(); - return false; - } - return true; - }); -});
\ No newline at end of file diff --git a/yaksh/templates/yaksh/add_module.html b/yaksh/templates/yaksh/add_module.html index 499646b..07fcb5f 100644 --- a/yaksh/templates/yaksh/add_module.html +++ b/yaksh/templates/yaksh/add_module.html @@ -36,7 +36,7 @@ <button class="btn" type="submit" id="submit" name="Save"> Save </button> <button class="btn" type="button" name="button" id="preview"> - Preview Lesson Description + Preview Module Description </button> </center> </form> diff --git a/yaksh/templates/yaksh/course_modules.html b/yaksh/templates/yaksh/course_modules.html new file mode 100644 index 0000000..4933113 --- /dev/null +++ b/yaksh/templates/yaksh/course_modules.html @@ -0,0 +1,112 @@ +{% extends "user.html" %} +{% load custom_filters %} +{% block title %} Course Modules {% endblock %} +{% block pagetitle %} Curriculum for {{course}} {% endblock %} +{% block script %} +<script> + function view_unit(unit){ + $("#"+unit+"_down").toggle(); + $("#"+unit+"_up").toggle(); + } + +</script> +{% endblock %} +{% block main %} +{% if msg %} + <div class="alert alert-warning" role="alert"> + <center>{{ msg }}</center> + </div> +{% endif %} +{% if learning_modules %} + {% for module in learning_modules %} + <div class="row well"> + <table class="table"> + <tr> + <td> + <a href="{{URL_ROOT}}/exam/quizzes/view_module/{{module.id}}/{{course.id}}"> + {{module.name|title}}</a> + </td> + <td> + <span class="glyphicon glyphicon-chevron-down" id="learning_units{{module.id}}{{course.id}}_down"> + </span> + <span class="glyphicon glyphicon-chevron-up" id="learning_units{{module.id}}{{course.id}}_up" style="display: none;"></span> + <a data-toggle="collapse" data-target="#learning_units{{module.id}}{{course.id}}" onclick="view_unit('learning_units{{module.id}}{{course.id}}');"> + View Lessons/Quizzes</a> + </td> + <td> + {% get_module_status user module course as module_status %} + Status: + {% if module_status == "completed" %} + <span class="label label-success"> + {{module_status|title}} + </span> + {% elif module_status == "inprogress" %} + <span class="label label-info"> + {{module_status|title}} + </span> + {% else %} + <span class="label label-warning"> + {{module_status|title}} + </span> + {% endif %} + </td> + </tr> + </table> + </div> + <div id="learning_units{{module.id}}{{course.id}}" class="collapse"> + <table class="table"> + <tr> + <th>Lesson/Quiz</th> + <th>Status</th> + <th>Type</th> + <th>View AnswerPaper</th> + </tr> + {% for unit in module.get_learning_units %} + <tr> + <ul class="inputs-list"> + <td> + {% if unit.learning_type == "quiz" %} + {{unit.quiz.description}} + {% else %} + {{unit.lesson.name}} + {% endif %} + </td> + <td> + {% get_unit_status course module unit user as status %} + {% if status == "completed" %} + <span class="label label-success">{{status|title}} + </span> + {% elif status == "inprogress" %} + <span class="label label-info">{{status|title}} + </span> + {% else %} + <span class="label label-warning">{{status|title}} + </span> + {% endif %} + </td> + <td> + {{unit.learning_type|title}} + </td> + <td> + {% if unit.learning_type == "quiz" %} + {% if unit.quiz.view_answerpaper %} + <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ unit.quiz.questionpaper_set.get.id }}/{{course.id}}"><i class="fa fa-eye" aria-hidden="true"></i> Can View </a> + {% else %} + <a> + <i class="fa fa-eye-slash" aria-hidden="true"> + </i> Cannot view now </a> + {% endif %} + {% else %} + ------ + {% endif %} + </td> + </ul> + </tr> + {% endfor %} + </table> + </div> + {% endfor %} +{% else %} + <h3> No lectures found </h3> +{% endif %} +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/intro.html b/yaksh/templates/yaksh/intro.html index 2d213b9..ca49d64 100644 --- a/yaksh/templates/yaksh/intro.html +++ b/yaksh/templates/yaksh/intro.html @@ -20,12 +20,22 @@ <br/> </div> {% endif %} - <p> Welcome <strong>{{user.first_name.title}} {{user.last_name.title}}</strong>, to the programming quiz! </p> + <p> Welcome <strong>{{user.get_full_name|title}}</strong>, to the programming quiz! </p> {{ questionpaper.quiz.instructions|safe }} <div class="row"> <div class="col-md-6"> <center> - <a href="{{URL_ROOT}}/exam" class="btn btn-primary" name="home">Home</a> + {% if status == "moderator" %} + <a href="{{URL_ROOT}}/exam/quizzes/view_module/{{module.id}}/{{course.id}}" class="btn btn-primary" name="home"> + <span class=" glyphicon glyphicon-arrow-left"> + </span> + Go Back</a> + {% else %} + <a href="{{URL_ROOT}}/exam" class="btn btn-primary" name="home"> + <span class=" glyphicon glyphicon-arrow-left"> + </span> + Go Back</a> + {% endif %} </center> </div> <div class="col-md-6"> diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 674fafc..6adda5b 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -106,7 +106,7 @@ module_id = "{{module.id}}" {% get_unit_status course module unit user as status %} {% if unit.quiz.id == paper.question_paper.quiz.id %} - <span class="glyphicon glyphicon-pencil" data-toggle="tooltip" title="Currently on"></span> + <span class=" glyphicon glyphicon-edit" data-toggle="tooltip" title="Currently on"></span> {% endif %} {% if unit.learning_type == "quiz" %} diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index 26e550d..cf08752 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -1,5 +1,4 @@ {% extends "user.html" %} -{% load custom_filters %} {% block title %} Student Dashboard {% endblock %} {% block pagetitle %} {{ title }} {% endblock %} {% block main %} @@ -33,7 +32,11 @@ No Courses to display <div class="col-md-12"> <div class="row"> <div class="col-md-4"> - <h4><b><u> {{ course.name }} by {{ course.creator.get_full_name }}</u></b></h4> + <h4><b> + <a href="{{URL_ROOT}}/exam/course_modules/{{course.id}}"> + {{ course.name }} by {{ course.creator.get_full_name }} + </a> + </b></h4> </div> <div class="col-md-4"> {% if not course.active %} @@ -56,76 +59,6 @@ No Courses to display </div> </div> - <div class="row"> - {% if user in course.students.all and course.get_learning_modules %} - <table class="table table-bordered"> - <th>Learning Modules</th> - <th>Learning Units</th> - <th>Status</th> - {% for module in course.get_learning_modules %} - <tr> - <td> - <a href="{{URL_ROOT}}/exam/quizzes/view_module/{{module.id}}/{{course.id}}"> - {{module.name}}</a> - </td> - <td> - <a data-toggle="collapse" data-target="#learning_units{{module.id}}{{course.id}}"> - <span class="glyphicon glyphicon-chevron-down"> - View Learning Units</span></a> - <div id="learning_units{{module.id}}{{course.id}}" class="collapse"> - <table class="table table-bordered"> - <th>Lesson/quiz</th> - <th>status</th> - <th>View Answerpaper</th> - {% for unit in module.get_learning_units %} - <tr> - <ul class="inputs-list"> - <td> - {% if unit.learning_type == "quiz" %} - {{unit.quiz.description}} - {% else %} - {{unit.lesson.name}} - {% endif %} - </td> - <td> - {% get_unit_status course module unit user as status %} - {% if status == "completed" %} - <span class="label label-info">{{status|title}}</span> - {% else %} - <span class="label label-warning">{{status|title}}</span> - {% endif %} - </td> - <td> - {% if unit.learning_type == "quiz" %} - {% if unit.quiz.view_answerpaper %} - <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ unit.quiz.questionpaper_set.get.id }}/{{course.id}}"><i class="fa fa-eye" aria-hidden="true"></i> Can View </a> - {% else %} - <a><i class="fa fa-eye-slash" aria-hidden="true"></i> Cannot view now </a> - {% endif %} - {% else %} - ------ - {% endif %} - </td> - </ul> - </tr> - {% endfor %} - </table> - </div> - </td> - <td> - {% get_module_status user module course as module_status %} - {% if module_status == "completed" %} - <span class="label label-info">{{module_status|title}}</span> - {% else %} - <span class="label label-warning">{{module_status|title}}</span> - {% endif %} - </td> - </tr> - {% endfor %} - </table> - {% endif %} - </div> - {% if course.instructions %} <div class="row"> <div class="panel-group"> diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html index ff79808..1f80e71 100644 --- a/yaksh/templates/yaksh/show_video.html +++ b/yaksh/templates/yaksh/show_video.html @@ -1,9 +1,9 @@ {% extends "user.html" %} {% load custom_filters %} -{% block title %} {{ learning_module.name }} {% endblock %} +{% block title %} {{ learning_module.name|title }} {% endblock %} -{% block pagetitle %} {{ learning_module.name }} {% endblock %} +{% block pagetitle %} {{ learning_module.name|title }} {% endblock %} {% block usersidebar %} <br><br><br> @@ -15,7 +15,7 @@ {% 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="Currently on"> + <span class="glyphicon glyphicon-edit" data-toggle="tooltip" title="Currently on"> </span> {% endif %} {% if unit.learning_type == "quiz" %} @@ -54,7 +54,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-info">Next Unit + <a href="{{ URL_ROOT }}/exam/next_unit/{{course.id}}/{{learning_module.id}}/{{first_unit.id}}/1" class="btn btn-info">First Unit <span class="glyphicon glyphicon-chevron-right"> </span> </a> |