diff options
author | adityacp | 2017-11-17 19:42:43 +0530 |
---|---|---|
committer | adityacp | 2017-11-20 10:20:03 +0530 |
commit | d4a2b0af95ee4347a71346fa3f20409d938d5a46 (patch) | |
tree | e42a02b3fb30f48fa5b2bb1963e2a805a1981580 | |
parent | a962b59a011c3bcd97c695e839f5b4184926653d (diff) | |
download | online_test-d4a2b0af95ee4347a71346fa3f20409d938d5a46.tar.gz online_test-d4a2b0af95ee4347a71346fa3f20409d938d5a46.tar.bz2 online_test-d4a2b0af95ee4347a71346fa3f20409d938d5a46.zip |
Change in templates
- Add new templates for creating lessons, modules, design course
- Change existing templates for student and moderator interface
22 files changed, 886 insertions, 241 deletions
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index e7cc15c..007d9b8 100644 --- a/yaksh/templates/base.html +++ b/yaksh/templates/base.html @@ -56,7 +56,7 @@ <div class="logged_user_info" align="center"> {% block info %} {% endblock %} - </div> + </div> <div class="container"> <p align="center">Developed by FOSSEE group, IIT Bombay</p> </div> diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index a1f0df4..9b565eb 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -15,7 +15,7 @@ <a class="navbar-brand" href="#"> Yaksh </a> </div> <div class= "collapse navbar-collapse" id="navbar"> - <form id="logout" action="{{URL_ROOT}}/exam/quit/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post" class="pull-right"> + <form id="logout" action="{{URL_ROOT}}/exam/quit/{{ paper.attempt_number }}/{{module_id}}/{{ paper.question_paper.id }}/{{course_id}}/" method="post" class="pull-right"> {% csrf_token %} <ul class="nav navbar-nav navbar"> <li style="padding: 10px"><button class="btn btn-danger btn-sm" type="submit" name="quit"> @@ -52,15 +52,15 @@ {% if qid.id == question.id %} <li class="active"><a style="width:25%" href="#"data-toggle="tooltip" title="{{ qid.description|striptags }}" - onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li> + onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module_id }}/{{ paper.question_paper.id }}/{{course_id}}/')">{{ forloop.counter }}</a></li> {% else %} <li><a style="width:25%" href="#" data-toggle="tooltip" title="{{ qid.description|striptags }}" - onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li> + onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module_id }}/{{ paper.question_paper.id }}/{{course_id}}/')">{{ forloop.counter }}</a></li> {% endif %} {% endif %} {% if qid in paper.get_questions_answered %} <li><a style="background-color:#B4B8BA; width:25%" href="#" data-toggle="tooltip" - onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')" + onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module_id }}/{{ paper.question_paper.id }}/{{course_id}}/')" title="{{ qid.description }}">{{ forloop.counter }}</a></li> {% endif %} {% else %} diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html index 83aea13..a50451e 100644 --- a/yaksh/templates/user.html +++ b/yaksh/templates/user.html @@ -11,7 +11,7 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/manage/"> Yaksh </a> + <a class="navbar-brand" href="{{ URL_ROOT }}/exam/quizzes"> Yaksh </a> </div> <div class= "collapse navbar-collapse" id="navbar"> <ul class="nav navbar-nav navbar-right"> @@ -31,6 +31,8 @@ <li><a href="{{ URL_ROOT }}/exam/viewprofile"> Profile </a></li> <li><a href="{{ URL_ROOT }}/exam/reset/changepassword"> Change Password </a></li> </ul> + {% block usersidebar %} + {% endblock %} </div> <div class="col-sm-8 col-sm-offset-3 col-md-9 col-md-offset-2 main"> <div class="row"> diff --git a/yaksh/templates/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html index b8fc11c..904cf5f 100644 --- a/yaksh/templates/yaksh/add_course.html +++ b/yaksh/templates/yaksh/add_course.html @@ -25,7 +25,7 @@ </script> </center> - <center><button class="btn btn-default" type="submit" id="submit" name="questionpaper">Save </button> - <button class="btn btn-default" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/");'>Cancel</button> </center> + <center><button class="btn primary" type="submit" id="submit" name="questionpaper">Add Course</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/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html new file mode 100644 index 0000000..9e1ee1d --- /dev/null +++ b/yaksh/templates/yaksh/add_lesson.html @@ -0,0 +1,61 @@ +{% extends "manage.html" %} +{% load custom_filters %} + +{% block title %}Create/Edit Lesson{% endblock %} + +{% block script %} +<script src="{{ URL_ROOT }}/static/yaksh/js/lesson.js"></script> +{% endblock %} + +{% block content %} +<form name=frm id=frm action="" method="post" enctype="multipart/form-data"> + {% csrf_token %} + <center> + <table class="table table-bordered"> + {{ lesson_form.as_table }} + {{ lesson_file_form.as_table }} + </table> + </center> + <br><br> + <center> + {% if lesson_files %} + <div class="alert alert-success"> + <h4>Files added to this lesson</h4> + </div> + {% for f in lesson_files %} + <h4><input type="checkbox" name="delete_files" value="{{f.id}}"> Delete</input> + <a href="{{f.file.url}}">{{ f.file.name|file_title }}</a> + ({{f.file.url}}) + </h4><br> + {% endfor %} + {% else %} + <div class="alert alert-warning"> + <h4 class="alert-warning">No Files added to this lesson</h4> + </div> + {% endif %} + + </center> + <br><br> + <center> + <button class="btn" type="submit" id="submit" name="Save"> Save + </button> + {% if lesson_files %} + <button class="btn" type="submit" id="submit" name="Delete"> Delete Files + </button> + {% endif %} + <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> + <button class="btn" type="button" name="button" id="preview">Preview Lesson Description + </button> + </center> + <hr> + <div class="panel panel-default" id="preview_text_div" style="display: none;"> + <div class="panel-heading"> + <center> + <h3>Description Preview</h3> + </center> + </div> + <div class="panel-body" id="description_body"> + </div> + </div> +</form> +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/add_module.html b/yaksh/templates/yaksh/add_module.html new file mode 100644 index 0000000..f9676e6 --- /dev/null +++ b/yaksh/templates/yaksh/add_module.html @@ -0,0 +1,140 @@ +{% extends "manage.html" %} +{% load custom_filters %} +{% block title %}Create/Edit Learning Module{% endblock %} + +{% block pagetitle %}<h4>Design Learning Module</h4>{% endblock %} + +{% block script %} +<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.9.1.min.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/design_course.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/lesson.js"></script> +{% endblock %} + +{% block css %} +<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/design_course.css" /> +{% endblock %} + +{% block content %} +{% if course_id %} + <a href="{{URL_ROOT}}/exam/manage/courses/" class="btn btn-primary">Cancel</a> +{% else %} + <a href="{{URL_ROOT}}/exam/manage/courses/all_learning_module" class="btn btn-primary">Cancel</a> +{% endif %} +{% if status == "add" %} +<form name=frm id=frm action="" method="post"> + {% csrf_token %} + <center> + <table class="table table-bordered"> + {{ module_form.as_table }} + </table> + </center> + <br><br> + <center> + <button class="btn" type="submit" id="submit" name="Save"> Save + </button> + <button class="btn" type="button" name="button" id="preview"> + Preview Lesson Description + </button> + </center> +</form> +<hr> +<div class="panel panel-default" id="preview_text_div" style="display: none;"> + <div class="panel-heading"> + <center> + <h3>Description Preview</h3> + </center> + </div> + <div class="panel-body" id="description_body"> + </div> +</div> +{% endif %} +<!-- Add learning Units --> +{% if status == "design" %} +<center><h3><u>Add/Edit Learning Units</h3></u></center> +<form action="{{URL_ROOT}}/exam/manage/courses/designmodule/{{module_id}}/" method="POST" id="design_course_form"> +{% csrf_token %} + <div class="tab-pane active" id="available-lesson-quiz"> + <div class="row"> + <div class="col-md-8 available-list col-md-offset-2"> + <div id="fixed-available-wrapper"> + <p><u><b>Available Lessons and quizzes: (Add Lessons and Quizzes)</b></u></p> + <div id="fixed-available"> + <ul class="inputs-list"> + {% for type, unit in quiz_les_list %} + <li> + <label> + {% if type == "quiz" %} + <input type="checkbox" name="quiz_lesson" data-qid="{{unit.id}}:{{type}}" value="{{unit.id}}:{{type}}"> + <span>{{ unit.description }} ({{type}})</span> + {% else %} + <input type="checkbox" name="quiz_lesson" data-qid="{{unit.id}}:{{type}}" value="{{unit.id}}:{{type}}"> + <span>{{ unit.name }} ({{type}})</span> + {% endif %} + </label> + </li> + {% endfor %} + </ul> + </div> + </div> + <br> + <center> + <button class="btn" type="submit" id="submit" name="Add"> + Add to Module + </button> + </center> + <br><br> + </div> + <div class="col-md-8 col-md-offset-2"> + <div id="fixed-added-wrapper"> + <p><u><b>Choosen Lessons and quizzes:</b></u> + </p> + <div id="fixed-added"> + <table id="course-details" class="table table-bordered"> + <tr> + <th>Select</th> + <th>Quiz/Lesson</th> + <th>Order</th> + <th width="20%">Check Prerequisite + <a href="#" data-toggle="tooltip" id="prereq_msg"> + <span class="glyphicon glyphicon-question-sign"> + </span> What's This + </a> + </th> + </tr> + {% for unit in learning_units %} + <tr> + <ul class="inputs-list"> + <td> + <input type="checkbox" name="delete_list" value="{{unit.id}}"> + </td> + {% if unit.learning_type == "quiz" %} + <td><span>{{ unit.quiz.description }} ({{unit.learning_type}}) + </span></td> + <td><input type="number" name="order" data-item-id="{{unit.id}}" value="{{unit.order}}" step="1"></td> + {% else %} + <td><span>{{ unit.lesson.name }} ({{unit.learning_type}}) + </span></td> + <td><input type="number" name="order" data-item-id="{{unit.id}}" value="{{unit.order}}" step="1"></td> + {% endif %} + <td> + <input type="checkbox" name="check_prereq" value="{{unit.id}}"> + {{unit.check_prerequisite}} + </td> + </ul> + </tr> + {% endfor %} + </table> + </div> + </div> + <br> + <center> + <button id="Remove" name="Remove" class="btn small primary" type="submit">Remove from Module</button> + <button id="Change" name="Change" class="btn small primary" type="submit"> Change Order</button> + <button id="Change" name="Change_prerequisite" class="btn small primary" type="submit"> Change Prerequisite</button> + </center> + </div> + </div> <!-- /.row --> + </div> +</form> +{% endif %} +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html index 08bb124..d3705e3 100644 --- a/yaksh/templates/yaksh/add_quiz.html +++ b/yaksh/templates/yaksh/add_quiz.html @@ -18,7 +18,7 @@ <form name=frm id=frm action="" method="post" > {% csrf_token %} <center> - <table class=span1> + <table class="span1 table"> {{ form.as_table }} </table> <script type="text/javascript"> @@ -34,13 +34,14 @@ <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> </center> </form> -{% if quiz_id %} - - <h5>You can check the quiz by attempting it in the following modes:</h5> +<br> +{% if quiz_id and course_id %} <center> - <button class="btn" type="button" name="button" onClick='usermode("{{URL_ROOT}}/exam/manage/usermode/{{quiz_id}}");'>User Mode</button> + <h4>You can check the quiz by attempting it in the following modes:</h4> + <button class="btn" type="button" name="button" onClick='usermode("{{URL_ROOT}}/exam/manage/usermode/{{quiz_id}}/{{course_id}}/");'>User Mode</button> - <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/godmode/{{quiz_id}}");'>God Mode</button> + <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/godmode/{{quiz_id}}/{{course_id}}/");'> + God Mode</button> <a data-toggle="collapse" data-target="#help"> <span class="glyphicon glyphicon-info-sign">Help</span></a> <div id="help" class="collapse"> diff --git a/yaksh/templates/yaksh/complete.html b/yaksh/templates/yaksh/complete.html index 45284c4..585129d 100644 --- a/yaksh/templates/yaksh/complete.html +++ b/yaksh/templates/yaksh/complete.html @@ -32,5 +32,12 @@ <center><h2> Good bye! </h2></center> <center><h4> {{message}} </h4></center> <br><center><h4>You may now close the browser.</h4></center><br> - <center><a href="{{URL_ROOT}}/exam/" id="home"> Home </a></center> + <center> + <a href="{{URL_ROOT}}/exam/" id="home" class="btn btn-success"> Home </a> + {% if first_unit %} + <a href="{{URL_ROOT}}/exam/next_unit/{{course_id}}/{{module_id}}/{{learning_unit.id}}/1" class="btn btn-info"> Next Unit </a> + {% else %} + <a href="{{URL_ROOT}}/exam/next_unit/{{course_id}}/{{module_id}}/{{learning_unit.id}}" class="btn btn-info"> Next Unit </a> + {% endif %} + </center> {% endblock content %} diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html index 93a7048..e9fadbd 100644 --- a/yaksh/templates/yaksh/course_detail.html +++ b/yaksh/templates/yaksh/course_detail.html @@ -2,7 +2,9 @@ {% block title %} Course Details {% endblock title %} +<div class="col-md-9 col-md-offset-2 main"> {% block pagetitle %} Course Details for {{ course.name|title }} {% endblock %} +</div> {% block script %} <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/course.js"></script> @@ -30,14 +32,6 @@ Rejected Students </a></li> {% endif %} <li> - <a href="{{URL_ROOT}}/exam/manage/toggle_status/{{ course.id }}/"> - {% if course.active %}Deactivate Course {% else %} Activate Course {% endif %}</a> - </li> - <li> - <a href="{{URL_ROOT}}/exam/manage/duplicate_course/{{ course.id }}/"> - Clone Course</a> - </li> - <li> <a href="{{URL_ROOT}}/exam/manage/send_mail/{{ course.id }}/"> Send Mail</a> </li> diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html index e09a9cc..b3d7d1f 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -1,173 +1,425 @@ {% extends "manage.html" %} {% block title %} Courses {% endblock %} {% block pagetitle %} Courses {% endblock pagetitle %} +{% block script %} +<script> + $(document).ready(function(){ + $("#created_courses").toggle(); + $("#link_created_courses").click(function() { + if ($("#allotted_courses").is(":visible")){ + $("#allotted_courses").toggle(); + } + if (!$("#created_courses").is(":visible")){ + $("#created_courses").toggle(); + } + }); + $("#link_allotted_courses").click(function() { + if ($("#created_courses").is(":visible")){ + $("#created_courses").toggle(); + } + if (!$("#allotted_courses").is(":visible")){ + $("#allotted_courses").toggle(); + } + }); + }); +</script> +{% endblock %} {% block content %} +<div class="row"> + <div class="col-sm-3 col-md-2 sidebar"> + <ul class="nav nav-sidebar"> + {% if type == "courses" %} + <li><a href="#" id="link_created_courses">Created Courses</a></li> + <li><a href="#" id="link_allotted_courses">Allotted Courses</a></li> + {% else %} + <li><a href="{{URL_ROOT}}/exam/manage/courses">View all Courses</a></li> + {% endif %} + <li> + <a href="{{URL_ROOT}}/exam/manage/add_course">Add New Course</a> + </li> + <li> + <a href="{{URL_ROOT}}/exam/manage/courses/all_quizzes/">View all Quizzes</a> + </li> + <li> + <a href="{{URL_ROOT}}/exam/manage/courses/all_lessons/">View all Lessons</a> + </li> + <li> + <a href="{{URL_ROOT}}/exam/manage/courses/all_learning_module"> + View all LearningModules</a> + </li> + </ul> + </div> +</div> +<!-- {% if type == "courses" %} --> +<div id="created_courses" style="display: none;"> {% if not courses %} <center><h4> No new Courses created </h4></center> {% else %} -<center><h3> Course(s) Created</h3></center> +<div class="col-md-offset-2 main"> + <center><h3> Course(s) Created</h3></center> + <table id="course-details" class="table table-bordered"> + <tr> + <th>Courses</th> + <th>Lessons/Quizzes</th> + </tr> + {% for course in courses %} - {% if user != course.creator %} - <h4> {{course.creator.get_full_name}} added you to this course</h4> - {% endif %} - <div class="row"> - <div class="col-md-12"> + <tr> + <td width="30%"> + <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }} + </a> + {% if course.active %} + <span class="label label-success">Active</span> + {% else %} + <span class="label label-danger">Closed</span> + {% endif %} + <br><br> + <center><b><u>Teacher(s) Added to {{ course }}</u></b></center> + <br> + <form action="{{URL_ROOT}}/exam/manage/remove_teachers/{{ course.id }}/" method="post"> + {% if course.get_teachers %} + <div align="left"> + {% csrf_token %} + {% for teacher in course.get_teachers %} + <div class="well"> <div class="row"> - <div class="col-md-6"> - <p> - <b><u>Course</u></b> - {% if course.active %} - <span class="label label-success">Active</span> - {% else %} - <span class="label label-danger">Closed</span> - {% endif %} - </p> - <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }}</a> - </br></br> - {% if user == course.creator %} - <div class="row"> - <div class="col-md-4 "> - <center><b><u>Teacher(s) Added to {{ course }}</u></b></center> - {% if course.get_teachers %} - <div align="left"> - <form action="{{URL_ROOT}}/exam/manage/remove_teachers/{{ course.id }}/" method="post"> - {% csrf_token %} - {% for teacher in course.get_teachers %} - <div class="well"> - <div class="row"> - <div class="col-md-333" style="width: auto;"> - <input type="checkbox" name="remove" value="{{ teacher.id }}"> {{ teacher.get_full_name }} - </div> - </div> - </div> - {% endfor %} - <button class="btn btn-danger" type="submit">Remove Selected</button> - </div> - {% else %} - <center><b>No Teacher(s) Added</b></center> - {% endif %} - </form> - </div> - </div> - {% endif %} - </div> - {% if user == course.creator %} - <p><b><a href="{{URL_ROOT}}/exam/manage/searchteacher/{{course.id}}/">Add Teacher</a></b></p> - {% endif %} - <div class="col-md-2" style="text-align:left"> - {% if course.get_quizzes %} - <p><b><u>Quiz(zes)</u></b></p> - {% for quiz in course.get_quizzes %} - <a href="{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/{{quiz.id}}/">{{ quiz.description }}</a><br> - {% endfor %} - </div> - <div class="col-md-4" style="text-align:left"> - <p><b><u>Question Paper(s)</u></b></p> - {% for quiz in course.get_quizzes %} - {% if quiz.questionpaper_set.get %} - <a href="{{URL_ROOT}}/exam/manage/designquestionpaper/{{ quiz.id }}/{{quiz.questionpaper_set.get.id}}/">Question Paper for {{ quiz.description }}</a><br> - {% else %} - <p>No Question Paper - <a href="#" onClick='location.replace("{{URL_ROOT}}/exam/manage/quiz/designquestionpaper/{{ quiz.id }}/");'>Add</a> - </p> - {% endif %} - {% endfor %} - {% else %} - <p><b>No quiz </b></p> - {% endif %} + <div class="col-md-333" style="width: auto;"> + <input type="checkbox" name="remove" value="{{ teacher.id }}"> {{ teacher.get_full_name }} </div> </div> - <br/> - <a class="btn btn-success" href="{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/">Add New Quiz</a> - <a class="btn btn-primary"href="{{URL_ROOT}}/exam/manage/edit_course/{{course.id}}">Edit Course</a> - <a class="btn btn-default"href="{{URL_ROOT}}/exam/manage/courses/download_course_csv/{{course.id}}">Download CSV</a> </div> - </div> + {% endfor %} <!-- end for teachers --> + <button class="btn btn-danger" type="submit" data-toggle="tooltip" title="Remove Selected Teachers from this course">Remove Teachers</button> + </div> + {% else %} + <center><b>No Teacher(s) Added</b></center> + {% endif %} + </form> + <br><br> + <ul> + <li> + <a href="{{URL_ROOT}}/exam/manage/edit_course/{{course.id}}">Edit Course</a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/courses/download_course_csv/{{course.id}}">Download CSV + </a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/searchteacher/{{course.id}}/">Add Teacher</a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/courses/designcourse/{{course.id}}/">Design Course Session + </a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/toggle_status/{{ course.id }}/"> + {% if course.active %}Deactivate Course {% else %} Activate Course {% endif %} + </a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/duplicate_course/{{ course.id }}/"> + Clone Course</a> + </li> + </ul> + </td> + <td> + <table id="course-details" class="table table-bordered"> + {% if course.get_learning_modules %} + <tr> + <th>Learning Modules</th> + <th>Design Learning module</th> + <th>Learning Units</th> + </tr> + {% for module in course.get_learning_modules %} + <tr> + <td> + <a href="{{URL_ROOT}}/exam/manage/courses/add_module/{{module.id}}/{{course.id}}"> + {{module.name}}</a> + </td> + <td> + <a href="{{URL_ROOT}}/exam/manage/courses/designmodule/{{module.id}}/{{course.id}}/"> + Add Quizzes/Lessons for {{module.name}} + </a> + </td> + <td> + {% for unit in module.get_learning_units %} + <ul class="inputs-list"> + <li> + {% if unit.learning_type == "quiz" %} + <a href="{{URL_ROOT}}/exam/manage/addquiz/{{unit.quiz.id}}/{{course.id}}"> + {{unit.quiz.description}}</a> + {% else %} + <a href="{{URL_ROOT}}/exam/manage/courses/edit_lesson/{{unit.lesson.id}}/{{course.id}}"> + {{unit.lesson.name}}</a> + {% endif %} + </li> + </ul> + {% endfor %} + </td> + </tr> + {% endfor %} <!-- end for modules --> + {% else %} + No learning modules + {% endif %} + </table> + </td> + </tr> + {% endfor %} <!-- end for courses --> + </table> +</div> +{% endif %} +</div> + +<!-- Show Alotted courses --> +<div id="allotted_courses" style="display: none;"> +{% if not allotted_courses %} + <center><h4> No new Courses allotted</h4></center> <br><br> - {% endfor %} - {% endif %} -<hr/> -{% if allotted_courses %} +{% else %} +<div class="col-md-offset-2 main"> <center><h3> Course(s) Allotted </h3></center> + <table id="course-details" class="table table-bordered"> + <tr> + <th>Courses</th> + <th>Lessons/Quizzes</th> + </tr> + {% for course in allotted_courses %} - <div class="row"> - <div class="col-md-12"> + <tr> + <td width="30%"> + <ul class="list-group"> + <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }}</a> + {% if course.active %} + <span class="label label-success">Active</span> + {% else %} + <span class="label label-danger">Closed</span> + {% endif %} + <br><br> + <center><b><u> Course Creator</u></b><br> + <h4>{{course.creator.get_full_name.title}}</h4> + </center><br> + <center><b><u>Teacher(s) Added to {{ course }}</u></b></center> + <br> + <form action="{{URL_ROOT}}/exam/manage/remove_teachers/{{ course.id }}/" method="post"> + {% if course.get_teachers %} + <div align="left"> + {% csrf_token %} + {% for teacher in course.get_teachers %} + <div class="well"> <div class="row"> - <div class="col-md-6"> - <p> - <b><u>Course</u></b> - {% if course.active %} - <span class="label label-success">Active</span> - {% else %} - <span class="label label-danger">Closed</span> - {% endif %} - </p> - <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }}</a> - </br></br> - <div class="row"> - <div class="col-md-4 wrap"> - <center><b><u> Course Creator</u></b></center> - {{course.creator}} - <center><b><u>Teacher(s) Added to {{ course }}</u></b></center> - {% if course.get_teachers %} - <div align="left"> - <form action="{{URL_ROOT}}/exam/manage/remove_teachers/{{ course.id }}/" method="post"> - {% csrf_token %} - {% for teacher in course.get_teachers %} - <div class="well"> - <div class="row"> - <div class="col-md-3" style="width: auto;"> - <input type="checkbox" name="remove" value="{{ teacher.id }}"> {{ teacher.get_full_name }} - </div> - </div> - </div> - {% endfor %} - <button class="btn btn-danger" type="submit">Remove Selected</button> - </div> - {% else %} - <center><b>No Teacher(s) Added</b></center> - {% endif %} - </form> - </div> - </div> - </div> - <div> - <p><b><a href="{{URL_ROOT}}/exam/manage/searchteacher/{{course.id}}/">Add Teacher</a></b></p> - </div> - <div class="col-md-2"> - <p><b><u>Quiz(zes)</u></b></p> - {% if course.get_quizzes %} - {% for quiz in course.get_quizzes %} - <a href="{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/{{quiz.id}}/">{{ quiz.description }}</a><br> - {% endfor %} - {% else %} - <p><b>No quiz </b></p> - {% endif %} - </div> - <div class="col-md-4"> - <p><b><u>Question Paper(s)</u></b></p> - {% for quiz in course.get_quizzes %} - {% if quiz.questionpaper_set.get %} - <a href="{{URL_ROOT}}/exam/manage/designquestionpaper/{{ quiz.id }}/{{quiz.questionpaper_set.get.id}}/">Question Paper for {{ quiz.description }}</a><br> - {% else %} - <p>No Question Paper - <a href="#" onClick='location.replace("{{URL_ROOT}}/exam/manage/quiz/designquestionpaper/{{ quiz.id }}/");'>Add</a> - </p> - {% endif %} - {% endfor %} + <div class="col-md-333" style="width: auto;"> + <input type="checkbox" name="remove" value="{{ teacher.id }}"> + {{ teacher.get_full_name }} </div> </div> - <br/> - <button class="btn btn-primary pull-right"type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/");'>Add New Quiz</button> - <p><a href="{{URL_ROOT}}/exam/manage/courses/download_course_csv/{{course.id}}">Download CSV</a></p> </div> + {% endfor %} <!-- end for teachers --> + <button class="btn btn-danger" type="submit" data-toggle="tooltip" title="Remove Selected Teachers from this course">Remove Teachers</button> + </div> + {% else %} + <center><b>No Teacher(s) Added</b></center> + {% endif %} + </form> + <br><br> + <ul> + <li> + <a href="{{URL_ROOT}}/exam/manage/edit_course/{{course.id}}">Edit Course</a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/courses/download_course_csv/{{course.id}}">Download CSV + </a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/searchteacher/{{course.id}}/">Add Teacher + </a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/toggle_status/{{ course.id }}/"> + {% if course.active %}Deactivate Course {% else %} Activate Course {% endif %} + </a> + </li> + <br> + <li> + <a href="{{URL_ROOT}}/exam/manage/duplicate_course/{{ course.id }}/"> + Clone Course</a> + </li> + </ul> + </td> + <td> + <table id="course-details" class="table table-bordered"> + {% if course.get_learning_modules %} + <tr> + <th>Learning Modules</th> + <th>Design Learning module</th> + </tr> + {% for module in course.get_learning_modules %} + <tr> + <td> + <a href="{{URL_ROOT}}/exam/manage/courses/add_module/{{module.id}}/{{course.id}}"> + {{module.name}}</a> + </td> + <td> + <a href="{{URL_ROOT}}/exam/manage/courses/designmodule/{{module.id}}/{{course.id}}/"> + Add Quizzes/Lessons for {{module.name}} + </a> + </td> + </tr> + {% endfor %} <!-- end for modules --> + {% else %} + No learning modules + {% endif %} + </table> + </td> + {% endfor %} <!-- end for courses --> + </tr> + </table> +</div> +{% endif %} +</div> +<!-- {% endif %} --> + +<!-- Show all Quizzes --> +<div id="all_quizzes"> +{% if type == "quiz" %} + <a href="{{URL_ROOT}}/exam/manage/addquiz/" class="btn btn-primary">Add new Quiz</a> + {% if not quizzes %} + <center><h4> No new Quiz Added</h4></center> + <br><br> + {% else %} + <div class="col-md-offset-2 main"> + <center><h3> Quizzes </h3></center> + <table id="course-details" class="table table-bordered"> + <tr> + <th>Sr.No</th> + <th>Quiz</th> + <th>QuestionPaper</th> + </tr> + + {% for quiz in quizzes %} + <tr> + <td>{{forloop.counter}}</td> + <td width="30%"> + <ul class="list-group"> + <a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a> + {% if quiz.active %} + <span class="label label-success">Active</span> + {% else %} + <span class="label label-danger">Closed</span> + {% endif %} + </ul> + </td> + <td> + {% if quiz.questionpaper_set.get %} + <a href="{{URL_ROOT}}/exam/manage/designquestionpaper/{{ quiz.id }}/{{quiz.questionpaper_set.get.id}}/"> + Question Paper for {{ quiz.description }}</a> + <br> + {% else %} + <p>No Question Paper + <a href="#" onClick='location.replace("{{URL_ROOT}}/exam/manage/quiz/designquestionpaper/{{ quiz.id }}/");'>Add</a> + </p> + {% endif %} + </td> + {% endfor %} <!-- end for quizzes --> + </tr> + </table> </div> - <br><br> - {% endfor %} -{% else %} - <center><h4> No new Courses allotted</h4></center> - <br><br> + {% endif %} +{% endif %} +</div> + +<!-- Show all lessons --> + +<div id="all_lessons"> +{% if type == "lesson" %} + <a href="{{URL_ROOT}}/exam/manage/courses/edit_lesson/" class="btn btn-primary">Add new Lesson</a> + {% if not lessons %} + <center><h4> No new Lessons Added</h4></center> + <br><br> + {% else %} + <div class="col-md-offset-2 main"> + <center><h3> Lessons </h3></center> + <table id="course-details" class="table table-bordered"> + <tr> + <th>Sr.No</th> + <th>Lesson</th> + </tr> + + {% for lesson in lessons %} + <tr> + <td width="2%">{{forloop.counter}}</td> + <td width="30%"> + <ul class="list-group"> + <a href="{{URL_ROOT}}/exam/manage/courses/edit_lesson/{{lesson.id}}/"> + {{ lesson.name }}</a> + </ul> + </td> + {% endfor %} <!-- end for lessons --> + </tr> + </table> + </div> + {% endif %} +{% endif %} +</div> + +<!-- Show all learning modules --> +<div id="all_lessons"> +{% if type == "learning_module" %} + <a href="{{URL_ROOT}}/exam/manage/courses/add_module/" class="btn btn-primary"> + Add new Module</a> + {% if not learning_modules %} + <center><h4> No new learning modules Added</h4></center> + <br><br> + {% else %} + <div class="col-md-offset-2 main"> + <center><h3> Learning Modules </h3></center> + <table id="course-details" class="table table-bordered"> + <tr> + <th>Sr.No</th> + <th>Learning Modules</th> + <th>Design Module</th> + <th>Learning Units</th> + </tr> + {% for module in learning_modules %} + <tr> + <td width="2%">{{forloop.counter}}</td> + <td> + <a href="{{URL_ROOT}}/exam/manage/courses/add_module/{{module.id}}/"> + {{ module.name }}</a> + </td> + <td> + <a href="{{URL_ROOT}}/exam/manage/courses/designmodule/{{module.id}}"> + Add Quizzes/Lessons for {{module.name}} + </a> + </td> + <td> + {% if module.get_learning_units %} + {% for unit in module.get_learning_units %} + <ul class="list-group"> + {% if unit.learning_type == 'quiz' %} + {{unit.quiz.description}} + {% else %} + {{unit.lesson.name}} + {% endif %} + </ul> + {% endfor %} <!-- end for learning units --> + {% else %} + No Learning units + {% endif %} + </td> + {% endfor %} <!-- end for modules --> + </tr> + </table> + </div> + {% endif %} {% endif %} -<hr/> -<center><button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button></center> +</div> + {% endblock %} diff --git a/yaksh/templates/yaksh/design_course_session.html b/yaksh/templates/yaksh/design_course_session.html new file mode 100644 index 0000000..87acc33 --- /dev/null +++ b/yaksh/templates/yaksh/design_course_session.html @@ -0,0 +1,107 @@ +{% extends "manage.html" %} +{% load custom_filters %} +{% block title %}Design Course Session{% endblock %} + +{% block pagetitle %}Design Course Session{% endblock %} + +{% block script %} +<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.9.1.min.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/design_course.js"></script> +{% endblock %} + +{% block css %} +<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/design_course.css" /> +{% endblock %} + +{% block main %} +<form action="{{URL_ROOT}}/exam/manage/courses/designcourse/{{course_id}}/" method="POST" id="design_course_form"> +{% csrf_token %} + <div class="tab-pane active" id="available-lesson-quiz"> + <div class="row"> + <div class="col-md-8 col-md-offset-2 available-list"> + <div id="fixed-available-wrapper"> + <p><u><b>Available Lessons and quizzes: (Add Lessons and Quizzes)</b></u></p> + <div id="fixed-available"> + <table id="course-details" class="table table-bordered"> + <tr> + <th width="2%">Select</th> + <th>Learning Module</th> + <th>Learning Units</th> + </tr> + {% for module in learning_modules %} + <ul class="inputs-list"> + <tr> + <td><input type="checkbox" name="module_list" value="{{module.id}}"></td> + <td><span>{{ module.name }}</span></td> + <td> + {% for unit in module.get_learning_units %} + <ul class="inputs-list"> + <li> + {% if unit.learning_type == "quiz" %} + {{unit.quiz.description}} + {% else %} + {{unit.lesson.name}} + {% endif %} + </li> + </ul> + {% endfor %} + </td> + </li> + </tr> + </ul> + {% endfor %} + </table> + </div> + </div> + <br> + <center> + <button id="Add" name="Add" class="btn small primary" type="submit">Add to course</button> + </center> + <br><br> + </div> + <div class="col-md-8 col-md-offset-2"> + <div id="fixed-added-wrapper"> + <p><u><b>Choosen Lessons and quizzes: (Change Order)</b></u></p> + <div id="fixed-added"> + <table id="course-details" class="table table-bordered"> + <tr> + <th>Select</th> + <th>Learning Module</th> + <th>Order</th> + <th width="20%">Check Prerequisite + <a href="#" data-toggle="tooltip" id="prereq_msg"> + <span class="glyphicon glyphicon-question-sign"> + </span> What's This + </a> + </th> + </tr> + {% for module in added_learning_modules %} + <tr> + <ul class="inputs-list"> + <td> + <input type="checkbox" name="delete_list" value="{{module.id}}"> + </td> + <td><span>{{ module.name }}</span></td> + <td> + <input type="number" name="order" data-item-id="{{module.id}}" value="{{module.order}}" step="1"> + </td> + <td> + <input type="checkbox" name="check_prereq" value="{{module.id}}"> {{module.check_prerequisite}} + </td> + </ul> + </tr> + {% endfor %} + </table> + </div> + </div> + <br> + <center> + <button id="Remove" name="Remove" class="btn small primary" type="submit">Remove from course</button> + <button id="Change" name="Change" class="btn small primary" type="submit"> Change Order</button> + <button id="Change" name="Change_prerequisite" class="btn small primary" type="submit"> Change Prerequisite</button> + </center> + </div> + </div> <!-- /.row --> + </div> +</form> +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index d946647..a68d348 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -34,7 +34,7 @@ $(document).ready(function() {% if course.get_quizzes %} <td> {% for quiz in course.get_quizzes %} - <li class="list-group-item"><a href = "{{URL_ROOT}}/exam/manage/gradeuser/{{quiz.id}}"> + <li class="list-group-item"><a href = "{{URL_ROOT}}/exam/manage/gradeuser/{{quiz.id}}/{{course.id}}/"> {{quiz.description}} </a></li> {% endfor %} @@ -52,7 +52,7 @@ $(document).ready(function() {% if users %} <div id = "student" class="col-md-2"> {% for user in users %} - <p><a href = "{{URL_ROOT}}/exam/manage/gradeuser/{{quiz_id}}/{{user.user__id}}"> + <p><a href = "{{URL_ROOT}}/exam/manage/gradeuser/{{quiz_id}}/{{user.user__id}}/{{course_id}}/"> {{user.user__first_name}} {{user.user__last_name}}</a></p> {% endfor %} </div> @@ -95,7 +95,7 @@ Attempt Number: <b>{{paper.attempt_number}} </b> <select id = "attempt" onchange="window.location.href=this.value"> <option selected="">Select attempt number</option> {%for attempt in attempts %} -<option value = "{{URL_ROOT}}/exam/manage/gradeuser/{{quiz_id}}/{{user_id}}/{{attempt.attempt_number}}/"> +<option value = "{{URL_ROOT}}/exam/manage/gradeuser/{{quiz_id}}/{{user_id}}/{{attempt.attempt_number}}/{{course_id}}/"> {{attempt.attempt_number}} </option> {% endfor %} @@ -141,11 +141,7 @@ Status : <b style="color: red;"> Failed </b><br/> <h3> Answers </h3><br> <form name=frm id="q{{ paper.quiz.id }}_form" - {% if data.questionpaperid %} - action="{{URL_ROOT}}/exam/manage/gradeuser/{{quiz_id}}/{{user_id}}/{{paper.attempt_number}}/" - {% else %} - action="{{URL_ROOT}}/exam/manage/gradeuser/{{quiz_id}}/{{user_id}}/{{paper.attempt_number}}/" - {% endif %} + action="{{URL_ROOT}}/exam/manage/gradeuser/{{quiz_id}}/{{user_id}}/{{paper.attempt_number}}/{{course_id}}/" method="post"> {% csrf_token %} diff --git a/yaksh/templates/yaksh/intro.html b/yaksh/templates/yaksh/intro.html index 3b9ba82..bdbdaba 100644 --- a/yaksh/templates/yaksh/intro.html +++ b/yaksh/templates/yaksh/intro.html @@ -24,18 +24,13 @@ {{ questionpaper.quiz.instructions|safe }} <div class="row"> <div class="col-md-6"> - {% if user == "moderator" %} - <form action="{{URL_ROOT}}/exam/manage/" method="post" align="center"> - {%else%} - <form action="{{URL_ROOT}}/exam/quizzes/" method="post" align="center"> - {% endif %} - {% csrf_token %} - <center><button class="btn btn-primary" name="home">Home</button></center> - </form> + <center> + <a href="{{URL_ROOT}}/exam" class="btn btn-primary" name="home">Home</a> + </center> </div> <div class="col-md-6"> {% if not questionpaper.quiz.is_expired %} - <form action="{{URL_ROOT}}/exam/start/{{ attempt_num }}/{{ questionpaper.id }}/" method="post" align="center"> + <form action="{{URL_ROOT}}/exam/start/{{ attempt_num }}/{{module_id}}/{{ questionpaper.id }}/{{course}}/" method="post" align="center"> {% csrf_token %} <center><button class="btn btn-success" type="submit" name="start"> Start Exam <span class="glyphicon glyphicon-chevron-right"></span></button></center> </form> diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html index 25bd580..490ec83 100644 --- a/yaksh/templates/yaksh/moderator_dashboard.html +++ b/yaksh/templates/yaksh/moderator_dashboard.html @@ -14,16 +14,16 @@ <th>Taken By</th> <th>No. of users Passed</th> <th>No. of users Failed</th> - {% for paper, answer_papers, users_passed, users_failed in users_per_paper %} + {% for course, quiz, answer_papers, users_passed, users_failed in users_per_paper %} <tr> <td> - {{ paper.quiz.course.name }} + {{ course }} </td> <td> - <a href="{{URL_ROOT}}/exam/manage/monitor/{{ paper.quiz.id }}/">{{ paper.quiz.description }}</a> + <a href="{{URL_ROOT}}/exam/manage/monitor/{{ quiz.id }}/{{course.id}}">{{ quiz.description }}</a> </td> <td> - {{ answer_papers|length }} user(s) + {{ answer_papers }} user(s) </td> <td> {{ users_passed }} @@ -34,6 +34,7 @@ </tr> {% endfor %} </table> + <hr> <center> <a href="{{URL_ROOT}}/exam/manage/add_course" class="btn btn-default"> @@ -70,7 +71,7 @@ {% for paper in trial_paper %} <tr> <td> <input type = "checkbox" name="delete_paper" class="check" value = {{paper.id}}></input></td> - <td> <a href="{{URL_ROOT}}/exam/manage/gradeuser/{{paper.question_paper.quiz.id}}">{{paper.question_paper.quiz.description}}</a></td> + <td> <a href="{{URL_ROOT}}/exam/manage/gradeuser/{{paper.question_paper.quiz.id}}/{{paper.course.id}}/">{{paper.question_paper.quiz.description}}</a></td> </tr> {% endfor %} </table> diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html index 8df2e7d..e40293b 100644 --- a/yaksh/templates/yaksh/monitor.html +++ b/yaksh/templates/yaksh/monitor.html @@ -46,7 +46,7 @@ $(document).ready(function() {% if course.get_quizzes %} <td> {% for quiz in course.get_quizzes %} - <li class="list-group-item"><a href = "{{URL_ROOT}}/exam/manage/monitor/{{quiz.id}}"> + <li class="list-group-item"><a href = "{{URL_ROOT}}/exam/manage/monitor/{{quiz.id}}/{{course.id}}/"> {{quiz.description}} </a></li> {% endfor %} @@ -64,7 +64,7 @@ $(document).ready(function() {% if msg != "Monitor" %} {% if quiz %} {% if papers %} -<p>Course Name: {{ quiz.course.name }}</p> +<p>Course Name: {{ course.name }}</p> <p>Quiz Name: {{ quiz.description }}</p> <p>Number of papers: {{ papers|length }} </p> {% completed papers as completed_papers %} @@ -75,7 +75,7 @@ $(document).ready(function() {# template tag used to get the count of inprogress papers #} <p>Papers in progress:<b> {{ inprogress_papers }} </b></p> -<p><a href="{{URL_ROOT}}/exam/manage/statistics/question/{{papers.0.question_paper.id}}">Question Statisitics</a></p> +<p><a href="{{URL_ROOT}}/exam/manage/statistics/question/{{papers.0.question_paper.id}}/{{course.id}}">Question Statisitics</a></p> <p> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#csvModal"> Download CSV <span class="glyphicon glyphicon-save"></span> @@ -97,7 +97,7 @@ $(document).ready(function() <tbody> {% for paper in latest_attempts %} <tr> - <td> <a href="{{URL_ROOT}}/exam/manage/user_data/{{paper.user.id}}/{{paper.question_paper.id}}">{{ paper.user.get_full_name.title }}</a> </td> + <td> <a href="{{URL_ROOT}}/exam/manage/user_data/{{paper.user.id}}/{{paper.question_paper.id}}/{{course.id}}">{{ paper.user.get_full_name.title }}</a> </td> <td> {{ paper.user.username }} </td> <td> {{ paper.user.profile.roll_number }} </td> <td> {{ paper.user.profile.institute }} </td> @@ -129,7 +129,7 @@ $(document).ready(function() <button type="button" class="close" data-dismiss="modal">×</button> <h3 class="modal-title">Uncheck unwanted columns</h3> </div> - <form action="{{URL_ROOT}}/exam/manage/download_quiz_csv/{{ quiz.course.id }}/{{ quiz.id }}/" method="post"> + <form action="{{URL_ROOT}}/exam/manage/download_quiz_csv/{{ course.id }}/{{ quiz.id }}/" method="post"> {% csrf_token %} <div class="modal-body"> {% for field in csv_fields %} diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index af24778..293b02e 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -88,6 +88,8 @@ function call_skip(url) } init_val = '{{ last_attempt|escape_quotes|safe }}'; lang = "{{ question.language }}" +course_id = "{{course_id}}" +module_id = "{{module_id}}" </script> @@ -111,7 +113,7 @@ lang = "{{ question.language }}" <div id="notification" role="alert"> </div> {% endif %} - <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post" enctype="multipart/form-data"> + <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ module_id }}/{{ paper.question_paper.id }}/{{course_id}}/" method="post" enctype="multipart/form-data"> {% csrf_token %} <input type=hidden name="question_id" id="question_id" value={{ question.id }}></input> <div class="panel panel-default"> @@ -225,7 +227,7 @@ lang = "{{ question.language }}" {% if paper.question_paper.quiz.allow_skip and not paper.get_questions_unanswered|length_is:"1" %} {% if question in paper.get_questions_unanswered %} - <button class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')" name="skip" id="skip">Attempt Later <span class="glyphicon glyphicon-arrow-right"></span></button> + <button class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module_id }}/{{ paper.question_paper.id }}/{{course_id}}/')" name="skip" id="skip">Attempt Later <span class="glyphicon glyphicon-arrow-right"></span></button> {% endif %} </div> </div> diff --git a/yaksh/templates/yaksh/quit.html b/yaksh/templates/yaksh/quit.html index d18b790..b168724 100644 --- a/yaksh/templates/yaksh/quit.html +++ b/yaksh/templates/yaksh/quit.html @@ -30,8 +30,11 @@ <center><h4>Your current answers are saved.</h4></center> <center><h4> Are you sure you wish to quit the exam?</h4></center> <center><h4> Be sure, as you won't be able to restart this exam.</h4></center> - <form action="{{URL_ROOT}}/exam/complete/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post"> + <form action="{{URL_ROOT}}/exam/complete/{{ paper.attempt_number }}/{{module_id}}/{{ paper.question_paper.id }}/{{course_id}}/" method="post"> {% csrf_token %} - <center><button class="btn" type="submit" name="yes">Yes!</button> <button class="btn" type="button" name="no" onClick="window.location='{{ URL_ROOT }}/exam/start/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/'">No!</button></center> + <center> + <button class="btn" type="submit" name="yes">Yes!</button> + <button class="btn" type="button" name="no" onClick="window.location='{{ URL_ROOT }}/exam/start/{{ paper.attempt_number }}/{{module_id}}/{{ paper.question_paper.id }}/{{course_id}}'">No!</button> + </center> </form> {% endblock content %} diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index b90db18..5699a07 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -1,4 +1,5 @@ {% extends "user.html" %} +{% load custom_filters %} {% block pagetitle %} {{ title }} {% endblock %} {% block main %} {% if 'Enrolled Courses' not in title%} @@ -50,39 +51,64 @@ No Courses to display </div> <div class="row"> - {% if user in course.students.all %} + {% if user in course.students.all and course.get_learning_modules %} <table class="table table-bordered"> - <th>Quiz</th> - <th>View Answer Paper</th> - <th>Pre requisite quiz</th> - {% for quiz in course.get_quizzes %} - {% if quiz.active and quiz.course_id == course.id %} + <th>Learning Modules</th> + <th>Learning Units</th> + <th>Status</th> + {% for module in course.get_learning_modules %} <tr> - {% if not quiz.is_expired and course.active %} - <td> - <a href="{{ URL_ROOT }}/exam/start/{{quiz.questionpaper_set.get.id}}">{{ quiz.description }}</a><br> - </td> - {% else %} - <td> - {{ quiz.description }} <span class="label label-danger">Inactive</span><br> - </td> - {% endif %} <td> - {% if quiz.view_answerpaper %} - <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ quiz.questionpaper_set.get.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 %} + <a href="{{URL_ROOT}}/exam/quizzes/view_module/{{module.id}}/{{course.id}}"> + {{module.name}}</a> </td> <td> - {% if quiz.prerequisite %} - You have to pass {{ quiz.prerequisite.description }} for taking {{ paper.quiz.description }} + <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}}</span> + {% else %} + <span class="label label-warning">{{status}}</span> + {% endif %} + </td> + <td> + {% if unit.learning_type == "quiz" %} + {% if quiz.view_answerpaper %} + <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ quiz.questionpaper_set.get.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> + </td> + <td> + {% if module.status == "completed" %} + <span class="label label-info">{{module.status}}</span> {% else %} - No pre requisites for {{ quiz.description }} + <span class="label label-warning">{{module.status}}</span> {% endif %} </td> </tr> - {% endif %} {% endfor %} </table> {% endif %} diff --git a/yaksh/templates/yaksh/regrade.html b/yaksh/templates/yaksh/regrade.html index 844c6ee..77e28df 100644 --- a/yaksh/templates/yaksh/regrade.html +++ b/yaksh/templates/yaksh/regrade.html @@ -33,7 +33,7 @@ <a href="#questions_quizzes{{ course.id }}" data-toggle="collapse">Course: {{ course }}</a> </span></h4> <div id="questions_quizzes{{ course.id }}" class="collapse"> - {% for quiz in course.quiz_set.all %} + {% for quiz in course.get_quizzes %} <p><a href="#questions_questions{{ course.id }}{{ quiz.id }}" data-toggle="collapse">Quiz: {{ quiz }}</a></p> <div id="questions_questions{{ course.id }}{{ quiz.id }}" class="collapse"> {% with questionpaper=quiz.questionpaper_set.get %} @@ -69,7 +69,7 @@ <a href="#quizzes_quizzes{{ course.id }}" data-toggle="collapse">Course: {{ course }}</a> </span></h4> <div id="quizzes_quizzes{{ course.id }}" class="collapse"> - {% for quiz in course.quiz_set.all %} + {% for quiz in course.get_quizzes %} <p><a href="#quizzes_papers{{ course.id }}{{ quiz.id }}" data-toggle="collapse">Quiz: {{ quiz }}</a></p> <div id="quizzes_papers{{ course.id }}{{ quiz.id }}" class="collapse"> <ol class="list-group"> diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html new file mode 100644 index 0000000..f0d1c73 --- /dev/null +++ b/yaksh/templates/yaksh/show_video.html @@ -0,0 +1,63 @@ +{% extends "user.html" %} +{% load custom_filters %} + +{% block title %} {{ learning_module.name }} {% endblock %} + +{% block pagetitle %} {{ learning_module.name }} {% endblock %} + +{% block usersidebar %} +<br><br><br> +<center><h3>Module List</h3></center> +<ul class="list"> +{% for unit in learning_units %} +<span> +<li> +{% if unit.learning_type == "quiz" %} + <a href="{{ URL_ROOT }}/exam/start/{{unit.quiz.questionpaper_set.get.id}}/{{learning_module.id}}/{{course.id}}"> + {{ unit.quiz.description }}</a> +{% else %} + <a href="{{ URL_ROOT }}/exam/show_video/{{unit.lesson.id}}/{{learning_module.id}}/{{course.id}}"> + {{ unit.lesson.name }}</a> +{% endif %} + +{% get_unit_status course learning_module unit user as status %} +{% if status == "completed" %} + <span class="label label-info">{{status}}</span> +{% else %} + <span class="label label-warning">{{status}}</span> +{% endif %} +</li> +</span> +<br> +{% endfor %} +</ul> +{% endblock %} + +{% block main %} +{% if state == "module" %} +<div class="panel panel-default"> + <div class="panel-body"> + {{learning_module.html_data|safe}} + </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 + <span class="glyphicon glyphicon-chevron-right"> + </span> + </a> +</div> +{% else %} +<center><h3>{{lesson.name}}</h3></center> +<div class="panel panel-default"> + <div class="panel-body"> + {{lesson.html_data|safe}} + </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 + <span class="glyphicon glyphicon-chevron-right"> + </span> + </a> +</div> +{% endif %} +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/statistics_question.html b/yaksh/templates/yaksh/statistics_question.html index 31e889b..c6f4e57 100644 --- a/yaksh/templates/yaksh/statistics_question.html +++ b/yaksh/templates/yaksh/statistics_question.html @@ -6,7 +6,7 @@ <div class="row"> <div class="col-md-2"> {% for attempt in attempts %} - <p><a href="{{URL_ROOT}}/exam/manage/statistics/question/{{questionpaper_id}}/{{attempt}}">Attempt {{ attempt }}</a></p> + <p><a href="{{URL_ROOT}}/exam/manage/statistics/question/{{questionpaper_id}}/{{attempt}}/{{course_id}}">Attempt {{ attempt }}</a></p> {% endfor %} </div> <div class="col-md-9"> diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index e12a0a0..60269e4 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -26,14 +26,9 @@ Last login: {{ data.user.last_login }} </p> {% if data.papers %} -{% if data.questionpaperid %} -<p><a href="{{URL_ROOT}}/exam/manage/gradeuser/{{data.papers.0.question_paper.quiz.id}}/{{ data.user.id }}"> +<p><a href="{{URL_ROOT}}/exam/manage/gradeuser/{{data.papers.0.question_paper.quiz.id}}/{{ data.user.id }}/{{course_id}}/"> Grade/correct paper</a> </p> -{% else %} -<p><a href="{{URL_ROOT}}/exam/manage/gradeuser/{{data.papers.0.question_paper.quiz.id}}/{{ data.user.id }}"> - Grade/correct paper</a> -{% endif %} {% for paper in data.papers %} {% if forloop.counter == 2 and data.questionpaperid %} @@ -58,11 +53,11 @@ User IP address: {{ paper.user_ip }} <div class="panel-heading"> <strong> Details: {{forloop.counter}}. {{ question.summary }} - <a href="" onClick="grade_data('show_question{{question.id}}'); return false;"> Show Question </a> + <a href="" onClick="grade_data('show_question{{question.id}}{{paper.attempt_number}}'); return false;"> Show Question </a> <span class="marks pull-right"> Mark(s): {{ question.points }} </span> </strong> </div> - <div class="panel-body" id="show_question{{question.id}}" style="display: none;"> + <div class="panel-body" id="show_question{{question.id}}{{paper.attempt_number}}" style="display: none;"> <h5><u>Question:</u></h5> <strong>{{ question.description|safe }}</strong> {% if question.type == "mcq" or question.type == "mcc" %} @@ -241,7 +236,7 @@ User IP address: {{ paper.user_ip }} <hr /> {% with data.papers.0 as paper %} -<a href="{{URL_ROOT}}/exam/manage/gradeuser/{{paper.question_paper.quiz.id}}/{{ data.user.id }}/">Grade/correct paper</a> +<a href="{{URL_ROOT}}/exam/manage/gradeuser/{{paper.question_paper.quiz.id}}/{{ data.user.id }}/{{course_id}}/">Grade/correct paper</a> {% endwith %} <br /> |