diff options
author | Prabhu Ramachandran | 2018-01-02 18:07:39 +0530 |
---|---|---|
committer | GitHub | 2018-01-02 18:07:39 +0530 |
commit | e566d54239efcb46f253e324b7295a676378f656 (patch) | |
tree | 3a93f3305c8b72dc2052ca33837b9b3dadb5d7af /yaksh/templates | |
parent | 29a06f7372690796a05262fac6c428580e1f3155 (diff) | |
parent | 9bfdc506c3a54835ba9a1cd1fb70e9c2f825f0fb (diff) | |
download | online_test-e566d54239efcb46f253e324b7295a676378f656.tar.gz online_test-e566d54239efcb46f253e324b7295a676378f656.tar.bz2 online_test-e566d54239efcb46f253e324b7295a676378f656.zip |
Merge pull request #401 from FOSSEE/yaksh_video_lessons
Yaksh Learning Module
Diffstat (limited to 'yaksh/templates')
23 files changed, 1193 insertions, 280 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index 3113eb4..03c9ff8 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -18,7 +18,7 @@ </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"> @@ -46,15 +46,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 %} @@ -67,6 +67,9 @@ {% endfor %} </ul> <p>Question(s) left: <b>{{ paper.questions_left }}</b></p> + <br><br><br> + {% block learning_units %} + {% endblock %} </div> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> <div class="row"> diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html index ac9b26d..17ce23e 100644 --- a/yaksh/templates/manage.html +++ b/yaksh/templates/manage.html @@ -26,6 +26,38 @@ </div><!-- /.navbar --> </div><!-- /.container --> </nav><!-- /.navbar --> + + <!-- iframe div for video embed --> + <div id="iframe_div" style="display: none;"> + <div style="width: 640px; height: 480px; position: relative;"> + <iframe id="video_frame" width="800" height="500" frameborder="0" allowfullscreen> + </iframe> + <div style="width: 80px; height: 80px; position: absolute; opacity: 0; right: 0px; top: 0px;"> + </div> + </div> + </div> + <!-- end iframe div --> + + <!-- Dialog to video embed --> + <div id="dialog_iframe" title="Embed Video URL" style="display: none;"> + <label>Enter Url:</label> + <input id="url" name="url" type="text" required="true"> + <input type="button" id="submit_info" name="submit_info" class="btn" value="Submit" /> + <div id="error_div" style="display: none;"> + <b> Please enter URL</b> + </div> + <div id="copy_div"> + <br> + <label>Paste HTML to embed in website:</label> + <textarea rows="5" cols="35" id="html_text"></textarea> + <br> + <a class="btn btn-default" id="copy" data-toggle="tooltip" title="Copy to Clipboard"> + <i class="fa fa-clipboard" aria-hidden="true"></i> + </a> + </div> + </div> + <!-- end dialog --> + {% endblock %} {% block content %} {% block main %} diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html index e1b129f..090e93d 100644 --- a/yaksh/templates/user.html +++ b/yaksh/templates/user.html @@ -11,10 +11,9 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - - <a class="navbar-brand navbar-left" href="{{ URL_ROOT }}/exam/manage/"> + <a class="navbar-brand navbar-left" href="{{ URL_ROOT }}/exam/"> <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH" style="margin-top: -3px; margin-left:-15px"> - </img> + </img> </a> </div> <div class= "collapse navbar-collapse" id="navbar"> @@ -30,8 +29,12 @@ {% endblock %} {% block content %} <div class="row"> + <div class="col-sm-8 col-sm-offset-3 col-md-9 col-md-offset-2 main"> + <div class="row"> {% block main %} {% endblock %} + </div> + </div> </div> {% endblock %} {% if user %} diff --git a/yaksh/templates/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html index b8fc11c..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 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">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/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html new file mode 100644 index 0000000..d9bc1e7 --- /dev/null +++ b/yaksh/templates/yaksh/add_lesson.html @@ -0,0 +1,74 @@ +{% extends "manage.html" %} +{% load custom_filters %} + +{% block title %}Create/Edit Lesson{% endblock %} + +{% block script %} +<script src="{{ URL_ROOT }}/static/yaksh/js/lesson.js"></script> +<script src="https://code.jquery.com/ui/1.9.1/jquery-ui.js"></script> +{% endblock %} + +{% block css %} +<link rel="stylesheet" href="https://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css"> +{% 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 %} + {% if course_id %} + <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> + {% else %} + <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/all_lessons/");'>Cancel</button> + {% endif %} + </form> + <button class="btn" type="button" name="button" id="preview">Preview Lesson Description + </button> + <button class="btn" type="button" name="button" id="embed"> + Embed Video link + </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> + +{% 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..4efccf7 --- /dev/null +++ b/yaksh/templates/yaksh/add_module.html @@ -0,0 +1,163 @@ +{% extends "manage.html" %} +{% 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> +<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-ui.js"></script> +{% endblock %} + +{% block css %} +<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/design_course.css" /> +<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/jquery-ui/jquery-ui.css"> +{% endblock %} + +{% block content %} +{% if course_id %} + <a href="{{URL_ROOT}}/exam/manage/courses/" class="btn btn-primary"> + Back to Courses</a> +{% else %} + <a href="{{URL_ROOT}}/exam/manage/courses/all_learning_module" class="btn btn-primary"> + Back to Learning Modules</a> +{% endif %} +{% if status == "add" %} +<form name=frm id=frm action="" method="post"> + {% csrf_token %} + <br> + <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 Module Description + </button> + <button class="btn" type="button" name="button" id="embed"> + Embed Video link + </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 btn-success" 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 width="5%">Select</th> + <th>Quiz/Lesson</th> + <th width="20%">Order</th> + <th width="25%" colspan="2">Check Prerequisite + <br> + <a href="#" data-toggle="tooltip" id="prereq_msg"> + <span class="glyphicon glyphicon-question-sign"> + </span> What's This + </a> + </th> + </tr> + <tr> + <th scope="row"> </th> + <td> </td> + <td> </td> + <th>Currently</th> + <th>Change</th> + </tr> + </tr> + {% for unit in learning_units %} + <tr> + <ul class="inputs-list"> + <td> + <input type="checkbox" name="delete_list" value="{{unit.id}}"> + </td> + {% if unit.type == "quiz" %} + <td><span>{{ unit.quiz.description }} ({{unit.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.type}}) + </span></td> + <td><input type="number" name="order" data-item-id="{{unit.id}}" value="{{unit.order}}" step="1"></td> + {% endif %} + <td> + {% if unit.check_prerequisite %} + Yes + {% else %} + No + {% endif %} + </td> + <td> + <input type="checkbox" name="check_prereq" value="{{unit.id}}"> + </td> + </ul> + </tr> + {% endfor %} + </table> + </div> + </div> + <br> + <center> + <button id="Remove" name="Remove" class="btn btn-danger" type="submit">Remove from Module</button> + <button id="Change" name="Change" class="btn btn-info" type="submit"> Change Order</button> + <button id="Change" name="Change_prerequisite" class="btn btn-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 f0852f3..d0b7e4d 100644 --- a/yaksh/templates/yaksh/complete.html +++ b/yaksh/templates/yaksh/complete.html @@ -6,7 +6,7 @@ width="80" alt="YAKSH"></img>{% endblock %} {% csrf_token %} {% if paper.questions_answered.all or paper.questions_unanswered.all %} <center><table class="table table-bordered" > - <caption> Submission Status </caption> + <caption> <center><h3>Submission Status</h3> </center></caption> <thead> <tr> <th> Question</th> @@ -30,8 +30,25 @@ width="80" alt="YAKSH"></img>{% endblock %} {% endfor %} </table></center> {% endif %} - <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><h3>{{message}}</h3></center> + <center> + <br> + {% if not module_id %} + <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 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"> + </span> + </a> + {% else %} + <a href="{{URL_ROOT}}/exam/next_unit/{{course_id}}/{{module_id}}/{{learning_unit.id}}" class="btn btn-info"> Next Unit + <span class="glyphicon glyphicon-chevron-right"> + </span> + </a> + {% endif %} + {% endif %} + </center> {% endblock content %} diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html index e0731f9..cf0ab18 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/course_modules.html b/yaksh/templates/yaksh/course_modules.html new file mode 100644 index 0000000..8e6f5a6 --- /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.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.type|title}} + </td> + <td> + {% if unit.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/courses.html b/yaksh/templates/yaksh/courses.html index e09a9cc..0efa72a 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -1,173 +1,449 @@ {% 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">My 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/">Add/View Quizzes</a> + </li> + <li> + <a href="{{URL_ROOT}}/exam/manage/courses/all_lessons/">Add/View Lessons</a> + </li> + <li> + <a href="{{URL_ROOT}}/exam/manage/courses/all_learning_module"> + Add/View Modules</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>Modules</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/courses/designcourse/{{course.id}}/">Design Course + </a> + </li> + <br> + <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>Module</th> + <th>Module Design</th> + <th>Lessons/Quizzes</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.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>Modules</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> + <div class="col-md-333" style="width: auto;"> + <input type="checkbox" name="remove" value="{{ teacher.id }}"> + {{ teacher.get_full_name }} + </div> + </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/courses/designcourse/{{course.id}}/">Design Course + </a> + </li> + <br> + <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>Module</th> + <th>Module Design</th> + <th>Lessons/Quizzes</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.type == "quiz" %} + <a href="{{URL_ROOT}}/exam/manage/addquiz/{{unit.quiz.id}}/{{course.id}}"> + {{unit.quiz.description}}</a> {% else %} - <span class="label label-danger">Closed</span> + <a href="{{URL_ROOT}}/exam/manage/courses/edit_lesson/{{unit.lesson.id}}/{{course.id}}"> + {{unit.lesson.name}}</a> {% 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> + </li> + </ul> + {% endfor %} + </td> + </tr> + {% endfor %} <!-- end for modules --> + {% else %} + No learning modules + {% endif %} + </table> + </td> + {% endfor %} <!-- end for courses --> + </tr> + </table> +</div> +{% endif %} +</div> +{% endif %} +<!-- End if all Courses --> + +<!-- Show all Quizzes --> +<div id="all_quizzes" > +<div class="col-md-offset-2 main"> +{% 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 %} + <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> + {% endif %} +{% endif %} +</div> + +<!-- Show all lessons --> + +<div id="all_lessons"> + <div class="col-md-offset-2 main"> +{% 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 %} + <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 class="col-md-offset-2 main"> +<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 %} + <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.type == 'quiz' %} + {{unit.quiz.description}} {% else %} - <p>No Question Paper - <a href="#" onClick='location.replace("{{URL_ROOT}}/exam/manage/quiz/designquestionpaper/{{ quiz.id }}/");'>Add</a> - </p> + {{unit.lesson.name}} {% endif %} - {% endfor %} - </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> + </ul> + {% endfor %} <!-- end for learning units --> + {% else %} + No Learning units + {% endif %} + </td> + {% endfor %} <!-- end for modules --> + </tr> + </table> </div> - <br><br> - {% endfor %} -{% else %} - <center><h4> No new Courses allotted</h4></center> - <br><br> + {% 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..ee530e0 --- /dev/null +++ b/yaksh/templates/yaksh/design_course_session.html @@ -0,0 +1,125 @@ +{% 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 %} +<a href="{{URL_ROOT}}/exam/manage/courses/" class="btn btn-primary"> + Back to Courses +</a> +<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>Modules</th> + <th>Lessons/Quizzes</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.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 btn-success" 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:</b></u></p> + <div id="fixed-added"> + <table id="course-details" class="table table-bordered"> + <tr> + <th width="5%">Select</th> + <th>Module</th> + <th width="20%">Order</th> + <th width="25%" colspan="2">Check Prerequisite + <br> + <a href="#" data-toggle="tooltip" id="prereq_msg"> + <span class="glyphicon glyphicon-question-sign"> + </span> What's This + </a> + </th> + </tr> + <tr> + <th scope="row"> </th> + <td> </td> + <td> </td> + <th>Currently</th> + <th>Change</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> + {% if module.check_prerequisite %} + Yes + {% else %} + No + {% endif %} + </td> + <td> + <input type="checkbox" name="check_prereq" value="{{module.id}}"> + </td> + </ul> + </tr> + {% endfor %} + </table> + </div> + </div> + <br> + <center> + <button id="Remove" name="Remove" class="btn btn-danger" type="submit">Remove from course</button> + <button id="Change" name="Change" class="btn btn-info" type="submit"> Change Order</button> + <button id="Change" name="Change_prerequisite" class="btn btn-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 facb579..93f00e0 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -33,7 +33,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 %} @@ -51,7 +51,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> @@ -94,7 +94,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 %} @@ -140,11 +140,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..6bd2fab 100644 --- a/yaksh/templates/yaksh/intro.html +++ b/yaksh/templates/yaksh/intro.html @@ -20,22 +20,27 @@ <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"> - {% 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> + {% 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"> {% 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.id}}/" 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..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,31 +10,48 @@ <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 paper, answer_papers, users_passed, users_failed in users_per_paper %} + <th>Courses</th> + <th>Quizzes</th> + {% for course in courses %} <tr> <td> - {{ paper.quiz.course.name }} + <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}"> + {{ course }} + </a> </td> <td> - <a href="{{URL_ROOT}}/exam/manage/monitor/{{ paper.quiz.id }}/">{{ paper.quiz.description }}</a> - </td> - <td> - {{ answer_papers|length }} 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 %} </table> + <hr> <center> <a href="{{URL_ROOT}}/exam/manage/add_course" class="btn btn-default"> @@ -46,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> @@ -70,7 +88,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 35125f4..d65e513 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -64,7 +64,6 @@ function updateClock(){ clock.innerHTML = "<center><strong>" + hh + ":" + mm + ":" + ss + "</strong></center>"; } } - var clock = document.getElementById("time_left"); updateClock(); var timeinterval = setInterval(updateClock,1000); @@ -87,6 +86,8 @@ function call_skip(url) } init_val = '{{ last_attempt|escape_quotes|safe }}'; lang = "{{ question.language }}" +course_id = "{{course.id}}" +module_id = "{{module.id}}" question_type = "{{ question.type }}" </script> @@ -95,6 +96,40 @@ question_type = "{{ question.type }}" {% block onload %} onload="updateTime();" {% endblock %} +{% block learning_units %} +<center><h3>Lessons/Quizzes</h3></center> +<ul class="list"> +{% for unit in module.get_learning_units %} +<span> +<li> + +{% get_unit_status course module unit user as status %} + +{% if unit.quiz.id == paper.question_paper.quiz.id %} + <span class=" glyphicon glyphicon-edit" data-toggle="tooltip" title="Currently on"></span> +{% endif %} + +{% if unit.type == "quiz" %} + <a href="{{ URL_ROOT }}/exam/start/{{unit.quiz.questionpaper_set.get.id}}/{{module.id}}/{{course.id}}"> + {{ unit.quiz.description }} + </a> +{% else %} + <a href="{{ URL_ROOT }}/exam/show_lesson/{{unit.lesson.id}}/{{module.id}}/{{course.id}}"> + {{ unit.lesson.name }} + </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> +<br> +{% endfor %} +</ul> +{% endblock %} + {% block main %} <p id="status"></p> {% if notification %} @@ -111,7 +146,7 @@ question_type = "{{ question.type }}" <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 +260,7 @@ question_type = "{{ question.type }}" {% 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 %} {% endif %} </div> diff --git a/yaksh/templates/yaksh/quit.html b/yaksh/templates/yaksh/quit.html index ef5e6a4..78a9b47 100644 --- a/yaksh/templates/yaksh/quit.html +++ b/yaksh/templates/yaksh/quit.html @@ -4,7 +4,7 @@ width="80" alt="YAKSH"></img> {% endblock %} {% block content %} <center><table class="table table-bordered" > - <caption> Submission Status </caption> + <caption> <center><h3>Submission Status</h3> </center> </caption> <thead> <tr> <th> Question</th> @@ -31,8 +31,11 @@ width="80" alt="YAKSH"></img> {% endblock %} <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..cf08752 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -1,9 +1,15 @@ {% extends "user.html" %} +{% block title %} Student Dashboard {% endblock %} {% block pagetitle %} {{ title }} {% endblock %} {% block main %} + {% if msg %} + <div class="alert alert-warning" role="alert"> + <center>{{ msg }}</center> + </div> + {% endif %} {% if 'Enrolled Courses' not in title%} <div class="row well"> - <form action="{{ URL_ROOT }}/exam/quizzes/" method="post" id="custom-search-form" class="form-search form-horizontal pull-right"> + <form action="{{ URL_ROOT }}/exam/quizzes/" method="post" id="custom-search-form" class="form-search form-horizontal"> {% csrf_token %} <div class="col-md-12"> <div class="input-group"> @@ -26,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 %} @@ -49,45 +59,6 @@ No Courses to display </div> </div> - <div class="row"> - {% if user in course.students.all %} - <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 %} - <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 %} - </td> - <td> - {% if quiz.prerequisite %} - You have to pass {{ quiz.prerequisite.description }} for taking {{ paper.quiz.description }} - {% else %} - No pre requisites for {{ quiz.description }} - {% endif %} - </td> - </tr> - {% endif %} - {% endfor %} - </table> - {% endif %} - </div> - {% if course.instructions %} <div class="row"> <div class="panel-group"> 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..0490697 --- /dev/null +++ b/yaksh/templates/yaksh/show_video.html @@ -0,0 +1,90 @@ +{% extends "user.html" %} +{% load custom_filters %} + +{% block title %} {{ learning_module.name|title }} {% endblock %} + +{% block pagetitle %} {{ learning_module.name|title }} {% endblock %} + +{% block main %} +<div class="col-sm-3 col-md-2 sidebar"> + <center><h3>Lessons/Quizzes</h3></center> + <ul class="list"> + {% for unit in learning_units %} + <span> + <li> + {% get_unit_status course learning_module unit user as status %} + + {% if unit.id == current_unit.id %} + <span class="glyphicon glyphicon-edit" data-toggle="tooltip" title="Currently on"> + </span> + {% endif %} + {% if unit.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_lesson/{{unit.lesson.id}}/{{learning_module.id}}/{{course.id}}"> + {{ unit.lesson.name }} + </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> + <br> + {% endfor %} + </ul> +</div> +{% if msg %} +<center> +<div class="col-md-12 col-md-offset-1 main"> +<div class="alert alert-warning">{{msg}}</div></div> +</center> +{% endif %} +<div class="col-md-12 col-md-offset-1 main"> +{% if state == "module" %} +<div class="panel panel-default" style="border: none; box-shadow: none;"> + <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-info">First Unit + <span class="glyphicon glyphicon-chevron-right"> + </span> + </a> +</div> +{% else %} +<center><h3>{{lesson.name}}</h3></center> +<div class="panel panel-default" style="border: none; box-shadow: none;"> + <div class="panel-body"> + {{lesson.html_data|safe}} + </div> +</div> +{% if lesson.get_files %} + <div class="panel" style="border-width: 10px;"> + <center> + <div class="alert alert-success"> + <h4>Files for this lesson</h4> + </div> + {% for f in lesson.get_files %} + <h4> + <b>{{forloop.counter}}.</b> + <a href="{{f.file.url}}">{{ f.file.name|file_title }}</a> + </h4><br> + {% endfor %} + </center> + </div> +{% endif %} +<div style="text-align: center;"> + <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> +</div> +{% endif %} +</div> +{% 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 8eea3f3..45867d2 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -27,14 +27,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 %} @@ -59,11 +54,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" %} @@ -242,7 +237,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 /> |