diff options
Diffstat (limited to 'yaksh/templates')
69 files changed, 6170 insertions, 3895 deletions
diff --git a/yaksh/templates/404.html b/yaksh/templates/404.html index d4777f2..f8dc1d0 100644 --- a/yaksh/templates/404.html +++ b/yaksh/templates/404.html @@ -1,6 +1,13 @@ {% extends "base.html" %} -{% block pagetitle %} <h2>Yaksh</h2> {% endblock %} +{% block pagetitle %} +<div class="yakshnav fixed-top" style=" padding-top: 0.5%;padding-bottom: 0.5%;"> + <a class="navbar-brand" href="{{ URL_ROOT }}/exam/" > + <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> + </img> + </a> +</div> +{% endblock %} {% block content %} <center> @@ -8,6 +15,6 @@ It seems that you have encountered an error <br> Please contact your administrator <br><br> -<div class="alert alert-danger">Error Message:- {{exception}}</div> +<div class="alert alert-danger animated flash col-md-8">Error Message:- {{exception}}</div> </center> {% endblock %} diff --git a/yaksh/templates/500.html b/yaksh/templates/500.html index d02721f..f2455d4 100644 --- a/yaksh/templates/500.html +++ b/yaksh/templates/500.html @@ -1,7 +1,18 @@ {% extends "base.html" %} +{% block pagetitle %} +<div class="yakshnav fixed-top" style=" padding-top: 0.5%;padding-bottom: 0.5%;"> + <a class="navbar-brand" href="{{ URL_ROOT }}/exam/" > + <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> + </img> + </a> +</div> +{% endblock %} {% block content %} +<br><br> +<center> Internal Server error.<br /> This event will be reported.<br /> -Sorry for the inconvinience. +Sorry for the inconvenience. +</center> {% endblock %} diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index 08c4f70..c70c265 100644 --- a/yaksh/templates/base.html +++ b/yaksh/templates/base.html @@ -1,3 +1,4 @@ +{% load static %} <!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]--> @@ -14,12 +15,11 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="apple-touch-icon" href="apple-touch-icon.png"> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/bootstrap.min.css"> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/font-awesome.css" type="text/css" /> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/theme.css" type="text/css" /> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/sticky-footer.css" type="text/css" /> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" /> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/ontop.css" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/bootstrap.min.css' %}"> + <link rel="stylesheet" href="{% static 'yaksh/css/custom.css' %}" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/animate.min.css' %}" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/font-awesome.css' %}" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/ontop.css' %}" type="text/css" /> {% block meta %} @@ -30,40 +30,45 @@ {% block css %} {% endblock %} - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.9.1.min.js"></script> - <script src="{{ URL_ROOT }}/static/yaksh/js/bootstrap.min.js"></script> + + + + <script language="JavaScript" type="text/javascript" src="{% static 'yaksh/js/popper.min.js' %}"></script> + <script language="JavaScript" type="text/javascript" src="{% static 'yaksh/js/jquery-3.3.1.min.js' %}"></script> + <script language="JavaScript" type="text/javascript" src="{% static 'yaksh/js/bootstrap.min.js' %}"></script> + <script language="JavaScript" type="text/javascript" src="{% static 'yaksh/js/wow.min.js' %}"></script> + + <script> + new WOW().init(); + </script> {% block script %} {% endblock %} </head> -<body {% block onload %} {% endblock %}> +<body {% block onload %} {% endblock %} class="yaksh"> + <div id="ontop"> <div id="state"> - Checking... - </div> - </div> + Checking...<img src="{% static 'yaksh/images/check_answer.gif' %}"/> + </div></div> + + + {% block nav %} {% endblock %} - <div class="container"> - <div class="content"> + + <div class="base-content"> <div class="header"> - <h3><center>{% block pagetitle %}{% endblock pagetitle %}</center></h2> + <h3><center>{% block pagetitle %}{% endblock pagetitle %}</center></h3> </div> - {% block content %} - {% endblock %} + <h4><center>{% block subtitle %}{% endblock %}</center></h4> + {% block content %} + {% endblock %} </div> - </div> - <div class="container"> - <footer class="footer" id="footer_div"> - <div class="logged_user_info" align="center" > - {% block info %} - {% endblock %} - </div> - <div class="container"> - <p align="center">Developed by FOSSEE group, IIT Bombay</p> - </div> - </footer> - </div> + + + {% block footer %} + {% endblock %} </body> </html> diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index 012adbe..a773076 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -1,86 +1,123 @@ {% extends "base.html" %} {% load custom_filters %} -{% block css%} - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" /> -{% endblock %} +{% load static %} + +{% block title %}{{ paper.question_paper.quiz.description }}{% endblock %} + {% block nav %} - <nav class="navbar navbar-fixed-top navbar-inverse"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a class="navbar-brand" href="#"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH" style="margin-top: -3px; margin-left:-15px"> - </img> - </a> +<div class="container-fluid"> + <nav class="navbar navbar-expand-sm navbar-dark bg-primary fixed-top"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div class="collapse navbar-collapse" id="navbarColor01"> + <div class="row ml-auto"> + <div class="col-md-4"> + <span class="time-div nav-item" id="time_left"></span> </div> - <div class= "collapse navbar-collapse" id="navbar"> - <form id="logout" action="{{URL_ROOT}}/exam/quit/{{ paper.attempt_number }}/{{module.id}}/{{ paper.question_paper.id }}/{{course.id}}/" method="post" class="pull-right"> + <div class="col-md-7"> + <form id="logout" action="{% url 'yaksh:quit_quiz' paper.attempt_number module.id paper.question_paper.id course.id %}" method="post" class="ml-auto"> {% csrf_token %} - <ul class="nav navbar-nav navbar"> - <li style="padding: 10px"><button class="btn btn-danger btn-sm" type="submit" name="quit"> - {% if paper.questions_unanswered.all %} - Quit {{ quiz_type }} - {% else %} - Finish {{ quiz_type }} - {% endif %} - <span class="glyphicon glyphicon-off"></span></button></li> - </ul> + <span class="nav-item"><button class="btn btn-danger btn-lg" type="submit" name="quit"> + {% if paper.questions_unanswered.all %} + Quit {{quiz_type}} + {% else %} + Finish {{quiz_type}} + {% endif %} + <i class="fa fa-power-off"></i></button></span> </form> - <div class="time-div" id="time_left"></div> - </div><!-- /.navbar --> - </div><!-- /.container --> - </nav><!-- /.navbar --> + </div> + </div> + </div> + </nav> +</div> {% endblock %} {% block content %} <div class="container-fluid"> - <div class="col-sm-3 col-md-2 sidebar"> - <p> Question Navigator </p> - <ul class="pagination pagination-sm"> - {% for qid in paper.get_all_ordered_questions %} - {%if paper.question_paper.quiz.allow_skip %} - {% if qid in paper.get_questions_unanswered %} - {% 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 }}/{{ 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 }}/{{ 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 }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" - title="{{ qid.description }}">{{ forloop.counter }}</a></li> - {% endif %} - {% else %} - {% if qid.id == question.id %} - <li class="active"><a style="width:25%" data-toggle="tooltip" title="{{ qid.description|striptags }}">{{ forloop.counter }}</a></li> - {% elif 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 }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" - title="{{ qid.description }}">{{ forloop.counter }}</a></li> - {% else %} - <li class="disabled"><a style="width:25%" data-toggle="tooltip" title="{{ qid.description|striptags }}">{{ forloop.counter }}</a></li> - {% endif %} - {% endif %} - {% 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"> - {% block main %} - {% endblock %} - </div> - </div> - </div> + <div class="row"> + <!-- Side Component --> + <div class="col-md-3 bg-secondary" style="overflow-x: scroll;"> + <br> + <center> + <b>{{course.name}}</b><br> + {{ paper.question_paper.quiz.description }}</h4> + </center> + <hr> + <center><p><b><u>Question Navigator</b></u></p></center> + <br> + <div class="justify-content-center"> + {% for qid in paper.get_all_ordered_questions %} + {% if paper.question_paper.quiz.allow_skip %} + {% if qid in paper.get_questions_unanswered %} + {% if qid.id == question.id %} + <a class="active btn btn-outline-primary " href="#"data-toggle="tooltip" + title="{{ qid.description|striptags|truncatechars:100 }}" style="width: 50px" + 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> + {% else %} + <a class=" btn btn-outline-primary " href="#" data-toggle="tooltip" title="{{ qid.description|striptags|truncatechars:100 }}" style="width: 50px" + 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> + {% endif %} + {% endif %} + {% if qid in paper.get_questions_answered %} + <a class="btn btn-success" href="#" data-toggle="tooltip" style="width: 50px" + 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|striptags|truncatechars:100 }}">{{ forloop.counter }}</a> + {% endif %} + {% else %} + {% if qid.id == question.id %} + <a class="active btn btn-outline-primary" data-toggle="tooltip" title="{{ qid.description|striptags|truncatechars:100 }}" style="width: 50px">{{ forloop.counter }}</a> + {% elif qid in paper.get_questions_answered %} + <a class="btn btn-success" href="#" data-toggle="tooltip" style="width: 50px" + 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|striptags|truncatechars:100 }}">{{ forloop.counter }}</a> + {% else %} + <a class="btn btn-outline-primary" style="width: 50px" data-toggle="tooltip" title="{{ qid.description|striptags|truncatechars:100 }}">{{ forloop.counter }}</a> + {% endif %} + {% endif %} + {% endfor %} + </div> + <br> + <p><span class="btn btn-success"></span> Attempted question(s)</p> + <p><span class="btn btn-primary"></span> Current question</p> + <p><span class="btn btn-outline-primary"></span> Unattempted question(s)</p> + <br> + <div> + <p class="text-center">Question(s) left: <b>{{ paper.questions_left }}</b></p> + </div> + <br> + <div> + <table class="table table-bordered table-responsive-sm"> + <thead> + <tr> + <th>Category</th> + <th>Question No.</th> + </tr> + </thead> + <tbody> + {% for category, question_number in paper.get_categorized_question_indices.items %} + <tr> + <td> + {{category}} + </td> + <td> + {{question_number| join:", "}} + </td> + </tr> + {% endfor %} + </tbody> + </table> + <br> + </div> + </div> + <!-- Main Component --> + <div class="col-md-9"> + <br> + {% block main %} + {% endblock %} + </div> + </div> +</div> {% endblock %} diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html index 2889905..8e74494 100644 --- a/yaksh/templates/manage.html +++ b/yaksh/templates/manage.html @@ -1,65 +1,88 @@ {% extends "base.html" %} +{% load static %} + {% block nav %} -<nav class="navbar navbar-fixed-top navbar-inverse"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a class="navbar-brand navbar-left" href="{{ URL_ROOT }}/exam/manage/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH" style="margin-top: -3px; margin-left:-15px"></img> - </a> - </div> - <div id="navbar" class="collapse navbar-collapse"> - <ul class="nav navbar-nav navbar-right"> - <li><a href="{{ URL_ROOT }}/exam/manage/questions">Questions</a></li> - <li><a href="{{ URL_ROOT }}/exam/manage/courses">Courses</a></li> - <li><a href="{{ URL_ROOT }}/exam/manage/monitor">Monitor</a></li> - <li><a href="{{ URL_ROOT }}/exam/manage/gradeuser">Grade User</a></li> - <li><a href="{{ url_root }}/exam/manage/grader"> Regrade </a></li> - <li><a href="{{ URL_ROOT }}/exam/reset/changepassword">Change Password</a></li> - <li><a href="{{ URL_ROOT }}/exam/viewprofile"> {{ user.get_full_name.title }} </a></li> - <li><a href="{{URL_ROOT}}/exam/logout/" id="logout">Logout</a></li> - </ul> - </div><!-- /.navbar --> - </div><!-- /.container --> - </nav><!-- /.navbar --> +<nav class="navbar navbar-expand-sm navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> - <!-- 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="640" height="480" frameborder="0" allowfullscreen> - </iframe> - <div style="width: 80px; height: 80px; position: absolute; opacity: 0; right: 0px; top: 0px;"> - </div> - </div> + <div class="collapse navbar-collapse" id="navbarColor01"> + <ul class="navbar-nav mr-auto"> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:show_questions' %}">Questions</a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:courses' %}">Courses</a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:monitor' %}">Monitor</a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:grade_user' %}">Grade User</a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:grader' %}"> Regrade </a></li> + </ul> + <ul class="navbar-nav ml-auto"> + <li class="nav-item dropdown my-lg-0" style="font-size: 1.2rem"> + <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#">{{user.get_full_name|title}} + </a> + <div class="dropdown-menu dropdown-menu-right"> + <a class="dropdown-item" href="{% url 'yaksh:edit_profile' %}"> + <i class="fa fa-user"></i> My Profile + </a> + <div class="dropdown-divider"></div> + {% if user.profile.is_moderator %} + <a class="dropdown-item" href="{% url 'yaksh:toggle_moderator' %}"><i class="fa fa-exchange"></i> + Switch To Student + </a> + <div class="dropdown-divider"></div> + {% endif %} + <a class="dropdown-item" href="{% url 'password_change' %}"> + <i class="fa fa-key"></i> Change Password + </a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" id="user_logout" href="{% url 'yaksh:logout' %}"> + <i class="fa fa-sign-out"></i> Logout + </a> + </div> + </li> + </ul> </div> - <!-- end iframe div --> +</nav> + +<!-- iframe div for video embed --> +<div id="iframe_div" style="display: none;"> + <iframe class="embed-responsive-item" id="video_frame" width="640" height="480" allowfullscreen> + </iframe> +</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> +<!-- Dialog to video embed --> +<div id="dialog_iframe" title="Embed Video URL" style="display: none;"> + <div class="input-group mb-3"> + <input id="url" name="url" type="text" required="true" class="form-control" placeholder="Enter video link"> + <div class="input-group-append"> + <input type="button" id="submit_info" name="submit_info" class="btn btn-primary" value="Submit" /> </div> - <!-- end dialog --> + </div> + <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 id="html_text" class="form-control" rows="5" cols="100"></textarea> + <br> + <a class="btn btn-secondary" 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 %} +<div class="container"> {% block main %} {% endblock %} +</div> +{% endblock %} + +{% block footer %} {% endblock %} diff --git a/yaksh/templates/registration/password_change_done.html b/yaksh/templates/registration/password_change_done.html index 14df20c..34045d4 100644 --- a/yaksh/templates/registration/password_change_done.html +++ b/yaksh/templates/registration/password_change_done.html @@ -1,15 +1,31 @@ {% extends "base.html" %} +{% load static %} +{% block pagetitle %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} +{% block title %} Change Password {% endblock %} -{% block pagetitle %}Password change successful{% endblock %} {% block script %} <script type="text/javascript"> - window.setTimeout(function() - { - location.href="{{ URL_ROOT }}/exam/" - }, 2000); + window.setTimeout(function() + { + location.href="{% url 'yaksh:index' %}" + }, 2000); </script> {% endblock %} {% block content %} -<h3>Your password has been changed successfully.</h3> -<h4>Redirecting ...</h4> +<br><br> +<center> + <div class="container row align-items-center"> + <div class="col"> + <h3>Your password has been changed successfully.</h3> + <h4>Redirecting ...</h4> + </div> + </div> +<div class="col"><img src="{% static 'yaksh/images/profile_change.gif' %}"></div> +</center> {% endblock %} diff --git a/yaksh/templates/registration/password_change_form.html b/yaksh/templates/registration/password_change_form.html index b618410..37f6e93 100644 --- a/yaksh/templates/registration/password_change_form.html +++ b/yaksh/templates/registration/password_change_form.html @@ -1,16 +1,99 @@ {% extends "base.html" %} +{% load static %} + <!DOCTYPE html> -{% block pagetitle %} Change Password {% endblock %} +{% block nav %} +<div class="container-fluid"> + <nav class="navbar navbar-expand-sm navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div class="collapse navbar-collapse" id="navbarColor01"> + <ul class="navbar-nav ml-auto"> + <li class="nav-item dropdown my-lg-0" style="font-size: 1.2rem"> + <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#">{{user.get_full_name|title}} + </a> + <div class="dropdown-menu dropdown-menu-right"> + <a class="dropdown-item" href="{% url 'yaksh:edit_profile' %}"> + <i class="fa fa-user"></i> My Profile + </a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" href="{% url 'password_change' %}"> + <i class="fa fa-key"></i> Change Password + </a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" id="user_logout" href="{% url 'yaksh:logout' %}"> + <i class="fa fa-sign-out"></i> Logout + </a> + </div> + </li> + </ul> + </div> + </nav> +</div> +{% endblock %} +{% block pagetitle %} +Change Password +{% endblock %} +{% block title %} Change Password {% endblock %} +{% block script %} +<script type="text/javascript"> + $(document).ready(function() + { + $("#id_old_password").addClass("form-control"); + $("#id_new_password1").addClass("form-control"); + $("#id_new_password2").addClass("form-control"); + }); +</script> +{% endblock %} {% block content %} <form action="" method="post" > - {% csrf_token %} - <center> - <table class=span1> - {{ form }} - </table> - </center> - <center><button class="btn" type="submit">Change Password</button> - <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/");'>Cancel</button></center> + {% csrf_token %} + <center> + <div class="container col-md-6"> + <table class="table table-responsive-sm"> + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + {% for field in form %} + <tr> + <td>{{ field.label }}</td> + <td>{{ field }} <small>{{ field.help_text }}</small></td> + </tr> + {% endfor %} + </table> + </div> + </center> + <br> + <center> + <button class="btn btn-success btn-lg" type="submit"> + Change + </button> + <a href="{% url 'yaksh:index' %}" class="btn btn-primary btn-lg"> + Cancel + </a> + </center> </form> {% endblock content %} diff --git a/yaksh/templates/registration/password_reset_complete.html b/yaksh/templates/registration/password_reset_complete.html index 0c1bae2..ddf94a6 100644 --- a/yaksh/templates/registration/password_reset_complete.html +++ b/yaksh/templates/registration/password_reset_complete.html @@ -1,6 +1,21 @@ {% extends "base.html" %} -{% block pagetitle %}Password reset complete{% endblock %} +{% load static %} + +{% block title %} Forgot Password {% endblock %} + +{% block nav %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} + {% block content %} -<p>Your password has been reset. </p> -<p><a href="{{ login_url }}">Log in</a></p> +<center> +<div class="container"> + <p>Your password has been reset. </p> + <p><a href="{{ login_url }}" class="btn btn-success btn-lg">Log in</a></p> + </div> +</center> {% endblock %} diff --git a/yaksh/templates/registration/password_reset_confirm.html b/yaksh/templates/registration/password_reset_confirm.html index 1b0a1b7..02f1228 100644 --- a/yaksh/templates/registration/password_reset_confirm.html +++ b/yaksh/templates/registration/password_reset_confirm.html @@ -1,15 +1,68 @@ {% extends "base.html" %} -{% block pagetitle %}Reset Password{% endblock %} +{% load static %} -{% block content %} +{% block title %} Forgot Password {% endblock %} + +{% block nav %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} + +{% block script %} +<script type="text/javascript"> + $(document).ready(function() + { + $("#id_new_password1").addClass("form-control"); + $("#id_new_password2").addClass("form-control"); + }); +</script> +{% endblock %} + +{% block content %} +<br><br> +<center><h4>Reset Password</h4> + <div class="container col-md-6"> {% if validlink %} - <p>Please enter your new password twice so we can verify you typed it in correctly</p>. + <p>Please enter your new password twice so we can verify you typed it in correctly + </p>. <form method="post"> {% csrf_token %} - {{ form.as_p }} - <button class= "btn" type="submit">Submit</button> + <table class="table table-responsive-sm"> + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + {% for field in form %} + <tr> + <td>{{ field.label }}</td> + <td>{{ field }} <small>{{ field.help_text }}</small></td> + </tr> + {% endfor %} + </table> + <button class= "btn btn-success btn-lg" type="submit">Submit</button> </form> {% else %} <p>This reset link is no longer valid!</p> {% endif %} + </div> +</center> {% endblock %} diff --git a/yaksh/templates/registration/password_reset_done.html b/yaksh/templates/registration/password_reset_done.html index 1ac7b60..94138dd 100644 --- a/yaksh/templates/registration/password_reset_done.html +++ b/yaksh/templates/registration/password_reset_done.html @@ -1,3 +1,22 @@ {% extends "base.html" %} -{% block title %}Password reset successful{% endblock %} -{% block pagetitle %} Instruction for setting new password has been mailed to your registered email address {% endblock %} +{% load static %} +{% block title %} Forgot Password {% endblock %} + +{% block nav %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} + +{% block content %} +<center> +<h2>Password reset successful</h2> +<div class="alert alert-success col-md-8"> +Instruction for setting new password has been mailed to your registered email address +</div> +<br> +<a class="btn btn-primary btn-lg" href="{% url 'yaksh:login' %}">Go to Login</a> +</center> +{% endblock %} diff --git a/yaksh/templates/registration/password_reset_form.html b/yaksh/templates/registration/password_reset_form.html index 0444584..acee288 100644 --- a/yaksh/templates/registration/password_reset_form.html +++ b/yaksh/templates/registration/password_reset_form.html @@ -1,10 +1,43 @@ {% extends "base.html" %} -{% block pagetitle %} Email will be send to the registered email address {% endblock %} +{% load static %} + +{% block title %} Forgot Password {% endblock %} + +{% block nav %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} + {% block content %} -<form action="" method="post"> - {% csrf_token %} - {{ form }} - <button class="btn" type="submit">Request</button> - <a class="btn" href="{{URL_ROOT}}/exam/login/">Cancel</a> -</form> +<center> +<h4>Enter your registered email address to reset your password</h4> +<div class="container"> + <div class="row justify-content-center"> + <div class="col-md-6 col-md-offset-6"> + <div class="card border-primary"> + <div class="card-header"><h3>Forgot Password?</h3></div> + <div class="card-body"> + <div class="form-group"> + <form action="" method="post"> + {% csrf_token %} + + {{ form }} + <br><br> + <button class="btn btn-success btn-lg" type="submit"> + Request + </button> + <a href="{% url 'yaksh:index' %}" class="btn btn-primary btn-lg"> + Cancel + </a> + </form> + </div> + </div> + </div> + </div> + </div> +</div> +</center> {% endblock content %} diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html index 090e93d..4e3974b 100644 --- a/yaksh/templates/user.html +++ b/yaksh/templates/user.html @@ -1,44 +1,53 @@ {% extends "base.html" %} -{% block css%} - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" /> -{% endblock %} +{% load static %} {% block nav %} - <nav class="navbar navbar-fixed-top navbar-inverse"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <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> - </a> +<div class="container-fluid"> + <nav class="navbar navbar-expand-sm navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div class="collapse navbar-collapse" id="navbarColor01"> + <ul class="navbar-nav mr-auto"> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:index' %}"><i class="fa fa-home" style="size: 18px"></i> Home</a></li> + </ul> + <ul class="navbar-nav ml-auto"> + <li class="nav-item dropdown my-lg-0" style="font-size: 1.2rem"> + <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#">{{user.get_full_name|title}} + </a> + <div class="dropdown-menu dropdown-menu-right"> + <a class="dropdown-item" href="{% url 'yaksh:edit_profile' %}"> + <i class="fa fa-user"></i> My Profile + </a> + <div class="dropdown-divider"></div> + {% if user.profile.is_moderator %} + <a class="dropdown-item" href="{% url 'yaksh:toggle_moderator' %}"><i class="fa fa-exchange"></i> + Switch To Moderator + </a> + <div class="dropdown-divider"></div> + {% endif %} + <a class="dropdown-item" href="{% url 'password_change' %}"> + <i class="fa fa-key"></i> Change Password + </a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" id="user_logout" href="{% url 'yaksh:logout' %}"> + <i class="fa fa-sign-out"></i> Logout + </a> + </div> + </li> + </ul> </div> - <div class= "collapse navbar-collapse" id="navbar"> - <ul class="nav navbar-nav navbar-right"> - <li><a href="{{ URL_ROOT }}/exam/quizzes/enrolled/"> Enrolled Courses </a></li> - <li><a href="{{ URL_ROOT }}/exam/reset/changepassword"> Change Password </a></li> - <li><a href="{{ URL_ROOT }}/exam/viewprofile"> {{ user.get_full_name.title }} </a></li> - <li><a href="{{URL_ROOT}}/exam/logout/" id="logout">Logout</a></li> - </ul> - </div><!-- /.navbar --> - </div><!-- /.container --> - </nav><!-- /.navbar --> -{% 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> + </nav> </div> {% endblock %} -{% if user %} - {% block info %} - <h5><b>{{user.get_full_name|title}}</b> with Roll no. <b>{{user.profile.roll_number}}</b> is logged in as <b>{{user.username}}</b></h5> + + +{% block content %} + {% block main %} + {% block navtab %} + {% endblock %} {% endblock %} -{% endif %} +{% endblock %} diff --git a/yaksh/templates/yaksh/activation_status.html b/yaksh/templates/yaksh/activation_status.html index c196300..059aa21 100644 --- a/yaksh/templates/yaksh/activation_status.html +++ b/yaksh/templates/yaksh/activation_status.html @@ -1,79 +1,88 @@ {% extends "base.html" %} - -{% block pagetitle %} Yaksh Account Activation {% endblock %} -{% block title %} Yaksh Account Activation {% endblock %} -{% block css%} - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" /> -{% endblock %} +{% load static %} +{% block pagetitle %} Account Activation {% endblock %} +{% block title %} Account Activation {% endblock %} {% block nav %} -<nav class="navbar navbar-fixed-top navbar-inverse"> - <div class="container"> - <div class= "collapse navbar-collapse" id="navbar"> - <ul class="nav navbar-nav navbar-right"> - <li><a href="{{ URL_ROOT }}/exam/viewprofile"> {{ user.get_full_name.title }} </a></li> - <li><a style='cursor:pointer' id='logout' onClick='location.replace("{{URL_ROOT}}/exam/logout/");'> - <span class="glyphicon glyphicon-log-out">Logout </span></a></li> - </ul> - </div> - </div> -</nav> +<div class="container-fluid"> + <nav class="navbar navbar-expand-sm navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div class="collapse navbar-collapse" id="navbarColor01"> + <ul class="navbar-nav ml-auto"> + <li class="nav-item dropdown my-lg-0" style="font-size: 1.2rem"> + <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#">{{user.get_full_name|title}} + </a> + <div class="dropdown-menu dropdown-menu-right"> + <a class="dropdown-item" id="user_logout" href="{% url 'yaksh:logout' %}"> + <i class="fa fa-sign-out"></i> Logout + </a> + </div> + </li> + </ul> + </div> + </nav> +</div> {% endblock %} {% block content %} -{% if success %} - <center> - <div class="alert alert-success" role="alert"> - <strong> {{ msg }} </strong> - </div> - <a href="{{URL_ROOT}}/exam/"> Home </a> - </center> -{% else %} - {% if msg %} +<div class="container"> + {% if success %} <center> - <div class="alert alert-warning" role="alert"> + <div class="alert alert-success" role="alert"> <strong> {{ msg }} </strong> </div> + <a href="{% url 'yaksh:index' %}"> Home </a> </center> - <form action="{{ URL_ROOT }}/exam/new_activation/" method="post"> - {% csrf_token %} + {% else %} + {% if msg %} + <center> + <div class="alert alert-warning" role="alert"> + <strong> {{ msg }} </strong> + </div> + </center> + <center> + <div class="col-md-6"> + <form action="{% url 'yaksh:new_activation' %}" method="post"> + {% csrf_token %} + <input type="email" name="email" class="form-control" placeholder="Email address" required><br><br> + <button class="btn btn-success btn-lg" type="submit">Send Email</button> + </form> + </div> + </center> + {% endif %} + {% endif %} + <br/> + {% if activation_msg %} <center> - Enter Email Address for verification: <input type="email" name="email" required><br><br> - <button class="btn" type="submit">Send Email</button> + <div class="alert alert-info" role="alert"> + <strong> {{ activation_msg }} </strong> + </div> + <a href="{% url 'yaksh:index' %}"> Home </a> </center> - </form> {% endif %} -{% endif %} -<br/> -{% if activation_msg %} - <center> - <div class="alert alert-info" role="alert"> - <strong> {{ activation_msg }} </strong> - </div> - <a href="{{URL_ROOT}}/exam/"> Home </a> - </center> -{% endif %} -{% if email_err_msg %} - <center> - <div class="alert alert-warning" role="alert"> - <strong> {{ email_err_msg }} </strong> - </div> - </center> - <form action="{{ URL_ROOT }}/exam/update_email/" method="post"> - {% csrf_token %} - <center> - <table> - <tr> - <td>Enter Username:</td> - <td><input type="text" name="username" required></td> - </tr> - <tr> - <td>Enter New Email Address:</td> - <td><input type="email" name="email" required></td> - </tr> - </table> - <br> - <button class="btn" type="submit">Submit</button> - </center> - </form> -{% endif %} + {% if email_err_msg %} + <center> + <div class="alert alert-warning" role="alert"> + <strong> {{ email_err_msg }} </strong> + </div> + </center> + <center> + <div class="col-md-6"> + <form action="{% url 'yaksh:update_email' %}" method="post"> + {% csrf_token %} + <input type="text" name="username" required placeholder="Username" class="form-control" /> + <br> + <input type="email" name="email" required placeholder="New email address" class="form-control" /> + <br> + <button class="btn btn-success btn-lg" type="submit">Submit</button> + </form> + </div> + </center> + {% endif %} +</div> {% endblock content %} diff --git a/yaksh/templates/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html index 47a637d..97c6f56 100644 --- a/yaksh/templates/yaksh/add_course.html +++ b/yaksh/templates/yaksh/add_course.html @@ -1,31 +1,74 @@ {% extends "manage.html" %} - -{% block subtitle %}Add Course{% endblock %} +{% load static %} {% block css %} -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" /> -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/jquery.datetimepicker.css" type="text/css" /> +<link rel="stylesheet" href="{% static 'yaksh/css/jquery.datetimepicker.css' %}"> {% endblock %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.datetimepicker.full.min.js"></script> +<script type="text/javascript" src="{% static 'yaksh/js/jquery.datetimepicker.full.min.js' %}"> +</script> {% endblock %} - +{% block title %} Add Course {% endblock %} +{% block pagetitle %} Add Course {% endblock %} {% block content %} -<form name=frm id=frm action="" method="post" > - {% csrf_token %} - <center> - <table class="table table-bordered"> - {{ form.as_table }} - </table> - <br/> - <script type="text/javascript"> - $("#id_start_enroll_time").datetimepicker({format: 'Y-m-d H:i:s'}); - $("#id_end_enroll_time").datetimepicker({format: 'Y-m-d H:i:s'}); - </script> - </center> +<div class="container"> + <div class="row"> + <div class="col-md-8"> + <ul class="nav nav-pills" id="course_tabs"> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:courses' %}"> + My Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link active" href="{% url 'yaksh:add_course' %}"> + Add/Edit Course + </a> + </li> + <li class="nav-item dropdown hide"> + <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">More</a> + <div class="dropdown-menu hide" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 37px, 0px); top: 0px; left: 0px; will-change: transform;"> + <a class="dropdown-item" href="{% url 'yaksh:show_all_quizzes' %}"> + View Quizzes + </a> + <a class="dropdown-item" href="{% url 'yaksh:show_all_lessons' %}"> + View Lessons + </a> + <a class="dropdown-item" href="{% url 'yaksh:show_all_modules' %}"> + View Modules + </a> + <a href="{% url 'grades:grading_systems'%}" class="dropdown-item" > + View Grading Systems + </a> + </div> + </li> + </ul> + </div> + </div> + <hr> + <form name=frm id=frm action="" method="post" > + {% csrf_token %} + <center> + <table class="table table-bordered table-responsive-sm"> + {{ form.as_table }} + </table> + <br/> + <script type="text/javascript"> + $("#id_start_enroll_time").datetimepicker({format: 'Y-m-d H:i:s'}); + $("#id_end_enroll_time").datetimepicker({format: 'Y-m-d H:i:s'}); + </script> + </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> + <center> + <button class="btn btn-success btn-lg" type="submit" id="submit" name="course"> + <i class="fa fa-save"></i> Save + </button> + <a class="btn btn-danger btn-lg" name="button" href="{% url 'yaksh:courses' %}"> + Cancel + </a> + </center> + <br> + </form> +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/add_exercise.html b/yaksh/templates/yaksh/add_exercise.html index 77e3ee8..d3d9068 100644 --- a/yaksh/templates/yaksh/add_exercise.html +++ b/yaksh/templates/yaksh/add_exercise.html @@ -1,54 +1,101 @@ {% extends "manage.html" %} +{% load static %} - +{% block title %}Add Exercise{% endblock %} {% block subtitle %}Add Exercise{% endblock %} {% block css %} -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" /> {% endblock %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.9.1.min.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/add_quiz.js"></script> +<script src="{% static 'yaksh/js/jquery-3.3.1.min.js' %}"></script> +<script src="{% static 'yaksh/js/add_quiz.js' %}"></script> {% endblock %} -{% block onload %} onload="javascript:test();" {% endblock %} +{% block onload %} window.onload="javascript:test();" {% endblock %} {% block content %} +<div class="container"> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} + {% endif %} + {% if course_id %} + <a class="btn btn-primary" href="{% url 'yaksh:get_course_modules' course_id %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> + {% else %} + <a class="btn btn-primary" href="{% url 'yaksh:show_all_quizzes' %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> + {% endif %} + <br><br> + <form name=frm id=frm action="" method="post" > + {% csrf_token %} + <center> + <table class="span1 table table-responsive-sm"> + {{ form.as_table }} + </table> + <br/><br/> + </center> + <center> + <button class="btn btn-success btn-lg" type="submit" id="submit" name="save_exercise"> + <i class="fa fa-save"></i> Save + </button> + </center> + </form> + <br> + {% if exercise and course_id %} + {% if exercise.questionpaper_set.get.id %} + <center> + <a href="{% url 'yaksh:designquestionpaper' exercise.id exercise.questionpaper_set.get.id course_id %}" class="btn btn-primary"> + <i class="fa fa-edit"></i> Edit Question Paper + </a> + <a href="{% url 'yaksh:preview_questionpaper' exercise.questionpaper_set.get.id %}" class="btn btn-info" target="_blank"> + <i class="fa fa-eye"></i> Preview Question Paper + </a> + <br> + <br> + <h4>You can check the quiz by attempting it in the following modes:</h4> + <a class="btn btn-outline-info" name="button" href="{% url 'yaksh:test_quiz' 'usermode' exercise.id course_id %}" target="blank"> + User Mode + </a> -<form name=frm id=frm action="" method="post" > - {% csrf_token %} - <center> - <table class="span1 table"> - {{ form.as_table }} - </table> - <br/><br/> - </center> - <center><button class="btn" type="submit" id="submit" name="save_exercise"> Save - </button> - - <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> </center> -</form> -{% if exercise and course_id %} - {% if exercise.questionpaper_set.get.id %} - <center> - <h4>You can check the quiz by attempting it in the following modes:</h4> - <a href="{{URL_ROOT}}/exam/manage/designquestionpaper/{{ exercise.id }}/{{exercise.questionpaper_set.get.id}}/{{course_id}}" class="btn btn-primary">View Question Paper</a> - <button class="btn" type="button" name="button" onClick='usermode("{{URL_ROOT}}/exam/manage/usermode/{{exercise.id}}/{{course_id}}/");'>User Mode</button> - - <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/godmode/{{exercise.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"> - <br/> - <ul> - <li><b>User Mode:</b> Attempt quiz the way normal users will attempt i.e. - - <ul> - <li><i>Quiz will have the same duration as that of the original quiz.</li> - <li>Quiz won't start if the course is inactive or the quiz time has expired.</li> - <li>You will be notified about quiz prerequisites.(You can still attempt the quiz though)</i></li> - </ul> - </p> - <li> <b>God Mode:</b> Attempt quiz without any time or eligibilty constraints.</p> - </div> + <a class="btn btn-outline-info" name="button" href="{% url 'yaksh:test_quiz' 'godmode' exercise.id course_id %}" target="blank"> + God Mode + </a> + <a data-toggle="modal" data-target="#help"> + <span class="text-info"><i class="fa fa-info-circle"></i> Help</span></a> + </center> + {% endif %} {% endif %} -{% endif %} +</div> +<div class="modal" id="help"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title">Quiz Test Modes</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true"><i class="fa fa-close"></i></span> + </button> + </div> + <div class="modal-body"> + <p> + <b>User Mode:</b> Attempt quiz the way normal users will attempt i.e. - + <ul class="list-group list-group-flush"> + <li class="list-group-item">Quiz will have the same duration as that of the original quiz.</li> + <li class="list-group-item">Quiz won't start if the course is inactive or the quiz time has expired.</li> + <li class="list-group-item">You will be notified about quiz prerequisites.(You can still attempt the quiz though)</li> + </ul> + <b>God Mode:</b> Attempt quiz without any time or eligibilty constraints. + </p> + </div> + </div> + </div> +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html index ebc3ed7..99fc31a 100644 --- a/yaksh/templates/yaksh/add_lesson.html +++ b/yaksh/templates/yaksh/add_lesson.html @@ -1,85 +1,162 @@ {% extends "manage.html" %} {% load custom_filters %} +{% load static %} {% 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> +<script type="text/javascript" src="{% static 'yaksh/js/lesson.js' %}"> +</script> +<script type="text/javascript" src="{% static 'yaksh/js/jquery-ui.js' %}"> +</script> {% endblock %} {% block css %} -<link rel="stylesheet" href="{{URL_ROOT}}/static/yaksh/css/jquery-ui.css"> -<link rel="stylesheet" href="{{URL_ROOT}}/static/yaksh/css/lesson.css"> +<link rel="stylesheet" href="{% static 'yaksh/css/lesson.css' %}" type="text/css" /> +<link rel="stylesheet" href="{% static 'yaksh/css/jquery-ui/jquery-ui.css' %}" type="text/css" /> {% endblock %} {% block content %} +<div class="container"> {% if error %} <div class="alert alert-danger"> {{error}} </div> {% endif %} -<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> - {% if lesson_files %} - <div class="alert alert-success"> - <center><h4>Files added to this lesson</h4></center> - </div> - <ul class="list-group"> - <strong> - Select checkbox and click Delete Files button to delete files - </strong> - {% for f in lesson_files %} - <li class="list-group-item"> - <h4> - <input type="checkbox" name="delete_files" value="{{f.id}}"> - </input> - <a href="{{f.file.url}}">{{ f.file.name|file_title }}</a> - </h4> - </li> - {% endfor %} - {% else %} - <div class="alert alert-warning"> - <center><h4 class="alert-warning">No Files added to this lesson - </h4></center> - </div> - {% endif %} - <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 class="container"> + <div class="row justify-content-center form-group"> + <div class="col-md-9 col-md-offset-4"> + {% if course_id %} + <a class="btn btn-primary" href="{% url 'yaksh:get_course_modules' course_id %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> + {% else %} + <a class="btn btn-primary" href="{% url 'yaksh:show_all_lessons' %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> + {% endif %} + <br> + {% if messages %} + <br> + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} + {% endif %} + <br> + <form name=frm id=frm action="" method="post" enctype="multipart/form-data"> + <fieldset> + {% csrf_token %} + {% if lesson_form.errors %} + {% for field in lesson_form %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in lesson_form.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + {{lesson_form.name}} + <br> + {{lesson_form.description}} + <br> + Active: {{lesson_form.active}} + <br><br> + Video File: + <span class="badge badge-info"> + {{lesson_form.video_file.help_text}} + </span> + <div class="input-group mb-3"> + <div class="custom-file"> + {{lesson_form.video_file}} + <label class="custom-file-label" for="id_video_file"> + Choose file + </label> + </div> + </div> + <br> + Lesson Files: + <div class="input-group mb-3"> + <div class="custom-file"> + {{lesson_file_form.Lesson_files}} + <label class="custom-file-label" for="id_video_file"> + Choose file + </label> + </div> + </div> + <br> + {% if lesson_files %} + <center> + <div class="alert alert-info"> + <h4>Files added to this lesson</h4> + </div> + </center> + {% for f in lesson_files %} + <li class="list-group-item"> + <h4> + <input type="checkbox" name="delete_files" value="{{f.id}}"> + </input> + <a href="{{f.file.url}}">{{ f.file.name|file_title }}</a> + </h4> + </li> + {% endfor %} + <br> + {% else %} + <center> + <div class="alert alert-warning"> + <h4 class="alert-warning">No Files added to this lesson</h4> + </div> + </center> + {% endif %} + <center> + <button class="btn btn-success btn-lg" type="submit" id="submit" name="Save"> + <i class="fa fa-save"></i> + Save + </button> + {% if lesson_files %} + <button class="btn btn-danger btn-lg" type="submit" id="submit" name="Delete"> <i class="fa fa-trash"></i> Delete Files + </button> + {% endif %} + <button class="btn btn-outline-primary btn-lg" type="button" name="button" id="preview"> + <i class="fa fa-eye"></i> + Preview Description + </button> + <button class="btn btn-outline-primary btn-lg" type="button" name="button" id="embed"> + <i class="fa fa-angle-left"></i> <i class="fa fa-angle-right"></i> + Embed Video link + </button> + </center> + </form> + <hr> + <div class="card" id="preview_text_div" style="display: none;"> + <div class="card-heading"> + <center> + <h3>Description Preview</h3> + </center> + </div> + <div class="card-body" id="description_body"> + </div> + </div> + </fieldset> + </form> </div> </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 index 4efccf7..edbfaa2 100644 --- a/yaksh/templates/yaksh/add_module.html +++ b/yaksh/templates/yaksh/add_module.html @@ -1,69 +1,125 @@ {% extends "manage.html" %} +{% load static %} {% 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> +<script type="text/javascript" src="{% static 'yaksh/js/jquery-3.3.1.min.js' %}"> +</script> +<script type="text/javascript" src="{% static 'yaksh/js/design_course.js' %}"> +</script> +<script type="text/javascript" src="{% static 'yaksh/js/lesson.js' %}"> +</script> +<script type="text/javascript" src="{% 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"> +<link rel="stylesheet" href="{% static 'yaksh/css/design_course.css' %}" type="text/css" /> +<link rel="stylesheet" href="{% static 'yaksh/css/jquery-ui/jquery-ui.css' %}" type="text/css" /> {% endblock %} {% block content %} +<div class="container"> +{% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} +{% endif %} {% if course_id %} - <a href="{{URL_ROOT}}/exam/manage/courses/" class="btn btn-primary"> - Back to Courses</a> + <a class="btn btn-primary" href="{% url 'yaksh:get_course_modules' course_id %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> {% else %} - <a href="{{URL_ROOT}}/exam/manage/courses/all_learning_module" class="btn btn-primary"> - Back to Learning Modules</a> + <a class="btn btn-primary" href="{% url 'yaksh:show_all_modules' %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> {% endif %} +</div> +<br> {% 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 class="container"> + <div class="row justify-content-center form-group"> + <div class="col-md-9 col-md-offset-4"> + <form name=frm id=frm action="" method="post"> + <fieldset> + {% csrf_token %} + {% if module_form.errors %} + {% for field in module_form %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + {{module_form.name}} + <br> + {{module_form.description}} + <br> + Active: {{module_form.active}} + <br> + <center> + <button class="btn btn-success btn-lg" type="submit" id="submit" name="Save"> + <i class="fa fa-save"></i> + Save + </button> + <button class="btn btn-outline-primary btn-lg" type="button" name="button" id="preview"> + <i class="fa fa-eye"></i> + Preview Description + </button> + <button class="btn btn-outline-primary btn-lg" type="button" name="button" id="embed"> + <i class="fa fa-angle-left"></i> <i class="fa fa-angle-right"></i> + Embed Video link + </button> + </center> + </form> + <hr> + <div class="card" id="preview_text_div" style="display: none;"> + <div class="card-heading"> + <center> + <h3>Description Preview</h3> + </center> + </div> + <div class="card-body" id="description_body"> + </div> + </div> + </fieldset> + </form> + </div> </div> </div> {% endif %} <!-- Add learning Units --> {% if status == "design" %} +<div class="container"> <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"> +{% if course_id %} +<form action="{% url 'yaksh:design_module' module_id course_id %}" method="POST" id="design_course_form"> +{% else %} +<form action="{% url 'yaksh:design_module' module_id %}" method="POST" id="design_course_form"> +{% endif %} {% 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 class="col-md-12 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"> @@ -86,18 +142,18 @@ </div> <br> <center> - <button class="btn btn-success" type="submit" id="submit" name="Add"> - Add to Module + <button class="btn btn-success" type="submit" id="submit" name="Add"><i class="fa fa-plus-square"></i> + Add to Module </button> </center> <br><br> </div> - <div class="col-md-8 col-md-offset-2"> + <div class="col-md-12 col-md-offset-2"> <div id="fixed-added-wrapper"> - <p><u><b>Choosen Lessons and quizzes:</b></u> + <p><u><b>Chosen Lessons and quizzes:</b></u> </p> <div id="fixed-added"> - <table id="course-details" class="table table-bordered"> + <table id="course-details" class="table table-bordered table-responsive-sm"> <tr> <th width="5%">Select</th> <th>Quiz/Lesson</th> @@ -151,8 +207,8 @@ </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="Remove" name="Remove" class="btn btn-danger" type="submit"> <i class="fa fa-minus-square"></i> Remove from Module</button> + <button id="Change" name="Change" class="btn btn-info" type="submit"><i class="fa fa-reorder"></i> Change Order</button> <button id="Change" name="Change_prerequisite" class="btn btn-primary" type="submit"> Change Prerequisite</button> </center> </div> @@ -160,4 +216,5 @@ </div> </form> {% endif %} +</div> {% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index 79c132c..17cdcfe 100644 --- a/yaksh/templates/yaksh/add_question.html +++ b/yaksh/templates/yaksh/add_question.html @@ -1,75 +1,172 @@ {% extends "manage.html" %} - +{% load custom_filters %} +{% load static %} +{% block title %} Add Question {% endblock title %} {% block pagetitle %} Add Question {% endblock pagetitle %} {% block css %} -<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/autotaggit.css" /> + <link rel="stylesheet" type="text/css" href="{% static 'yaksh/css/autotaggit.css' %}"> {% endblock %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/add_question.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script> + <script type="text/javascript" src="{% static 'yaksh/js/tinymce/js/tinymce/tinymce.min.js' %}"></script> + <script type="text/javascript" src="{% static 'yaksh/js/add_question.js' %}"></script> + <script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML"></script> {% endblock %} {% block onload %} onload='javascript:textareaformat();' {% endblock %} {% block content %} -<form action="{{ URL_ROOT }}/exam/manage/addquestion/{{ question.id }}/" method="post" name=frm onSubmit="return autosubmit();" enctype="multipart/form-data"> - {% csrf_token %} - <center><table class="table"> - <tr><td>Summary: <td>{{ qform.summary }}{{ qform.summary.errors }} - <tr><td> Language: <td> {{qform.language}}{{qform.language.errors}} - <tr><td> Type: <td> {{ qform.type }}{{qform.type.errors}} - <tr><td>Points:<td><button class="btn-mini" type="button" onClick="increase(frm);">+</button>{{qform.points }}<button class="btn-mini" type="button" onClick="decrease(frm);">-</button>{{ qform.points.errors }} - <tr><td><strong>Rendered: </strong><td><p id='my'></p> - <tr><td>Description: <td>{{ qform.description}} {{qform.description.errors}} - <tr><td>Tags: <td>{{ qform.tags }} - <tr><td><strong>Rendered Solution: </strong><td><p id='rend_solution'></p> - <tr><td>Solution: <td>{{ qform.solution }} - <tr><td>Snippet: <td>{{ qform.snippet }} - <tr><td>Minimum Time(in minutes):<td> {{ qform.min_time }} - <tr><td>Partial Grading: <td>{{ qform.partial_grading }} - <tr><td>Grade Assignment Upload:<td> {{ qform.grade_assignment_upload }} - <tr><td> File: <td> {{ fileform.file_field }}{{ fileform.file_field.errors }} - {% if uploaded_files %}<br><b>Uploaded files:</b><br>Check on delete to delete files, - extract to extract files and hide to hide files from student(if required)<br> - {% for file in uploaded_files %} - <input type="checkbox" name="clear" value="{{file.id}}"> delete</input> - <input type="checkbox" name="extract" value="{{file.id}}" >{% if file.extract %} dont extract{% else %} - extract{% endif %}</input> - <input type="checkbox" name="hide" value="{{file.id}}" >{% if file.hide %} show{% else %} - hide{% endif %}</input> - <a href="{{file.file.url}}">{{ file.file.name }}</a> - <br> - {% endfor %}{% endif %} - </table></center> - {% for formset in formsets %} - <div class="form-group"> - {{ formset.management_form }} - - {% for form in formset %} - <div class="link-formset well"> - {{ form.as_p }} - </div> +<div class="container"> + <a class="btn btn-primary" href="{% url 'yaksh:show_questions' %}"> + <i class="fa fa-arrow-left"></i> Back + </a> + <br><br> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> {% endfor %} + {% endif %} + <form action="{% if question %}{% url 'yaksh:add_question' question.id %}{% endif %}" method="post" id="question_form" name=frm onSubmit="return autosubmit();" enctype="multipart/form-data"> + {% csrf_token %} + <table class="table table-responsive-sm"> + {% if qform.errors %} + {% for field in qform %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in qform.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + {% for field in qform %} + <tr> + <td>{{ field.label }}</td> + <td>{{ field }} <small>{{ field.help_text }}</small></td> + </tr> + {% endfor %} + <tr> + <td> File: </td> + <td> + <div class="input-group mb-3"> + <div class="custom-file"> + {{ fileform.file_field }}{{ fileform.file_field.errors }} + <label class="custom-file-label" for="id_file"> + Choose file + </label> + </div> + </div> + </td> + </tr> + {% if question %} + <tr><td>Add Test Case:</td> + <td> + <select id="case_type" class="form-control" name="case_type" onchange="frm.submit()"> + <option value="" selected="selected">Select Testcase</option> + {% for key, value in testcase_options %} + <option value="{{key}}">{{value}}</option> + {% endfor %} + </select> + </td> + </tr> + {% endif %} + </table> + {% if uploaded_files %} + <div class="card"> + <div class="card-header"> + <h3>Uploaded files</h3> + </div> + <div class="card-body"> + <div> + <p>Check on <b>Delete</b> to delete files, + <b>Extract</b> to extract files and <b>Hide</b> to hide files + </p> + <a href="https://yaksh.readthedocs.io/en/latest/moderator_docs/creating_question.html#setting-up-questions" class="btn btn-primary" target="blank"> + <i class="fa fa-info-circle"></i> More info + </a> + </div> + <br> + <ul class="list-group"> + {% for file in uploaded_files %} + <li class="list-group-item"> + <input type="checkbox" name="clear" value="{{file.id}}"> + Delete + </input> + <input type="checkbox" name="extract" value="{{file.id}}"> + {% if file.extract %} Dont extract {% else %} Extract {% endif %} + </input> + <input type="checkbox" name="hide" value="{{file.id}}"> + {% if file.hide %} Show {% else %} Hide {% endif %} + </input> + <a href="{{file.file.url}}">{{ file.file.name|file_title }}</a> + </li> + {% endfor %} + </ul> + </div> + </div> + {% endif %} + <br> + <div class="card"> + <div class="card-header"> + <h3>Test Cases</h3> + </div> + <div class="card-body"> + {% for formset in formsets %} + {{ formset.management_form }} + <div id="accordion"> + {% for form in formset %} + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col-md-4"> + <span class="badge badge-info"> + Test case {{forloop.counter}}. + </span> + </div> + <div class="ml-auto"> + <a class="card-link" data-toggle="collapse" href="#collapse{{form.instance.id}}"> + <i class="fa fa-toggle-down"></i> + </a> + </div> + </div> + </div> + <div id="collapse{{form.instance.id}}" class="collapse {% if formset.extra == 1 %} show {% else %} hide {% endif %}" data-parent="#accordion"> + <div class="card-body"> + {% autoescape off %} + {{form.as_p}} + {% endautoescape %} + </div> + </div> + </div> + <br> + {% endfor %} + </div> + {% endfor %} + </div> + </div> + <br> + <center> + <button class="btn btn-lg btn-success" type="submit" name="save_question"> + <i class="fa fa-save"></i> Save + </button> + </center> + </form> +</div> - </div> - {% endfor %} - <p><label for="case_type">Add Test Case:</label> <select id="case_type" name="case_type" onchange="frm.submit()"> - <option value="" selected="selected">---------</option> - <option value="standardtestcase">Standard </option> - <option value="stdiobasedtestcase">StdIO </option> - <option value="mcqtestcase">MCQ/MCC </option> - <option value="hooktestcase">Hook </option> - <option value="integertestcase">Integer </option> - <option value="stringtestcase"> String </option> - <option value="floattestcase"> Float </option> - <option value="arrangetestcase">Arrange options </option> - </select></p> - <center> - <button class="btn" type="submit" name="save_question">Save</button> - <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Back to Questions</button> - <button class="btn" type="submit" name="delete_files">Delete Selected Files</button> - </center> -</form> {% endblock %} diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html index 684f804..5497eeb 100644 --- a/yaksh/templates/yaksh/add_quiz.html +++ b/yaksh/templates/yaksh/add_quiz.html @@ -1,68 +1,111 @@ {% extends "manage.html" %} +{% load static %} +{% block title %}Add/Edit Quiz{% endblock %} -{% block subtitle %}Add Quiz{% endblock %} +{% block subtitle %}Add/Edit Quiz{% endblock %} {% block css %} -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" /> -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/jquery.datetimepicker.css" type="text/css" /> + +<link rel="stylesheet" href="{% static 'yaksh/css/jquery.datetimepicker.css' %}" type="text/css" /> {% endblock %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.9.1.min.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/add_quiz.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.datetimepicker.full.min.js"></script> -{% endblock %} -{% block onload %} onload="javascript:test();" {% endblock %} -{% block content %} -<form name=frm id=frm action="" method="post" > - {% csrf_token %} - <center> - <table class="span1 table"> - {{ form.as_table }} - </table> - <script type="text/javascript"> +<script src="{% static 'yaksh/js/jquery-3.3.1.min.js' %}"></script> +<script src="{% static 'yaksh/js/add_quiz.js' %}"></script> +<script src="{% static 'yaksh/js/jquery.datetimepicker.full.min.js' %}"></script> +<script type="text/javascript"> + $(document).ready(function() { $("#id_start_date_time").datetimepicker({format: 'Y-m-d H:i:s'}); $("#id_end_date_time").datetimepicker({format: 'Y-m-d H:i:s'}); - </script> - <br/><br/> - </center> - - <center><button class="btn" type="submit" id="submit" name="questionpaper"> Save - </button> + }); +</script> - <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> </center> - -</form> -<br> -{% if quiz and course_id %} - {% if quiz.questionpaper_set.get.id %} +{% endblock %} +{% block onload %} onload="javascript:test();" {% endblock %} +{% block content %} +<div class="container"> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} + {% endif %} + {% if course_id %} + <a class="btn btn-primary" href="{% url 'yaksh:get_course_modules' course_id %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> + {% else %} + <a class="btn btn-primary" href="{% url 'yaksh:show_all_quizzes' %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> + {% endif %} + <br><br> + <form name=frm id=frm action="" method="post" > + {% csrf_token %} <center> - <h4>You can check the quiz by attempting it in the following modes:</h4> - <a href="{{URL_ROOT}}/exam/manage/designquestionpaper/{{ quiz.id }}/{{quiz.questionpaper_set.get.id}}/{{course_id}}" class="btn btn-primary">View Question Paper</a> - <button class="btn" type="button" name="button" onClick='usermode("{{URL_ROOT}}/exam/manage/usermode/{{quiz.id}}/{{course_id}}/");'>User Mode</button> + <table class="table table-responsive-sm"> + {{ form.as_table }} + </table> + <br/> + <button class="btn btn-success btn-lg" id="submit" name="questionpaper"> + <i class="fa fa-save"> Save</i> + </button> + </center> + </form> + <br> + {% if quiz and course_id %} + {% if quiz.questionpaper_set.get.id %} + <center> + <a href="{% url 'yaksh:designquestionpaper' quiz.id quiz.questionpaper_set.get.id course_id %}" class="btn btn-primary"> + <i class="fa fa-edit"></i> Edit Question Paper + </a> + <a href="{% url 'yaksh:preview_questionpaper' quiz.questionpaper_set.get.id %}" class="btn btn-info" target="_blank"> + <i class="fa fa-eye"></i> Preview Question Paper + </a> + <br> + <br> + <h4>You can check the quiz by attempting it in the following modes:</h4> + <a class="btn btn-outline-info" name="button" href="{% url 'yaksh:test_quiz' 'usermode' quiz.id course_id %}" target="blank"> + User Mode + </a> - <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"> - <br/> - <ul> - <li><b>User Mode:</b> Attempt quiz the way normal users will attempt i.e. - - <ul> - <li><i>Quiz will have the same duration as that of the original quiz.</li> - <li>Quiz won't start if the course is inactive or the quiz time has expired.</li> - <li>You will be notified about quiz prerequisites.(You can still attempt the quiz though)</i></li> - </ul> - </p> - <li> <b>God Mode:</b> Attempt quiz without any time or eligibilty constraints.</p> + <a class="btn btn-outline-info" name="button" href="{% url 'yaksh:test_quiz' 'godmode' quiz.id course_id %}" target="blank"> + God Mode + </a> + <a data-toggle="modal" data-target="#help"> + <span class="text-info"><i class="fa fa-info-circle"></i> Help</span></a> + </center> + {% endif %} + {% endif %} +</div> +<div class="modal" id="help"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title">Quiz Test Modes</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true"><i class="fa fa-close"></i></span> + </button> + </div> + <div class="modal-body"> + <p> + <b>User Mode:</b> Attempt quiz the way normal users will attempt i.e. - + <ul class="list-group list-group-flush"> + <li class="list-group-item">Quiz will have the same duration as that of the original quiz.</li> + <li class="list-group-item">Quiz won't start if the course is inactive or the quiz time has expired.</li> + <li class="list-group-item">You will be notified about quiz prerequisites.(You can still attempt the quiz though)</li> + </ul> + <b>God Mode:</b> Attempt quiz without any time or eligibilty constraints. + </p> + </div> </div> - {% endif %} -{% endif %} -<style type="text/css"> - #rendered_text{ - width: 550px; - } -</style> + </div> +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/addteacher.html b/yaksh/templates/yaksh/addteacher.html index 478da77..58f48d9 100644 --- a/yaksh/templates/yaksh/addteacher.html +++ b/yaksh/templates/yaksh/addteacher.html @@ -1,78 +1,86 @@ -{% extends "manage.html" %} - -{% block title %} Add teacher {% endblock title %} -{% block subtitle %} {{ course.name }} {% endblock %} - -{% block css %} -<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/course.css" /> -{% endblock %} - -{% block content %} -<center><h3>Add Teachers for this course</h3><br></center> -<center><h3>Search teacher with username, firstname, lastname, email</h3><br></center> -<div align="center"> - <form action="{{ URL_ROOT }}/exam/manage/searchteacher/{{ course.id }}/" method="post"> - {% csrf_token %} - Search Teacher: <input type="text" name="uname" style="height: 25px; padding: 0px"><br><br> - <center><button class="btn" type="submit">Search</button> - <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses");'>Cancel</button> </center></form> -</div> +<div class="container"> +<center><h3>Add Teachers/TAs</h3><br></center> +<form action="{% url 'yaksh:search_teacher' course.id %}" method="post"> + {% csrf_token %} + <div class="form-group"> + <input class="form-control form-control-lg" type="text" name="uname" id="inputLarge" placeholder="Search teachers with username, firstname, lastname, email" required> + </div> + <center> + <button class="btn btn-info btn-lg" type="submit"> + <i class="fa fa-search"></i> + Search + </button> + </center> +</form> <br><br> -<form action="{{ URL_ROOT }}/exam/manage/addteacher/{{ course.id }}/" method="post"> -{% csrf_token %} -{% if success == True %} - {% if teachers|length == 0 %} - <center><h3>No results found</h3></center> - {% else %} - <center><b><u>Search Results</u></b></center><br> - <center><b>Search results does not include teachers already added</b></center><br> - <table class="table table-striped"> +{% if success %} + {% if teachers|length == 0 %} + <center><h3 class="badge badge-warning">No results found</h3></center> + {% else %} + <center><b><u>Search Results</u></b></center><br> + <center> + <p class="alert alert-info"> + Search results does not include teachers already added + </p> + </center> + <br> + <form action="{% url 'yaksh:add_teacher' course.id %}" method="post"> + {% csrf_token %} + <table class="table table-striped table-responsive-sm course-detail"> <th></th> <th>Username</th> - <th>First Name</th> - <th>Last Name</th> - <th>Email</th> - <th>Institute</th> - <th>Department</th> + <th>First Name</th> + <th>Last Name</th> + <th>Email</th> + <th>Institute</th> + <th>Department</th> <th>Position</th> - {% for teacher in teachers %} - {% if teacher not in course.get_teachers %} - <tr> - <td><input type="checkbox" name="check" value="{{ teacher.id }}"></td> - <td>{{ teacher.username }}</td> - <td>{{ teacher.first_name }}</td> - <td>{{ teacher.last_name }}</td> - <td>{{ teacher.email }}</td> - <td>{{ teacher.profile.institute }}</td> - <td>{{ teacher.profile.department }}</td> - <td>{{ teacher.profile.position }}</td> - </tr> - {% endif %} - {% endfor %} - </table> - </br> - <button class="btn" type="submit">Add Selected</button> - {% endif %} + {% for teacher in teachers %} + {% if teacher not in course.get_teachers %} + <tr class="yakshgreen"> + <td><input type="checkbox" name="check" value="{{ teacher.id }}"></td> + <td>{{ teacher.username }}</td> + <td>{{ teacher.first_name }}</td> + <td>{{ teacher.last_name }}</td> + <td>{{ teacher.email }}</td> + <td>{{ teacher.profile.institute }}</td> + <td>{{ teacher.profile.department }}</td> + <td>{{ teacher.profile.position }}</td> + </tr> + {% endif %} + {% endfor %} + </table> + </br> + <button class="btn btn-success btn-lg" type="submit"> + <i class="fa fa-plus-circle"></i> + Add Selected + </button> + </form> + {% endif %} {% endif %} -</form> -{% if status == True %} -<div class="row"> - <div class="span6 offset4 wrap"> + + +{% if status %} +<div class="container"> + <center><b><u>Teacher(s) added</u></b></center> + <br> {% if teachers_added %} - {% for teacher in teachers_added %} - <div class="well"> - <div class="row"> - <div class="span3" style="width: auto;"> - <h5>{{ teacher.get_full_name }}</h5> - </div> - </div> - </div> - {% endfor %} + <table class="table table-responsive-sm"> + <tr> + <th>Sr No.</th> + <th>Name</th> + </tr> + {% for teacher in teachers_added %} + <tr> + <td>{{forloop.counter}}</td> + <td>{{ teacher.get_full_name }}</td> + </tr> + {% endfor %} + <table> {% else %} - <center><b>No Teacher(s) Added</b></center> + <center><b class="badge badge-info">No Teacher(s)TA(s) Added</b></center> {% endif %} - </div> </div> {% endif %} -{% endblock %} +</div> diff --git a/yaksh/templates/yaksh/ajax_marks.html b/yaksh/templates/yaksh/ajax_marks.html deleted file mode 100644 index 716bb88..0000000 --- a/yaksh/templates/yaksh/ajax_marks.html +++ /dev/null @@ -1,4 +0,0 @@ -<option value='select'>Select Marks</option> -{% for mark in marks %} -<option value="{{ mark.0 }}"> {{ mark.0 }} </option> -{% endfor %} diff --git a/yaksh/templates/yaksh/ajax_question_filter.html b/yaksh/templates/yaksh/ajax_question_filter.html index ea0d0b5..18f14ff 100644 --- a/yaksh/templates/yaksh/ajax_question_filter.html +++ b/yaksh/templates/yaksh/ajax_question_filter.html @@ -15,7 +15,14 @@ }); }); </script> + <br> + <a class="btn btn-lg btn-success" href="{% url 'yaksh:add_question' %}"> + <i class="fa fa-plus-circle"></i> Add Question + </a> + <br><br> {% if questions %} + {% include "yaksh/paginator.html" %} + <h5 class="highlight"><input type="checkbox" id="checkall"> Select All </h5> @@ -36,7 +43,7 @@ <td> <input type="checkbox" name="question" value="{{ question.id }}"> </td> - <td><a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}">{{question.summary|capfirst}}</a></td> + <td><a href="{% url 'yaksh:add_question' question.id %}">{{question.summary|capfirst}}</a></td> <td>{{question.language|capfirst}}</td> <td>{{question.type|capfirst}}</td> <td>{{question.points}}</td> @@ -45,5 +52,6 @@ </tbody> </table> </ul> + {% include "yaksh/paginator.html" %} {% endif %} </div> diff --git a/yaksh/templates/yaksh/complete.html b/yaksh/templates/yaksh/complete.html index a3627d0..2b3897e 100644 --- a/yaksh/templates/yaksh/complete.html +++ b/yaksh/templates/yaksh/complete.html @@ -1,59 +1,78 @@ {% extends "base.html" %} +{% load static %} + +{% block title %} Complete {% endblock %} + +{% block nav %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} -{% block pagetitle %}<img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_text.png" -width="80" alt="YAKSH"></img>{% endblock %} {% block content %} -{% if module_id and not paper.question_paper.quiz.is_trial %} +<br> +{% if module_id and not paper.course.is_trial %} <center> - <div class="alert alert-info"> + <div class="alert alert-info col-md-8"> Note:- Please Click on the Next button to submit the quiz. Please do not close the browser without clicking Next. </div> </center> {% endif %} {% csrf_token %} {% if paper.questions_answered.all or paper.questions_unanswered.all %} -<center><table class="table table-bordered" > - <caption> <center><h3>Submission Status</h3> </center></caption> - <thead> - <tr> - <th> Question</th> - <th> State </th> - </tr> - </thead> + <center> + <div class="col-md-8"> + <h3>Submission Status</h3> + <table class="table table-bordered table-responsive-sm" > + <thead> + <tr class="text-center"> + <th> Question</th> + <th> Status </th> + </tr> + </thead> - {% for question in paper.questions.all %} - <tbody> - {% if question in paper.questions_answered.all %} - <tr class="info"> - <td> {{ question.summary }} </td> - <td> Attempted </td> - {% else %} - <tr class="danger"> - <td> {{ question }} </td> - <td> Not completed </td> - {% endif %} - </tr> - </tbody> - {% endfor %} -</table></center> + {% for question in paper.questions.all %} + <tbody> + {% if question in paper.questions_answered.all %} + <tr class="table-success"> + <td> {{ question.summary }} </td> + <td> Attempted </td> + {% else %} + <tr class="table-warning"> + <td> {{ question }} </td> + <td> Not completed </td> + {% endif %} + </tr> + </tbody> + {% endfor %} + </table> + </div> + </center> {% endif %} - <center><h3>{{message}}</h3></center> + <br><br> + <center class="container"> + <h5> + <span class="alert alert-success">{{message}}</span> + </h5> + </center> <center> <br> - {% if module_id and not paper.question_paper.quiz.is_trial %} + {% if module_id and not paper.course.is_trial %} {% if first_unit %} - <a href="{{URL_ROOT}}/exam/next_unit/{{course_id}}/{{module_id}}/{{learning_unit.id}}/1" class="btn btn-info" id="Next"> Next - <span class="glyphicon glyphicon-chevron-right"> + <a href="{% url 'yaksh:next_unit' course_id module_id learning_unit.id '1' %}" class="btn btn-info btn-lg" id="Next"> Next + <span class="fa fa-step-forward"> </span> </a> {% else %} - <a href="{{URL_ROOT}}/exam/next_unit/{{course_id}}/{{module_id}}/{{learning_unit.id}}" class="btn btn-info" id="Next"> Next - <span class="glyphicon glyphicon-chevron-right"> + <a href="{% url 'yaksh:next_unit' course_id module_id learning_unit.id %}" class="btn btn-info btn-lg" id="Next"> Next + <span class="fa fa-step-forward"> </span> </a> {% endif %} {% else %} - <a href="{{URL_ROOT}}/exam/" id="home" class="btn btn-success"> Home </a> + <a href="{% url 'yaksh:index' %}" id="home" class="btn btn-primary btn-lg"> Home </a> {% endif %} </center> {% endblock content %} diff --git a/yaksh/templates/yaksh/course_added_modules.html b/yaksh/templates/yaksh/course_added_modules.html new file mode 100644 index 0000000..c70eb7a --- /dev/null +++ b/yaksh/templates/yaksh/course_added_modules.html @@ -0,0 +1,49 @@ +{% if is_modules %} + {% block pagetitle %} <center> <h3>Course Modules</h3> </center> {% endblock %} + {% if modules %} + <table class="table table-responsive"> + <tr> + <th>Module</th> + <th>Module Design</th> + <th>Lessons/Quizzes</th> + </tr> + {% for module in modules %} + <tr> + <td> + <a href="{% url 'yaksh:edit_module' module.id course.id %}"> + {{module.name}}</a> + </td> + <td> + <a href="{% url 'yaksh:design_module' 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" %} + {% if unit.quiz.is_exercise %} + <a href="{% url 'yaksh:edit_exercise' unit.quiz.id course.id %}"> + {{unit.quiz.description}}</a> + {% else %} + <a href="{% url 'yaksh:edit_quiz' unit.quiz.id course.id %}"> + {{unit.quiz.description}}</a> + {% endif %} + {% else %} + <a href="{% url 'yaksh:edit_lesson' unit.lesson.id course.id %}"> + {{unit.lesson.name}}</a> + {% endif %} + </li> + </ul> + {% endfor %} + </td> + </tr> + {% endfor %} <!-- end for modules --> + </table> + {% else %} + <center> + <span class="badge badge-warning"><big>No learning modules</big></span> + </center> + {% endif %} +{% endif %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html index 2bf725c..654f373 100644 --- a/yaksh/templates/yaksh/course_detail.html +++ b/yaksh/templates/yaksh/course_detail.html @@ -1,331 +1,94 @@ {% extends "manage.html" %} +{% load static %} {% load custom_filters %} {% block title %} Course Details {% endblock title %} -<div class="col-md-9 col-md-offset-6 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> -<script type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/tinymce/js/tinymce/tinymce.min.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-ui.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.tablesorter.min.js"></script> +<script type="text/javascript" src="{% static 'yaksh/js/course.js' %}"></script> +<script type="text/javascript" src="{% static 'yaksh/js/tinymce/js/tinymce/tinymce.min.js' %}"></script> +<script type="text/javascript" src="{% static 'yaksh/js/jquery-ui.js' %}"></script> +<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"> +</script> {% endblock %} {% block css %} -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/jquery-ui/jquery-ui.css"> -<style> - .user_data + .tooltip.top > .tooltip-inner { - padding: 12px; - font-size: 10px; - } -</style> +<link rel="stylesheet" href="{% static 'yaksh/css/jquery-ui/jquery-ui.css' %}"> {% endblock %} + +<div class="text-center"> +{% block pagetitle %} <h1>{{ course.name|title }}</h1> {% endblock %} +</div> + {% block content %} -<br/> -<br> -<div class="row"> - <div class="col-sm-3 col-md-2 sidebar"> - <ul class="nav nav-sidebar"> - {% if state == 'mail' or state == 'course_status' %} - <li><a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/"> - Go to Course Details</a></li> - {% else %} - <li><a href="#student-requests" id="request"> - Requested Students </a></li> - <li><a href="#enrolled-students" id="enroll-students"> - Enrolled Students </a></li> - <li><a href="#rejected-students" id="reject-students"> - Rejected Students </a></li> - {% endif %} - <li> - <a href="{{URL_ROOT}}/exam/manage/send_mail/{{ course.id }}/"> - Send Mail</a> - </li> - <li> - <a href="{{URL_ROOT}}/exam/manage/course_status/{{ course.id }}/"> - View Course Status</a> - </li> - </ul> - </div> +<hr> +<div id="dialog" title="Alert"> + <p id="error_msg"></p> </div> -<div class="col-md-9 col-md-offset-2 main"> - <form id="upload_users" action="{{ URL_ROOT }}/exam/manage/upload_users/{{course.id}}/" - method="POST" enctype="multipart/form-data"> - {% csrf_token %} - <input type="file" name="csv_file" /> - <button class="btn btn-primary" type=submit> Upload Users <span class="glyphicon glyphicon-open"/></button> - </form> - <div class="alert alert-info" role="alert"> - <p> - - The uploaded csv should have headers exactly same as mentioned below:<br /> - <b>firstname, lastname, email, username, password, institute, roll_no, department, - remove</b><br /> - - Mandatory fields are <b> firstname, lastname and email. </b><br /> - - Other fields are optional. <br /> - - If username and password are not provided then - <b>Users created will have username and password same as their email</b> - </p> - <p> - <b> Click <a class="btn btn-success" href="{{ URL_ROOT }}/exam/manage/download_sample_csv/ -">here</a> to download a sample CSV, edit and upload it</b> - </p> - </div> +<div class="container-fluid"> <div class="row"> - {% if message %} - <div class="alert alert-warning" role="alert"> - <center> - <strong> {{ message }} </strong> - </center> - </div> - {% endif %} - {% if upload_details %} - <div class="alert alert-info" role="info"> - {% for detail in upload_details %} - <strong> {{ detail }} </strong><br> - {% endfor %} + <div class="col-sm-3"> + {% include "yaksh/course_detail_options.html" %} </div> - {% endif %} - <hr> - {% if state == 'mail' %} - <div id="enrolled-students"> - <center><b><u>Send Mails to Students</u></b></center><br> - {% if course.get_enrolled %} - <input type="checkbox" class="reject"/> <font size="2">Select all</font> - <div id="reject"> - <form action="{{URL_ROOT}}/exam/manage/send_mail/{{ course.id }}/" method="post" id="send_mail_form"> - {% csrf_token %} - <table id="mail_table" class="tablesorter table table-striped" data-sortlist="[1,0]"> - <thead> - <th></th> - <th></th> - <th>Full Name</th> - <th>Email</th> - <th>Roll Number</th> - <th>Institute</th> - <th>Department</th> - </thead> - <tbody> - {% for enrolled in course.get_enrolled %} - <tr> - <td><input type="checkbox" name="check" value="{{ enrolled.id }}"></td> - <td>{{ forloop.counter }}.</td> - <td> {{ enrolled.get_full_name|title }} </td> - <td> {{enrolled.email}}</td> - <td> {{enrolled.profile.roll_number}}</td> - <td> {{enrolled.profile.institute}}</td> - <td> {{enrolled.profile.department}}</td> - </tr> + <div class="col-md-9"> + <div class="tab-content"> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> {% endfor %} - </tbody> - </table> - <br> - <textarea name="subject" id="subject" placeholder="Email Subject" cols="50"></textarea> - <br><br> - <textarea name="body" id="email_body"></textarea><br> - Attachments: <input type="file" name="email_attach" multiple=""> - <br> - <button class="btn btn-success" type="submit" name='send_mail' value='send_mail' id="send_mail"> - Send Mail to Selected Students</button> - </div> - {% endif %} - </form> - </div> - {% elif state == "course_status" %} - <div class="course_data"> - <input type="hidden" id="course_name" value="{{course.name}}"> - <center><h2>Course Status</h2></center> - <table class="tablesorter table table-bordered" id="course_table" data-sortlist="[0,0]"> - <thead> - <tr> - <th>Sr No.</th> - <th>Email</th> - <th>Current Unit</th> - <th>Course Completion Percentage</th> - <th>Grade</th> - </tr> - </thead> - <tbody> - {% for student, grade, percent, unit in student_details %} - <tr> - <td width="5%"> - {{forloop.counter}}. - </td> - <td width="50%"> - <a class="user_data" data-item-id="{{course.id}}+{{student.id}}" data-toggle="tooltip" title="Click to view Overall Course progress" data-placement="top"> - {% if student.email %} - {{ student.email }} - {% else %} - {{ student.get_full_name|title}} - {% endif %} - </a> - <div id="show_status_{{course.id}}_{{student.id}}" style="display: None;"> - </div> - </td> - <td> - {% if unit %} - {% if unit.type == 'quiz' %} - {{unit.quiz.description}} - {% else %} - {{unit.lesson.name}} - {% endif %} - {% else %} - NA - {% endif%} - </td> - <td> - {{percent}}% - </td> - <td> - {{grade}} - </td> - </tr> - {% endfor %} - </tbody> - </table> - </div> - {% else %} - <div id="students_enrollment"> - <div id="student-requests"> - <center><b><u>Requests</u></b></center><br> - {% if course.get_requests %} - <input type="checkbox" class="checkall"/> <font size="2">Select all</font> - <div id="enroll-all"> - <form action="{{URL_ROOT}}/exam/manage/enroll/{{ course.id }}/" method="post"> - {% csrf_token %} - <table id="requested_table" class="tablesorter table table-striped" data-sortlist="[1,0]"> - <thead> - <th></th> - <th></th> - <th>Full Name</th> - <th>Email</th> - <th>Roll Number</th> - <th>Institute</th> - <th>Department</th> - <th>Enroll/Reject</th> - </thead> - <tbody> - {% for request in course.get_requests %} - <tr> - <td><input type="checkbox" name="check" value="{{ request.id }}"></td> - <td>{{ forloop.counter }}.</td> - <td>{{request.get_full_name}}</td> - <td> {{request.email}}</td> - <td> {{request.profile.roll_number}}</td> - <td> {{request.profile.institute}}</td> - <td> {{request.profile.department}}</td> - <td> - <a class="btn btn-success" - href="{{URL_ROOT}}/exam/manage/enroll/{{ course.id }}/{{ request.id }}/"> - Enroll </a> - <a class="btn btn-danger" - href="{{URL_ROOT}}/exam/manage/reject/{{ course.id }}/{{ request.id }}/"> - Reject </a> - </td> - </tr> - {% endfor %} - </tbody> - </table> - <button class="btn btn-success" type="submit" name='enroll' value='enroll'>Enroll Selected</button> + {% endif %} + {% if is_students %} + {% include "yaksh/course_students.html" %} + {% elif is_mail %} + {% include "yaksh/course_send_mail.html" %} + {% elif is_progress %} + {% include "yaksh/course_progress.html" %} + {% elif is_modules %} + {% include "yaksh/course_added_modules.html" %} + {% elif is_design_course %} + {% include "yaksh/design_course_session.html" %} + {% elif is_add_teacher %} + {% include "yaksh/addteacher.html" %} + {% elif is_teachers %} + {% include "yaksh/course_teachers.html" %} + {% else %} + <div class="jumbotron"> + <h1 class="display-4">Manage Course</h1> + <hr class="my-4"> + <p> + <ul> + <li> + Students enrollments + </li> + <li> + Add and View Modules, Lessons and Quizzes + </li> + <li> + Send mail to the students + </li> + <li> + View Students course progress + </li> + <li> + Add and View Teachers/TAs + </li> + </ul> + </p> + <p class="lead"> + <a class="btn btn-primary btn-lg" href="https://yaksh.readthedocs.io/en/latest/moderator_docs/creating_course.html" role="button" target="blank"> + <i class="fa fa-info-circle"></i> + Learn more + </a> + </p> + </div> + {% endif %} </div> - {% endif %} - </form> </div> - <br> - <div id="enrolled-students"> - <center><b><u>Enrolled</u></b></center><br> - {% if course.get_enrolled %} - <input type="checkbox" class="reject"/> <font size="2">Select all</font> - <div id="reject"> - <form action="{{URL_ROOT}}/exam/manage/enrolled/reject/{{ course.id }}/" method="post" id="reject-form"> - {% csrf_token %} - <table id="enrolled_table" class="tablesorter table table-striped" data-sortlist="[1,0]"> - <thead> - <th></th> - <th></th> - <th>Full Name</th> - <th>Email</th> - <th>Roll Number</th> - <th>Institute</th> - <th>Department</th> - <th>Reject</th> - </thead> - <tbody> - {% for enrolled in course.get_enrolled %} - <tr> - <td><input type="checkbox" name="check" value="{{ enrolled.id }}"></td> - <td>{{ forloop.counter }}.</td> - <td> {{ enrolled.get_full_name|title }} </td> - <td> {{enrolled.email}}</td> - <td> {{enrolled.profile.roll_number}}</td> - <td> {{enrolled.profile.institute}}</td> - <td> {{enrolled.profile.department}}</td> - <td><a class="btn btn-danger" - href="{{URL_ROOT}}/exam/manage/enrolled/reject/{{ course.id }}/{{ enrolled.id }}/"> - Reject </a> - </td> - </tr> - {% endfor %} - </tbody> - </table> - <button class="btn btn-danger" type="submit" name='reject' value='reject'> - Reject Selected</button> - </div> - {% endif %} - </form> - </div> - <br> - <div id="rejected-students"> - <center><b><u>Rejected</u></b></center><br> - {% if course.get_rejected %} - <input type="checkbox" class="enroll"/> <font size="2">Select all</font> - <div id="enroll"> - <form action="{{URL_ROOT}}/exam/manage/enroll/rejected/{{ course.id }}/" method="post"> - {% csrf_token %} - <table id="rejected_table" class="tablesorter table table-striped" data-sortlist="[1,0]"> - <thead> - <th></th> - <th></th> - <th>Full Name</th> - <th>Email</th> - <th>Roll Number</th> - <th>Institute</th> - <th>Department</th> - <th>Enroll</th> - </thead> - <tbody> - {% for rejected in course.get_rejected %} - <tr> - <td><input type="checkbox" name="check" value="{{ rejected.id }}"></td> - <td>{{ forloop.counter }}.</td> - <td>{{rejected.get_full_name|title}}</td> - <td> {{rejected.email}}</td> - <td> {{rejected.profile.roll_number}}</td> - <td> {{rejected.profile.institute}}</td> - <td> {{rejected.profile.department}}</td> - <td> - <a class="btn btn-success" - href="{{URL_ROOT}}/exam/manage/enroll/rejected/{{ course.id }}/{{ rejected.id }}/"> - Enroll </a> - </td> - </tr> - {% endfor %} - </tbody> - </table> - <br> - <button class="btn btn-success" type="submit" name='enroll' value='enroll'> - Enroll Selected</button> - </div> - {% endif %} - </form> - </div> - </div> - {% endif %} </div> </div> - -<!-- Dialog to display error message --> -<div id="dialog" title="Alert"> - <p id="error_msg"></p> -</div> {% endblock %} + + diff --git a/yaksh/templates/yaksh/course_detail_options.html b/yaksh/templates/yaksh/course_detail_options.html new file mode 100644 index 0000000..6f9a711 --- /dev/null +++ b/yaksh/templates/yaksh/course_detail_options.html @@ -0,0 +1,42 @@ +<ul class="nav nav-pills list-group"> + <li class="nav-item"> + <a href="{% url 'yaksh:courses' %}" class="nav-link list-group-item" title="View all the courses" data-placement="top" data-toggle="tooltip"> + Back to Courses + </a> + </li> + <li class="nav-item"> + <a href="{% url 'yaksh:course_students' course.id %}" id="enroll-students" class="nav-link list-group-item {% if is_students %} active {% endif %}" title="View the course requested, rejected and added students" data-placement="top" data-toggle="tooltip"> + Enroll Students + </a> + </li> + <li class="nav-item"> + <a href="{% url 'yaksh:send_mail' course.id %}" class="nav-link list-group-item {% if is_mail %} active {% endif %}" title="Send mail to course students" data-placement="top" data-toggle="tooltip"> + Send Mail + </a> + </li> + <li class="nav-item"> + <a href="{% url 'yaksh:course_status' course.id %}" class="nav-link list-group-item {% if is_progress %} active {% endif %}" title="View Students course progress" data-placement="top" data-toggle="tooltip"> + Course Progress + </a> + </li> + <li class="nav-item"> + <a class="nav-link list-group-item {% if is_design_course %} active {% endif %}" href="{% url 'yaksh:design_course' course.id %}" title="Add modules to this course" data-placement="top" data-toggle="tooltip"> + Design Course + </a> + </li> + <li class="nav-item"> + <a class="nav-link list-group-item {% if is_modules %} active {% endif %}" href="{% url 'yaksh:get_course_modules' course.id %}" title="View modules added to the course" data-placement="top" data-toggle="tooltip"> + Course Modules + </a> + </li> + <li class="nav-item"> + <a class="nav-link list-group-item {% if is_add_teacher %} active {% endif %}" href="{% url 'yaksh:search_teacher' course.id %}" data-toggle="tooltip" title="Add Teachers/TAs to this course" data-placement="top"> + Add Teachers/TAs + </a> + </li> + <li class="nav-item"> + <a class="nav-link list-group-item {% if is_teachers %} active {% endif %}" href="{% url 'yaksh:course_teachers' course.id %}" data-toggle="tooltip" title="View all the Teachers/TAs for this course" data-placement="top"> + Current Teachers/TAs + </a> + </li> +</ul>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/course_modules.html b/yaksh/templates/yaksh/course_modules.html index 5baa781..214f8c7 100644 --- a/yaksh/templates/yaksh/course_modules.html +++ b/yaksh/templates/yaksh/course_modules.html @@ -1,106 +1,160 @@ {% 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 %} -<b>Grade: {% if grade %} {{ grade }} {% else %} Will be available once the course is complete {% endif %}</b> -{% if modules %} - <br><br> - <strong>Overall Course Progress</strong> - <div class="progress"> - {% if course_percentage <= 50 %} - <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="40" - aria-valuemin="0" aria-valuemax="100" style="width:{{course_percentage}}%"> - {% elif course_percentage <= 75 %} - <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="40" - aria-valuemin="0" aria-valuemax="100" style="width:{{course_percentage}}%"> - {% else %} - <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" - aria-valuemin="0" aria-valuemax="100" style="width:{{course_percentage}}%"> - {% endif %} - <b style="color: black;">{{course_percentage}}% Completed</b> +<div class="container"> + <div class="card"> + <div class="card-header"> + {{ course.name }} </div> - </div> - <div class="panel panel-default"> - <div class="panel panel-body"> - <table class="table"> - {% for module, percent in modules %} - <tr> - <td width="25%"> - <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/Exercises</a> - <div id="learning_units{{module.id}}{{course.id}}" class="collapse"> - <table class="table table-bordered"> - <tr> - <th>Lesson/Quiz/Exercise</th> - <th>Status</th> - <th>Type</th> - <th>View AnswerPaper</th> - </tr> + <div class="card-body"> + {% if course.view_grade %} + <center> + <b>Grade:</b> {% if grade %} {{ grade }} {% else %} Will be available once the course is complete {% endif %} + </center> + {% endif %} + {% if msg %} + <div class="alert alert-dismissible alert-warning"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ msg }}</strong> + </div> + {% endif %} + {% if modules %} + <strong>Overall Course Progress:</strong> + <div class="progress"> + {% if course_percentage %} + {% if course_percentage <= 50 %} + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="{{course_percentage}}" + aria-valuemin="0" aria-valuemax="100" style="width:{{course_percentage}}%"> + {% elif course_percentage <= 75 %} + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="{{course_percentage}}" + aria-valuemin="0" aria-valuemax="100" style="width:{{course_percentage}}%"> + {% else %} + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{course_percentage}}" + aria-valuemin="0" aria-valuemax="100" style="width:{{course_percentage}}%"> + {% endif %} + <b style="color: white;">{{course_percentage}}% Completed</b> + </div> + {% else %} + <b style="color: black;">0% Completed</b> + {% endif %} + </div> + {% else %} + <div class="alert alert-danger"> + <strong>No lectures found</strong> + </div> + {% endif %} + <br> + {% for module, percent in modules %} + <div class="accordian-{{module.id}}"> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col-md-4"> + {{ module.name|title }} + </div> + <div class="col-md-3"> + <a class="card-link btn btn-outline-info" data-toggle="collapse" href="#collapse-{{module.id}}"> + Details <i class="fa fa-toggle-down"></i> + </a> + </div> + <div class="col-md-2"> + <a href="{% url 'yaksh:view_module' module.id course.id %}"> + {% get_module_status user module course as module_status %} + {% if module_status == "completed" %} + <div class="btn btn-info "> + View + </div> + {% elif module_status == "inprogress" %} + <div class="btn btn-primary"> + Continue + </div> + {% else %} + <div class="btn btn-success "> + Start + </div> + {% endif %} + </a> + </div> + <div class="col-md-3"> + <div class="progress bg-white"> + {% if percent %} + {% get_module_status user module course as module_status %} + {% if module_status == "completed" %} + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{percent}}" + aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> + {% elif module_status == "inprogress" %} + <div class="progress-bar bg-warning" role="progressbar" + aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> + {% endif %} + <b style="color: white;">{{percent}}% Completed</b> + </div> + {% else %} + <b style="color: black;">0% Completed</b> + {% endif %} + </div> + </div> + </div> + </div> + <div id="collapse-{{module.id}}" class="collapse hide" data-parent="#accordion-{{module.id}}"> + <div class="card-body"> + <table class="table yakshwell"> {% for unit in module.get_learning_units %} <tr> <td> {% if unit.type == "quiz" %} + {% if unit.quiz.is_exercise %} + <span class="fa fa-pencil"></span> + {% else %} + <span class="fa fa-puzzle-piece"></span> + {% endif %} + {% else %} + <span class="fa fa-book"></span> + {% endif %} + </td> + <td> + {% if unit.type == "quiz" %} {{unit.quiz.description}} {% else %} {{unit.lesson.name}} {% endif %} </td> <td> + {% if unit.type == "lesson" %} + <a href="{% url 'yaksh:show_lesson' unit.lesson.id module.id course.id %}" class="btn btn-outline-info"> + View + </a> + {% else %} + <a href="{% url 'yaksh:start_quiz' unit.quiz.questionpaper_set.get.id module.id course.id %}" class="btn btn-outline-info"> + View + </a> + {% endif %} + </td> + <td> {% get_unit_status course module unit user as status %} {% if status == "completed" %} - <span class="label label-success">{{status|title}} + <span class="badge badge-success">{{status|title}} </span> {% elif status == "inprogress" %} - <span class="label label-info">{{status|title}} + <span class="badge badge-info">{{status|title}} </span> {% else %} - <span class="label label-warning">{{status|title}} + <span class="badge badge-warning">{{status|title}} </span> {% endif %} </td> <td> {% if unit.type == "quiz" %} - {% if unit.quiz.is_exercise %} - Exercise - {% else %} - Quiz - {% endif %} - {% else %} - Lesson - {% endif %} - </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> + <a href="{% url 'yaksh:view_answerpaper' unit.quiz.questionpaper_set.get.id course.id %}" > + <i class="fa fa-eye"></i> Answer paper</a> {% else %} - <a> + <a > <i class="fa fa-eye-slash" aria-hidden="true"> - </i> Cannot view now </a> + </i>Answer paper</a> {% endif %} {% else %} ------ @@ -108,28 +162,14 @@ </td> </tr> {% endfor %} - </table> - </div> - </td> - <td> - <div class="progress"> - {% if percent <= 50 %} - <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> - {% elif percent <= 75 %} - <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> - {% else %} - <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> - {% endif %} - <b style="color: black;">{{percent}}% Completed</b> - </div> - </div> - </td> - </tr> - {% endfor %} - </table> + </table> + </div> + </div> + </div> + </div> + <br> + {% endfor %} </div> </div> -{% else %} - <h3> No lectures found </h3> -{% endif %} +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/course_progress.html b/yaksh/templates/yaksh/course_progress.html new file mode 100644 index 0000000..826f84b --- /dev/null +++ b/yaksh/templates/yaksh/course_progress.html @@ -0,0 +1,79 @@ +<!-- Course Status --> +{% if is_progress %} +<div class="course_data"> + {% if student_details %} + <div class="text-center"> + <h3>Course Progress</h3> + <br> + <div class="row"> + <div class="col"> + Number Of Students: {{ students_no }} + </div> + <div class="col"> + <a href="{% url 'yaksh:download_course_progress' course.id %}" class="btn btn-info"> + <i class="fa fa-download"></i> Download Data + </a> + </div> + </div> + </div> + <br> + {% include "yaksh/paginator.html" %} + <table class="tablesorter table table-bordered table-responsive-sm" id="course_table" data-sortlist="[0,0]"> + <thead> + <tr> + <th>Sr. No</th> + <th>Roll No.</th> + <th>Name</th> + <th>Current Unit</th> + <th>Completion Percentage</th> + <th>Grade</th> + </tr> + </thead> + <tbody> + {% for student, grade, percent, unit in student_details %} + <tr> + <td>{{forloop.counter}}</td> + <td> + {{ student.profile.roll_number}} + </td> + <td width="50%"> + <input type="hidden" id="url-{{student.id}}" data-url="{% url 'yaksh:get_user_data' course.id student.id %}"> + <a class="user_data" data-item-id="{{course.id}}+{{student.id}}" data-toggle="tooltip" title="Click to view Overall Course progress" data-placement="top"> + {{ student.get_full_name|title}} + <i class="fa fa-caret-down"></i> + </a> + <div id="show_status_{{course.id}}_{{student.id}}" style="display: None;"> + </div> + </td> + <td> + {% if unit %} + {% if unit.type == 'quiz' %} + {{unit.quiz.description}} + {% else %} + {{unit.lesson.name}} + {% endif %} + {% else %} + NA + {% endif%} + </td> + <td> + {{ percent }} % + </td> + <td> + {{ grade }} + </td> + </tr> + {% endfor %} + </tbody> + </table> + {% include "yaksh/paginator.html" %} + {% else %} + <center> + <span class="badge badge-warning"> + <big>No course data found</big> + </span> + </center> + {% endif %} +</div> +<!-- End Course Status --> +{% endif %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/course_send_mail.html b/yaksh/templates/yaksh/course_send_mail.html new file mode 100644 index 0000000..57442a6 --- /dev/null +++ b/yaksh/templates/yaksh/course_send_mail.html @@ -0,0 +1,63 @@ +<!-- Send Mail --> +{% if is_mail %} +<div id="send-mail"> + {% if enrolled %} + <form action="{% url 'yaksh:send_mail' course.id %}" method="post" id="send_mail_form" enctype="multipart/form-data"> + {% csrf_token %} + <div class="card"> + <div class="card-body"> + <textarea name="subject" class="form-control" id="subject" placeholder="Email Subject"></textarea> + <br><br> + <textarea name="body" id="email_body"></textarea><br> + Attachments: + <div class="input-group mb-3"> + <div class="custom-file"> + <input type="file" class="custom-file-input" name="email_attach" id="upload" multiple=""> + <label class="custom-file-label" for="upload">Choose file</label> + </div> + </div> + <br> + </div> + </div> + <br> + <input type="checkbox" class="send_check"/> + <font size="5">Select all</font> + <div id="sender_list"> + <table id="mail_table" class="tablesorter table table-striped table-responsive-sm course-detail" data-sortlist="[1,0]"> + <thead> + <th></th> + <th>Full Name <i class="fa fa-sort"></i></th> + <th>Email <i class="fa fa-sort"></i></th> + <th>Roll Number <i class="fa fa-sort"></i></th> + <th>Institute <i class="fa fa-sort"></i></th> + </thead> + <tbody> + {% for enroll in enrolled %} + <tr> + <td> + {{ forloop.counter }}. + <input type="checkbox" name="check" value="{{ enroll.id }}"> + </td> + <td> {{ enroll.get_full_name|title }} </td> + <td> {{enroll.email}}</td> + {% with enroll.profile as user_profile %} + <td> {{user_profile.roll_number}}</td> + <td> {{user_profile.institute}}</td> + {% endwith %} + </tr> + {% endfor %} + </tbody> + </table> + <button class="btn btn-success btn-lg" type="submit" name='send_mail' value='send_mail' id="send_mail"> + Send Mail + </button> + </div> + </form> + {% else %} + <center> + <span class="badge badge-warning"><big> No enrolled students yet</big></span> + </center> + {% endif %} +</div> +<!-- End send mail --> +{% endif %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/course_students.html b/yaksh/templates/yaksh/course_students.html new file mode 100644 index 0000000..2052a69 --- /dev/null +++ b/yaksh/templates/yaksh/course_students.html @@ -0,0 +1,245 @@ +{% if is_students %} <!-- Start if course students --> +<!-- Upload Users --> +<div id="accordian-upload" class="card"> + <div class="card-header"> + <a class="card-link" data-toggle="collapse" href="#upload_users_csv"> + Upload Users <i class="fa fa-angle-down"></i> + </a> + </div> +</div> +<div id="upload_users_csv" class="collapse hide" data-parent="#accordion-upload"> + <div class="card-body"> + <form id="upload_users" action="{% url 'yaksh:upload_users' course.id %}" method="POST" enctype="multipart/form-data"> + {% csrf_token %} + <div class="input-group mb-3"> + <div class="custom-file"> + <input type="file" class="custom-file-input" name="csv_file" id="upload"/> + <label class="custom-file-label" for="upload">Choose file</label> + </div> + <div class="input-group-append"> + <button class="btn btn-outline-primary" type="submit"> + <i class="fa fa-upload"></i> + Upload + </button> + </div> + </div> + </form> + <hr> + <p> + - The uploaded csv should have headers exactly same as mentioned below:<br /> + <b>firstname, lastname, email, username, password, institute, roll_no, department, + remove</b><br /> + - Mandatory fields are <b> firstname, lastname and email. </b><br /> + - Other fields are optional. <br /> + - If username and password are not provided then + <b>Users created will have username and password same as their email</b> + </p> + <p> + <b> Click + <a class="btn btn-success" href="{% url 'yaksh:download_sample_csv' %}"> + here + </a> to download a sample CSV, edit and upload it</b> + </p> + </div> +</div> +<!-- End Upload users --> +<br> +<!-- Requested Students --> +<div id="accordian-request" class="card"> + <div class="card-header"> + <a class="card-link" data-toggle="collapse" href="#requested"> + Requested Students <i class="fa fa-angle-down"></i> + </a> + </div> +</div> +<div id="requested" class="collapse show" data-parent="#accordion-request"> + {% if requested %} + <br> + <input type="checkbox" class="checkall"/> + <font size="5">Select all</font> + <div id="enroll-all"> + <form action="{% url 'yaksh:enroll_users' course.id %}" method="post"> + {% csrf_token %} + <table id="requested_table" class="tablesorter table table-striped table-responsive-sm course-detail" data-sortlist="[1,0]"> + <thead> + <th></th> + <th>Full Name <i class="fa fa-sort"></i></th> + <th>Email <i class="fa fa-sort"></i></th> + <th>Roll Number <i class="fa fa-sort"></i></th> + <th>Institute <i class="fa fa-sort"></i></th> + <th>Department <i class="fa fa-sort"></i></th> + <th>Enroll/Reject</th> + </thead> + <tbody> + {% for request in requested %} + <tr> + <td> + {{ forloop.counter }}. + <input type="checkbox" name="check" value="{{ request.id }}"> + </td> + <td>{{request.get_full_name}}</td> + <td> {{request.email}}</td> + {% with request.profile as request_profile %} + <td> {{request_profile.roll_number}}</td> + <td> {{request_profile.institute}}</td> + <td> {{request_profile.department}}</td> + {% endwith %} + <td> + <a class="btn btn-success" + href="{% url 'yaksh:enroll_user' course.id request.id %}"> + <i class="fa fa-plus-square"></i> + Enroll </a> + <a class="btn btn-danger" + href="{% url 'yaksh:reject_user' course.id request.id %}"> + <i class="fa fa-minus-square"></i> + Reject </a> + </td> + </tr> + {% endfor %} + </tbody> + </table> + <button class="btn btn-success btn-lg" type="submit" name='enroll' value='enroll'> + <i class="fa fa-plus-square"></i> + Enroll Selected + </button> <br> + </form> + </div> + {% else %} + <center> + <span class="badge badge-warning"><big> No requests yet</big></span> + </center> + {% endif %} +</div> +<!-- End Requested Students --> +<br> +<!-- Enrolled Students --> +<div id="accordian-enrolled" class="card"> + <div class="card-header"> + <a class="card-link" data-toggle="collapse" href="#enrolled"> + Enrolled Students <i class="fa fa-angle-down"></i> + </a> + </div> +</div> +<div id="enrolled" class="collapse hide" data-parent="#accordion-enrolled"> + {% if enrolled %} + <br> + <input type="checkbox" class="reject"/> + <font size="5">Select all</font> + <div id="reject"> + <form action="{% url 'yaksh:reject_users' course.id %}" method="post" id="reject-form"> + {% csrf_token %} + <table id="enrolled_table" class="tablesorter table table-striped table-responsive-sm course-detail" data-sortlist="[1,0]" style="width: 100%"> + <thead> + <th></th> + <th>Full Name <i class="fa fa-sort"></i></th> + <th>Email <i class="fa fa-sort"></i></th> + <th>Roll Number <i class="fa fa-sort"></i></th> + <th>Institute <i class="fa fa-sort"></i></th> + <th>Department <i class="fa fa-sort"></i></th> + <th>Reject</th> + </thead> + <tbody> + {% for enroll in enrolled %} + <tr> + <td> + {{ forloop.counter }}. + <input type="checkbox" name="check" value="{{ enroll.id }}"> + </td> + <td> {{ enroll.get_full_name|title }} </td> + <td> {{enroll.email}}</td> + {% with enroll.profile as enroll_profile %} + <td> {{enroll_profile.roll_number}}</td> + <td> {{enroll_profile.institute}}</td> + <td> {{enroll_profile.department}}</td> + {% endwith %} + <td> + <a class="btn btn-danger" + href="{% url 'yaksh:reject_user' course.id enroll.id %}"> + <i class="fa fa-minus-square"></i> + Reject + </a> + </td> + </tr> + {% endfor %} + </tbody> + </table> + <button class="btn btn-danger btn-lg" type="submit" name='reject' value='reject'> + <i class="fa fa-minus-square"></i> + Reject Selected + </button> <br> + </form> + </div> + {% else %} + <center> + <span class="badge badge-warning"><big> No enrolled students yet</big></span> + </center> + {% endif %} +</div> +<!-- End Enrolled Students --> + +<br> +<!-- Rejected Students --> +<div id="accordian-rejected" class="card"> + <div class="card-header"> + <a class="card-link" data-toggle="collapse" href="#rejected"> + Rejected Students <i class="fa fa-angle-down"></i> + </a> + </div> +</div> +<div id="rejected" class="collapse hide" data-parent="#accordion-rejected"> + {% if rejected %} + <br> + <input type="checkbox" class="enroll"/> + <font size="5">Select all</font> + <div id="enroll"> + <form action="{% url 'yaksh:enroll_rejected' course.id %}" method="post"> + {% csrf_token %} + <table id="rejected_table" class="tablesorter table table-striped table-responsive-sm course-detail" data-sortlist="[1,0]"> + <thead> + <th>Full Name <i class="fa fa-sort"></i></th> + <th>Email <i class="fa fa-sort"></i></th> + <th>Roll Number <i class="fa fa-sort"></i></th> + <th>Institute <i class="fa fa-sort"></i></th> + <th>Department <i class="fa fa-sort"></i></th> + <th>Enroll</th> + </thead> + <tbody> + {% for reject in rejected %} + <tr> + <td> + {{ forloop.counter }}. + <input type="checkbox" name="check" value="{{ reject.id }}"> + </td> + <td>{{reject.get_full_name|title}}</td> + <td> {{reject.email}}</td> + {% with reject.profile as reject_profile %} + <td> {{reject_profile.roll_number}}</td> + <td> {{reject_profile.institute}}</td> + <td> {{reject_profile.department}}</td> + {% endwith %} + <td> + <a class="btn btn-success" + href="{% url 'yaksh:enroll_rejected' course.id reject.id %}"> + <i class="fa fa-plus-square"></i> + Enroll </a> + </td> + </tr> + {% endfor %} + </tbody> + </table> + <br> + <button class="btn btn-success btn-lg" type="submit" name='enroll' value='enroll'> + <i class="fa fa-plus-square"></i> + Enroll Selected + </button> + <br> + </form> + </div> + {% else %} + <center> + <span class="badge badge-warning"><big> No rejected students yet</big></span> + </center> + {% endif %} +</div> +<!-- End Rejected Students --> +{% endif %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/course_teachers.html b/yaksh/templates/yaksh/course_teachers.html new file mode 100644 index 0000000..1b1af87 --- /dev/null +++ b/yaksh/templates/yaksh/course_teachers.html @@ -0,0 +1,29 @@ +<center><h3>Teacher(s)/TA(s)</h3></center> +<br> + +{% if teachers %} + <form action="{% url 'yaksh:remove_teacher' course.id %}" method="post"> + {% csrf_token %} + <div class="container"> + <table class="table table-responsive-sm course-detail"> + <tr> + <th>Select</th> + <th>Name</th> + </tr> + {% for teacher in teachers %} + <tr> + <td><input type="checkbox" name="remove" value="{{ teacher.id }}"></td> + <td>{{ teacher.get_full_name }}</td> + </tr> + {% endfor %} + <table> + </div> + <br> + <button class="btn btn-danger" type="submit" data-toggle="tooltip" title="Remove Selected Teachers from this course"> + <i class="fa fa-minus-square"></i> + Remove Teachers + </button> + </form> +{% else %} + <center><b class="badge badge-warning">No Teacher(s) added</b></center> +{% endif %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html index 3a98792..084d0f6 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -1,30 +1,13 @@ {% extends "manage.html" %} +{% load static %} {% block title %} Courses {% endblock %} {% block pagetitle %} Courses {% endblock pagetitle %} + {% block script %} -<script> - $(document).ready(function(){ - $('[data-toggle="tooltip"]').tooltip(); - $("#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 type="text/javascript" src="{% static 'yaksh/js/show_courses.js' %}"> </script> {% endblock %} + {% block css %} <style> .test + .tooltip.top > .tooltip-inner { @@ -34,468 +17,309 @@ </style> {% 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> - <li> - <a href="{% url 'grades:grading_systems'%}"> - Add/View Grading Systems </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 %} -<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 %} - <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-333" style="width: auto;"> - <input type="checkbox" name="remove" value="{{ teacher.id }}"> {{ teacher.get_full_name }} - </div> +<div class="container-fluid"> + <div class="container"> + <div class="row"> + <div class="col-md-8"> + <ul class="nav nav-pills" id="course_tabs"> + <li class="nav-item"> + <a class="nav-link {% if created %}active{% endif %}" href="{% url 'yaksh:courses' %}"> + My Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add/Edit Course + </a> + </li> + <li class="nav-item dropdown hide"> + <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">More</a> + <div class="dropdown-menu hide" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 37px, 0px); top: 0px; left: 0px; will-change: transform;"> + <a class="dropdown-item" href="{% url 'yaksh:show_all_quizzes' %}"> + Add/View Quizzes + </a> + <a class="dropdown-item" href="{% url 'yaksh:show_all_lessons' %}"> + Add/View Lessons + </a> + <a class="dropdown-item" href="{% url 'yaksh:show_all_modules' %}"> + Add/View Modules + </a> + <a href="{% url 'grades:grading_systems'%}" class="dropdown-item" > + Add/View Grading Systems + </a> + </div> + </li> + </ul> </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}}/" data-toggle="tooltip" title="Add/Remove/Change course modules" data-placement="top"> - 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 class="test" href="{{URL_ROOT}}/exam/manage/duplicate_course/{{ course.id }}/" data-toggle="tooltip" title="Creates Copy of selected Course as well as its Modules, Lessons/Quizzes" data-placement="top"> - Clone Course</a> - </li> - <br> - <li> - <a href="{{URL_ROOT}}/exam/manage/courses/download_course/{{course.id}}" data-toggle="tooltip" title="Download course content for offline view" data-placement="top"> - Download course offline - </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" %} - {% if unit.quiz.is_exercise %} - <a href="{{URL_ROOT}}/exam/manage/add_exercise/{{unit.quiz.id}}/{{course.id}}"> - {{unit.quiz.description}}</a> - {% else %} - <a href="{{URL_ROOT}}/exam/manage/addquiz/{{unit.quiz.id}}/{{course.id}}"> - {{unit.quiz.description}}</a> - {% endif %} - {% 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 --> + </div> + <div class="container"> + {% if not objects %} + <br><br> + <div class="alert alert-info"> + <center> <h3> No Courses Found </h3> </center> + </div> {% 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> -{% 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> + <hr> + <form name=frm action="" method="post"> + {% csrf_token %} + <div class="card"> + <div class="card-header"> + <h3>Search/Filter Courses</h3> + </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + {{ form.search_tags }} + </div> + <div class="col-md-3"> + {{ form.search_status }} + </div> + </div> + <br> + <button class="btn btn-success" type="submit">Search</button> + <a class="btn btn-primary" href="{% url 'yaksh:courses' %}"> + Clear Search + </a> + </div> + </div> + </form> + <hr> + <center><h4 class="badge badge-success">{{ courses_found }} Course(s) Available</h4></center> - {% for course in allotted_courses %} - <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"> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} + {% endif %} + {% with objects as courses %} <div class="row"> - <div class="col-md-333" style="width: auto;"> - <input type="checkbox" name="remove" value="{{ teacher.id }}"> - {{ teacher.get_full_name }} + <div class="col-md-4"> + {% include "yaksh/paginator.html" %} + </div> + <div class="ml-auto"> + <div class="nav nav-pills" role="tablist" aria-orientation="vertical"> + <a id="listbtn" class="nav-link" data-toggle="pill" role="tab" aria-controls="show" aria-selected="true"> + <i class="fa fa-list"></i> + </a> + <a id="gridbtn" class="nav-link" data-toggle="pill" role="tab" aria-controls="updown" aria-selected="false"> + <i class="fa fa-columns"></i> + </a> + </div> </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 class="test" href="{{URL_ROOT}}/exam/manage/duplicate_course/{{ course.id }}/" data-toggle="tooltip" title="Creates Copy of selected Course as well as its Modules, Lessons/Quizzes" data-placement="top"> - Clone Course</a> - </li> - <br> - <li> - <a href="{{URL_ROOT}}/exam/manage/courses/download_course/{{course.id}}" data-toggle="tooltip" title="Download course content for offline view" data-placement="top">Download course offline - </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" %} - {% if unit.quiz.is_exercise %} - <a href="{{URL_ROOT}}/exam/manage/add_exercise/{{unit.quiz.id}}/{{course.id}}"> - {{unit.quiz.description}}</a> - {% else %} - <a href="{{URL_ROOT}}/exam/manage/addquiz/{{unit.quiz.id}}/{{course.id}}"> - {{unit.quiz.description}}</a> - {% endif %} - {% else %} - <a href="{{URL_ROOT}}/exam/manage/courses/edit_lesson/{{unit.lesson.id}}/{{course.id}}"> - {{unit.lesson.name}}</a> - {% endif %} - </li> - </ul> + + <div class="tab-content"> + <div class="tab-pane active" id="gridview" role="tabpanel" aria-labelledby="gridbtn"> + <!-- GridView --> + <br> + <div class="row"> + <br> + {% for course in courses %} + <div class="col-md-6"> + <div class="card border-primary"> + <div class="card-header" style="height: 150px"> + {{course.name}} + </div> + <div class="card-body"> + <div class="row"> + <div class="col"> + <strong>Starts On:</strong> + {{course.start_enroll_time}} + <br> + <strong>Ends On:</strong> + {{course.end_enroll_time}} + </div> + </div> + <hr> + <div class="row"> + <div class="col-md-5"> + <span class="badge badge-pill badge-info"> + {% if user.id != course.creator.id %} + Allotted Course + {% else %} + Created Course + {% endif %} + </span> + </div> + <div class="col-md-3"> + {% if course.active %} + <span class="badge badge-pill badge-success"> + Active + </span> + {% else %} + <span class="badge badge-pill badge-danger"> + Inactive + </span> + {% endif %} + </div> + <div class="col-md-4"> + <a href="{% url 'yaksh:toggle_course_status' course.id %}"> + {% if course.active %} + <i class="fa fa-toggle-on fa-2x"></i> + {% else %} + <i class="fa fa-toggle-off fa-2x"></i> + {% endif %} + </a> + </div> + </div> + <hr> + <div class="row"> + <div class="col-md-5"> + <a href="{% url 'yaksh:edit_course' course.id %}" class="btn btn-info"> + <i class="fa fa-edit"></i> + Edit Course + </a> + </div> + <div class="col-md-5"> + <a href="{% url 'yaksh:course_detail' course.id %}" class="btn btn-primary"> + <i class="fa fa-tasks"></i> + Manage Course + </a> + </div> + </div> + <br> + <div class="row"> + <div class="col-md-5"> + <a href="{% url 'yaksh:duplicate_course' course.id %}" class="btn btn-secondary"> + <i class="fa fa-clone"></i> + Clone Course + </a> + </div> + <div class="col-md-5"> + <div class="btn-group" role="group" aria-label="Button group with nested dropdown"> + <button type="button" class="btn btn-secondary"> + <i class="fa fa-download"></i> + Download + </button> + <div class="btn-group" role="group"> + <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button> + <div class="dropdown-menu" aria-labelledby="btnGroupDrop1" style=""> + <a class="dropdown-item" href="{% url 'yaksh:download_course_csv' course.id %}"> + CSV + </a> + <a class="dropdown-item" href="{% url 'yaksh:download_course' course.id %}"> + Course + </a> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + <br> + </div> + {% endfor %} + <br> + </div> + </div> + <div class="tab-pane" id="listview" role="tabpanel" aria-labelledby="gridbtn"> + <!-- ListView --> + <br> + {% for course in courses %} + <div class="card"> + <div class="card-header bg-secondary"> + <div class="row"> + <div class="col-md-5"> + {{course.name}} + </div> + <div class="col-md-3"> + <span class="badge badge-pill badge-info"> + {% if user.id != course.creator.id %} + Allotted Course + {% else %} + Created Course + {% endif %} + </span> + </div> + <div class="col-md-2"> + {% if course.active %} + <span class="badge badge-pill badge-success"> + Active + </span> + {% else %} + <span class="badge badge-pill badge-danger"> + Inactive + </span> + {% endif %} + </div> + <div class="col-md-2"> + <a href="{% url 'yaksh:toggle_course_status' course.id %}"> + {% if course.active %} + <i class="fa fa-toggle-on fa-2x"></i> + {% else %} + <i class="fa fa-toggle-off fa-2x"></i> + {% endif %} + </a> + </div> + </div> + </div> + <div class="card-body"> + <div class="row"> + <div class="col"> + <strong>Starts On:</strong> + {{course.start_enroll_time}} + <br> + <strong>Ends On:</strong> + {{course.end_enroll_time}} + </div> + </div> + <hr> + <div class="row"> + <div class="col-md-3"> + <a href="{% url 'yaksh:edit_course' course.id %}" class="btn btn-info"> + <i class="fa fa-edit"></i> + Edit Course + </a> + </div> + <div class="col-md-3"> + <a href="{% url 'yaksh:course_detail' course.id %}" class="btn btn-primary"> + <i class="fa fa-tasks"></i> + Manage Course + </a> + </div> + <div class="col-md-3"> + <div class="btn-group" role="group" aria-label="Button group with nested dropdown"> + <button type="button" class="btn btn-secondary"> + <i class="fa fa-download"></i> + Download + </button> + <div class="btn-group" role="group"> + <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button> + <div class="dropdown-menu" aria-labelledby="btnGroupDrop1" style=""> + <a class="dropdown-item" href="{% url 'yaksh:download_course_csv' course.id %}"> + CSV + </a> + <a class="dropdown-item" href="{% url 'yaksh:download_course' course.id %}"> + Course + </a> + </div> + </div> + </div> + </div> + <div class="col-md-3"> + <a href="{% url 'yaksh:duplicate_course' course.id %}" class="btn btn-secondary"> + <i class="fa fa-clone"></i> + Clone Course + </a> + </div> + </div> + </div> + </div> + <br> {% endfor %} - </td> - </tr> - {% endfor %} <!-- end for modules --> - {% else %} - No learning modules + <br> + </div> + </div> + {% include "yaksh/paginator.html" %} + {% endwith %} {% 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> - <a href="{{URL_ROOT}}/exam/manage/add_exercise/" class="btn btn-primary">Add New Exercise</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"> - {% if quiz.is_exercise %} - <a href="{{URL_ROOT}}/exam/manage/add_exercise/{{quiz.id}}/">{{ quiz.description }}</a> - {% else %} - <a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a> - {% endif %} - {% 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> - <a href="{{URL_ROOT}}/exam/manage/preview_questionpaper/{{quiz.questionpaper_set.get.id}}" class="btn btn-primary active btn-xs" target="_blank"> - View - </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> - {% if lesson.active %} - <span class="label label-success">Active</span> - {% else %} - <span class="label label-danger">Closed</span> - {% endif %} - </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> - {% if module.active %} - <span class="label label-success">Active</span> - {% else %} - <span class="label label-danger">Closed</span> - {% endif %} - </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 %} - {{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 %} -</div> - -{% endblock %} +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/demo_video.html b/yaksh/templates/yaksh/demo_video.html new file mode 100644 index 0000000..74fd7c8 --- /dev/null +++ b/yaksh/templates/yaksh/demo_video.html @@ -0,0 +1,11 @@ +<br>
+<center>
+<div id="iframe_div">
+ <div style="width: 640px; height: 480px; position: relative;">
+ <iframe id="video_frame" src="https://www.youtube.com/embed/oHmm3mPxg6Y" width="640" height="480" frameborder="0" allowfullscreen>
+ </iframe>
+ <div style="width: 80px; height: 80px; position: absolute; opacity: 0; right: 0px; top: 0px;">
+ </div>
+ </div>
+</div>
+</center>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/design_course_session.html b/yaksh/templates/yaksh/design_course_session.html index 6542e3c..a15f4b1 100644 --- a/yaksh/templates/yaksh/design_course_session.html +++ b/yaksh/templates/yaksh/design_course_session.html @@ -1,32 +1,25 @@ -{% extends "manage.html" %} -{% load custom_filters %} -{% block title %}Design Course Session{% endblock %} +{% load static %} -{% block pagetitle %}Design Course Session{% endblock %} +{% block title %} <center> <h3> Design Course Session </h3> </center>{% 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 language="JavaScript" type="text/javascript" src="{% 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" /> +<link rel="stylesheet" href="{% 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"> +<form action="{% url 'yaksh:design_course' course.id %}" method="POST" id="design_course_form"> {% csrf_token %} - <div class="tab-pane active" id="available-lesson-quiz"> + <div id="available-lesson-quiz"> <div class="row"> - <div class="col-md-8 col-md-offset-2 available-list"> + <div class="col-md-12 available-list"> <div id="fixed-available-wrapper"> <p><u><b>Available Modules:</b></u></p> <div id="fixed-available"> - <table id="course-details" class="table table-bordered"> - <tr> + <table id="course-details" class="table table-bordered table-responsive-sm"> + <tr class="bg-light"> <th width="2%">Select</th> <th>Modules</th> <th>Lessons/Quizzes</th> @@ -58,26 +51,34 @@ </div> <br> <center> - <button id="Add" name="Add" class="btn btn-success" type="submit">Add to course</button> + <button id="Add" name="Add" class="btn btn-success" type="submit"> + <i class="fa fa-plus-square"></i> Add to course</button> </center> <br><br> </div> - <div class="col-md-8 col-md-offset-2"> + <div class="col-md-12"> <div id="fixed-added-wrapper"> - <p><u><b>Choosen Modules:</b></u></p> + <p><u><b>Chosen Modules:</b></u></p> <div id="fixed-added"> - <table id="course-details" class="table table-bordered"> - <tr> + <table id="course-details" class="table table-bordered table-responsive-sm"> + <tr class="bg-light"> <th width="5%">Select</th> <th>Module</th> <th width="20%">Order</th> - <th width="25%" colspan="2">Check Prerequisite + <th width="25%" colspan="2">Check Prerequisite Completion <br> <a href="#" data-toggle="tooltip" id="prereq_msg"> <span class="glyphicon glyphicon-question-sign"> </span> What's This </a> </th> + <th width="25%" colspan="2">Check Prerequisite Passing + <br> + <a href="#" data-toggle="tooltip" id="prereq_passing_msg"> + <span class="glyphicon glyphicon-question-sign"> + </span> What's This + </a> + </th> </tr> <tr> <th scope="row"> </th> @@ -85,6 +86,8 @@ <td> </td> <th>Currently</th> <th>Change</th> + <th>Currently</th> + <th>Change</th> </tr> {% for module in added_learning_modules %} <tr> @@ -106,6 +109,16 @@ <td> <input type="checkbox" name="check_prereq" value="{{module.id}}"> </td> + <td> + {% if module.check_prerequisite_passes %} + Yes + {% else %} + No + {% endif %} + </td> + <td> + <input type="checkbox" name="check_prereq_passes" value="{{module.id}}"> + </td> </ul> </tr> {% endfor %} @@ -114,12 +127,13 @@ </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> + <button id="Remove" name="Remove" class="btn btn-danger" type="submit"><i class="fa fa-minus-square"></i> Remove from course</button> + <button id="Change" name="Change" class="btn btn-info" type="submit"><i class="fa fa-reorder"></i> Change Order</button> + <button id="Change" name="change_prerequisite_completion" class="btn btn-primary" type="submit"> Change Prerequisite Completion</button> + <button id="Change_prereq_passing" name="change_prerequisite_passing" class="btn btn-primary" type="submit"> Change Prerequisite Passing</button> + </center> </div> </div> <!-- /.row --> </div> -</form> -{% endblock %}
\ No newline at end of file +</form>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/design_questionpaper.html b/yaksh/templates/yaksh/design_questionpaper.html index 7e6d5c0..6e916a3 100644 --- a/yaksh/templates/yaksh/design_questionpaper.html +++ b/yaksh/templates/yaksh/design_questionpaper.html @@ -1,242 +1,293 @@ {% extends "manage.html" %} +{% load static %} {% block title %} Design Question Paper {% endblock title %} {% block subtitle %} Design Question Paper {% endblock %} {% block css %} - <link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/question_paper_creation.css" /> -<style> -select -{ - width:auto; -} -</style> + <link rel="stylesheet" media="all" type="text/css" href="{% static 'yaksh/css/question_paper_creation.css' %}" /> {% endblock %} {% block script %} - <script src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.9.1.min.js"></script> - <script src="{{ URL_ROOT }}/static/yaksh/js/bootstrap.js"></script> - <script src="{{ URL_ROOT }}/static/yaksh/js/bootstrap-tabs.js"></script> - <script src="{{ URL_ROOT }}/static/yaksh/js/question_paper_creation.js"></script> + <script src="{% static 'yaksh/js/jquery-ui.js' %}"></script> + <script src="{% static 'yaksh/js/question_paper_creation.js' %}"></script> {% endblock %} {% block content %} +<div class="container"> <input type=hidden id="url_root" value={{ URL_ROOT }}> {% if course_id %} - <form action="{{ URL_ROOT }}/exam/manage/designquestionpaper/{{ qpaper.quiz.id }}/{{ qpaper.id }}/{{course_id}}/" method="POST" id="design_q"> - <a href="{{URL_ROOT}}/exam/manage/courses" class="btn btn-danger">Cancel</a> + <form action="{% url 'yaksh:designquestionpaper' qpaper.quiz.id qpaper.id course_id %}" method="POST" id="design_q"> + <a href="{% url 'yaksh:get_course_modules' course_id %}" class="btn btn-primary"> + <i class="fa fa-arrow-left"></i> Back + </a> {% else %} - <form action="{{ URL_ROOT }}/exam/manage/designquestionpaper/{{ qpaper.quiz.id }}/{{ qpaper.id }}/" method="POST" id="design_q"> - <a href="{{URL_ROOT}}/exam/manage/courses/all_quizzes" class="btn btn-danger">Cancel</a> + <form action="{% url 'yaksh:designquestionpaper' qpaper.quiz.id qpaper.id %}" method="POST" id="design_q"> + <a href="{% url 'yaksh:show_all_quizzes' %}" class="btn btn-primary"> + <i class="fa fa-arrow-left"></i> Back + </a> {% endif %} {% csrf_token %} <input type=hidden name="is_active" id="is_active" value="{{ state }}"> -<center><b>Manual mode to design the {{lang}} Question Paper</center><br> - <ul class="nav nav-tabs tabs" data-tabs="tabs"> - <li class="active" id="fixed-tab"> - <a href="#fixed-questions" id="fixed"> - STEP 1<br> - Add Fixed Questions - </a> - </li> - <li id="random-tab"> - <a href="#random-questions" id="random"> - STEP 2<br> - Add Random Questions - </a> - </li> - <li id="finish-tab"> - <a href="#finish" id="finished"> - STEP 3<br> - Finish - </a></li> -</ul> - + <center><b>Manual mode to design the {{lang}} Question Paper</center><br> + <div class = "tab-base"> + <ul class="nav nav-pills tabs"> + <li id="fixed-tab"> + <a data-toggle="tab" href="#fixed-questions" class = "nav-link active" id="fixed"> + STEP 1<br> + Add Fixed Questions + </a> + </li> + <li id="random-tab"> + <a data-toggle="tab" href="#random-questions" class = "nav-link" id="random"> + STEP 2<br> + Add Random Questions + </a> + </li> + <li id="finish-tab"> + <a data-toggle="tab" href="#finish" class = "nav-link" id="finished"> + STEP 3<br> + Finish + </a></li> + </ul> + </div> + <br> <div> - <h3>Total Marks: <span id="total_marks" class="well"> {{ qpaper.total_marks }} </span></h3> + <h3>Total Marks: + <span id="total_marks" class="well"> {{ qpaper.total_marks }}</span> + </h3> </div> -<div class="tab-content"> - <!-- common to fixed and random questions --> - <div class="row" id="selectors"> - <h5 style="padding-left: 20px;">Please select Question type and Marks</h5> - <div class="col-md-6"> - {{ filter_form.question_type }} + <br> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> </div> - <div class="col-md-6"> - {{ filter_form.marks }} - </div> - </div> <!-- /.row --> - <br><br> - {% csrf_token %} - <div class="tab-pane active" id="fixed-questions"> - <h4 style="padding-left: 20px;">Or</h4> - <!-- Search questions using tags --> - <h4 style="padding-left: 20px;">Search using Tags: </h4> - <div class="col-md-14"> - <div class="input-group"> - <span class="input-group-addon" id="basic-addon1">Search Questions </span> - <input type="text" id="question_tags" name="question_tags" class="form-control" - placeholder="Search using comma separated Tags"> - <span class="input-group-btn"> - <button class="btn btn-default" type="submit">Search</button> - </span> + {% endfor %} + {% endif %} + <div class="tab-content"> + <!-- common to fixed and random questions --> + <div class="row" id="selectors"> + <div class = "col-md-8"> + <h5>Please select Question type and Marks</h5> + </div> <div class="col-md-6"> - <select class="form-control" id="sel1" onchange="append_tag(this);"> - {% if all_tags %} - <option value="" disabled selected>Available Tags</option> - {% for tag in all_tags %} - <option> - {{tag}} - </option> - {% endfor %} - {% else %} - <option value="" disabled selected>No Available Tags</option> - {% endif %} - </select> + {{ filter_form.question_type }} </div> - </div> - </div> - <br><br> - <div class="row"> <div class="col-md-6"> - <div id="fixed-available-wrapper"> - <p><u>Select questions to add:</u></p> - <div id="fixed-available"> - {% if state == "fixed" or state == "None" %} - <ul class="inputs-list"> - {% for question in questions %} - <li> - <label> - <input type="checkbox" name="questions" data-qid="{{question.id}}" value={{question.id}}> - <span> {{ question.summary }} </span> <span> {{ question.points }} </span> - </label> - </li> - {% endfor %} - </ul> - {% endif %} - </div> - <br /><br /> - <button id="add-fixed" name="add-fixed" class="btn small primary pull-right" type="submit">Add to paper</button> + {{ filter_form.marks }} + </div> + </div> <!-- /.row --> + <br> + {% csrf_token %} + <div class="tab-pane active" id="fixed-questions"> + <h4>Or</h4> + <!-- Search questions using tags --> + <h4>Search using Tags: </h4> + <span class="input-group-addon" id="basic-addon1">Search Questions: </span> + <div class="col-md-14"> + <div class="input-group"> + <input type="text" id="question_tags" name="question_tags" class="form-control" + placeholder="Search using comma separated Tags"> + <span class="input-group-btn"> + <button class="btn btn-outline-primary" type="submit"> + <i class="fa fa-search"></i> Search + </button> + </span> + <div class="col-md-6"> + <select class="form-control" id="sel1" onchange="append_tag(this);"> + {% if all_tags %} + <option value="" disabled selected>Available Tags</option> + {% for tag in all_tags %} + <option> + {{tag}} + </option> + {% endfor %} + {% else %} + <option value="" disabled selected>No Available Tags</option> + {% endif %} + </select> </div> </div> - <div class="col-md-6"> - <div id="fixed-added-wrapper"> - <p><u>Fixed questions currently in paper:</u></p> - <div id="fixed-added"> + </div> + <br><br> + <br> + <div class="row"> + <div class="col-md-6"> + <div id="fixed-available-wrapper"> + <p><u>Select questions to add:</u></p> + <div id="fixed-available"> + {% if state == "fixed" or state == "None" %} + <ul class="inputs-list"> + {% for question in questions %} + <li> + <label> + <input type="checkbox" name="questions" data-qid="{{question.id}}" value={{question.id}}> + <span> + {% if user == question.user %} + <a href="{% url 'yaksh:add_question' question.id %}" target="_blank">{{ question.summary }}</a> + {% else %} + {{question.summary}} + {% endif %} + </span> + <span> {{ question.points }}</span> + </label> + </li> + {% endfor %} + </ul> + {% endif %} + </div> + </div> + <br /> + <button id="add-fixed" name="add-fixed" class="btn btn-success pull-right" type="submit"> + <i class="fa fa-plus-square"></i> Add to paper + </button> + </div> + <div class="col-md-6"> + <div id="fixed-added-wrapper"> + <p><u>Fixed questions currently in paper:</u></p> + <div id="fixed-added"> <ul class="inputs-list"> {% for question in fixed_questions %} <li> <label> <input type="checkbox" name="added-questions" data-qid="{{question.id}}" value={{question.id}}> - <span> {{ question.summary }} </span> + <span> + {% if user == question.user %} + <a href="{% url 'yaksh:add_question' question.id %}" target="_blank">{{ question.summary }}</a> + {% else %} + {{question.summary}} + {% endif %} + </span> <span> {{ question.points }} </span> </label> </li> {% endfor %} </ul> + </div> </div> - <br /> - <button id="remove-fixed" name="remove-fixed" class="btn small primary pull-right" type="submit"> Remove from paper</button> + <br /> + <button id="remove-fixed" name="remove-fixed" class="btn btn-danger pull-right" type="submit"> + <i class="fa fa-minus-square"></i> Remove from paper + </button> </div> + </div> <!-- /.row --> + <br> + <div class="pull-right"> + <a class="btn btn-info" id="fixed-next">Next ></a> </div> - </div> <!-- /.row --> - <br> - <div class="pull-right"> - <a class="btn btn-primary" id="fixed-next">Next ></a> - </div> - </div> <!-- /#fixed-questions --> + </div> <!-- /#fixed-questions --> - <div class="tab-pane" id="random-questions"> - <div class="row"> - <div class="col-md-6"> - <div id="random-available-wrapper"> - <p><u>Select questions to add to the pool:</u></p> - <div id="random-available"> - {% if state == "random" %} - <select id="num_of_questions" name="num_of_questions"> - <option value="1">Number of questions to be picked from the pool</option> - {% for q in questions %} - {% if forloop.counter0 != 0 %} - <option value={{forloop.counter0}}>{{ forloop.counter0}}</option> + <div class="tab-pane" id="random-questions"> + <div class="row"> + <div class="col-md-6"> + <div id="random-available-wrapper"> + <p><u>Select questions to add to the pool:</u></p> + <div id="random-available"> + {% if state == "random" %} + <select id="num_of_questions" name="num_of_questions"> + <option value="1">Number of questions to be picked from the pool</option> + {% for q in questions %} + {% if forloop.counter0 != 0 %} + <option value={{forloop.counter0}}>{{ forloop.counter0}}</option> + {% endif %} + {% if questions|length == 1%} + <option value=1>1</option> {% endif %} - {% if questions|length == 1%} - <option value=1>1</option> - {% endif %} + {% endfor %} + </select> + <ul class="inputs-list"> + {% for question in questions %} + <li> + <label> + <input type="checkbox" name="random_questions" data-qid="{{question.id}}" value={{question.id}}> + <span> + {% if user == question.user %} + <a href="{% url 'yaksh:add_question' question.id %}" target="_blank">{{ question.summary }}</a> + {% else %} + {{question.summary}} + {% endif %}</span> + <span> {{ question.points }} </span> + </label> + </li> {% endfor %} - </select> - <ul class="inputs-list"> - {% for question in questions %} - <li> - <label> - <input type="checkbox" name="random_questions" data-qid="{{question.id}}" value={{question.id}}> - <span> {{ question.summary }} </span> <span> {{ question.points }} </span> - </label> - </li> - {% endfor %} - </ul> - {% endif %} + </ul> + {% endif %} + </div> </div> - <br /><br /> - <button id="add-random" name="add-random" class="btn small primary pull-right" type="submit">Add to paper</button> + <br> + <button id="add-random" name="add-random" class="btn btn-success pull-right" type="submit"> + <i class="fa fa-plus-square"></i> Add to paper + </button> </div> - </div> - <div class="col-md-6"> - <div id="random-added-wrapper"> - <p><u>Pool of questions currently in paper:</u></p> - <div id="random-added"> - <ul class="inputs-list"> - {% for random_set in random_sets %} - <li> - <label> - <input type="checkbox" name="random_sets" data-qid="{{random_set.id}}" value={{random_set.id}}> - <span> Random Set {{ forloop.counter }} (will take {{ random_set.num_questions }} randomly out of {{ random_set.questions.count }})</span> - </label> - </li> - {% for question in random_set.questions.all %} - <li> - <label> - <span> {{ question.summary }} </span> <span> {{ question.points }} </span> - </label> - </li> + <div class="col-md-6"> + <div id="random-added-wrapper"> + <p><u>Pool of questions currently in paper:</u></p> + <div id="random-added"> + <ul class="inputs-list"> + {% for random_set in random_sets %} + <li> + <label> + <input type="checkbox" name="random_sets" data-qid="{{random_set.id}}" value={{random_set.id}}> + <span> Random Set {{ forloop.counter }} (will take {{ random_set.num_questions }} randomly out of {{ random_set.questions.count }})</span> + </label> + </li> + {% for question in random_set.questions.all %} + <li> + <label> + <span> + {% if user == question.user %} + <a href="{% url 'yaksh:add_question' question.id %}" target="_blank">{{ question.summary }}</a> + {% else %} + {{question.summary}} + {% endif %}</span> + <span> {{ question.points }} </span> + </label> + </li> + {% endfor %} {% endfor %} - {% endfor %} - </ul> + </ul> + </div> </div> <br /> - <button id="remove-random" name="remove-random" class="btn small primary pull-right" type="submit"> Remove from paper</button> + <button id="remove-random" name="remove-random" class="btn btn-danger pull-right" type="submit"> + <i class="fa fa-minus-square"></i> Remove from paper + </button> </div> - </div> - </div> <!-- /.row --> - <br> - <div class="pull-left"> - <a class="btn btn-primary" id="random-prev">< Previous</a> - </div> - <div class="pull-right"> - <a class="btn btn-primary" id="random-next">Next ></a> - </div> - </div> <!-- /#random-questions --> - - <div class="tab-pane" id="finish"> - <center> - <h5><u>Almost finished creating your question paper</u></h5> - <label style="float: none;"> - {{ qpaper_form.shuffle_questions }} - <span>Shuffle questions' order for each student</span> - </label> <br><br> - <label style="float: none;"> - {{ qpaper_form.shuffle_testcases }} - <span>Shuffle MCQ/MCC options for each student</span> - </label> <br><br> - <input class ="btn primary large" type="submit" name="save" id="save" value="Save question paper"> + </div> <!-- /.row --> <br> <div class="pull-left"> - <a class="btn btn-primary" id="finish-prev">< Previous</a> + <a class="btn btn-info" id="random-prev">< Previous</a> </div> - </center> - </div> <!-- /#finish --> -</div> + <div class="pull-right"> + <a class="btn btn-info" id="random-next">Next ></a> + </div> + </div> <!-- /#random-questions --> + + <div class="tab-pane" id="finish"> + <center> + <h5><u>Almost finished creating your question paper</u></h5> + <label style="float: none;"> + {{ qpaper_form.shuffle_questions }} + <span>Shuffle questions' order for each student</span> + </label> <br><br> + <label style="float: none;"> + {{ qpaper_form.shuffle_testcases }} + <span>Shuffle MCQ/MCC options for each student</span> + </label> <br><br> + <input class="btn btn-success btn-lg" type="submit" name="save" id="save" value="Save"> + <br> + <div class="pull-left"> + <a class="btn btn-info" id="finish-prev">< Previous</a> + </div> + </center> + </div> <!-- /#finish --> + </div> <!-- /.tab-content --> </form> <br> @@ -252,6 +303,7 @@ select {% endif %} }) </script> +</div> {% endblock %} {% block manage %} {% endblock %} diff --git a/yaksh/templates/yaksh/download_course_templates/index.html b/yaksh/templates/yaksh/download_course_templates/index.html new file mode 100644 index 0000000..4b76e85 --- /dev/null +++ b/yaksh/templates/yaksh/download_course_templates/index.html @@ -0,0 +1,71 @@ +{% load custom_filters %} +<html> +<head> + <link rel="stylesheet" href="static/css/bootstrap.css"> + <link rel="stylesheet" href="static/css/bootstrap.min.css"> + <link rel="stylesheet" href="static/css/offline.css"> + <title> + {% block pagetitle %} {{course.name}} {% endblock %} + </title> +</head> +<body> +<nav class="navbar bg-dark navbar-dark"> + <div class="container-fluid"> + <div class="navbar-header"> + <a class="navbar-brand" href="../../index.html"> + <img src="static/images/yaksh_banner.png" alt="YAKSH"> + </img> + </a> + </div> + </div> +</nav> +<div class="container" style="margin-top:50px"> + <h1> + <center> + {% block subtitle %} + {{course.name}} + {% endblock %} + </center> + </h1> + <div class="row justify-content-md-center"> + <div class="col-md-10"> + {% block content %} + {% for module in modules %} + <section class="bg-grey text-center"> + <div class="row"> + <div class="col"> + {{module.name}} + </div> + <div class="col"> + <button class="btn btn-info" data-toggle="collapse" data-target="#{{module.id}}"> + View Lessons + </button> + </div> + <div class="col"> + <a href="{{module.name|replace_spaces}}/{{module.name|replace_spaces}}.html" target="_blank" class="btn btn-primary">Go to Module</a> + </div> + </div> + </section> + <br> + <div id="{{module.id}}" class="collapse"> + <ul class="list-group"> + {% for lesson in module.get_lesson_units %} + <li class="list-group-item">{{lesson.name}}</li> + {% endfor %} + </ul> + </div> + <br> + {% endfor %} + {% endblock %} + </div> + </div> +</div> +<footer class="footer" id="footer_div"> + <div class="container"> + <p align="center">Developed by FOSSEE group, IIT Bombay</p> + </div> +</footer> +</body> +<script src="static/js/jquery-3.3.1.min.js"></script> +<script src="static/js/bootstrap.min.js"></script> +</html>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/module.html b/yaksh/templates/yaksh/download_course_templates/module.html index 2ce5442..039eac2 100644 --- a/yaksh/templates/yaksh/module.html +++ b/yaksh/templates/yaksh/download_course_templates/module.html @@ -1,16 +1,17 @@ {% load custom_filters %} <html> -<link rel="stylesheet" href="../static/css/bootstrap.css"> -<link rel="stylesheet" href="../static/css/bootstrap.min.css"> -<link rel="stylesheet" href="../static/css/offline.css"> -<script src="../static/js/jquery-1.9.1.min.js"></script> -<script src="../static/js/bootstrap.min.js"></script> -<script src="https://vjs.zencdn.net/6.9.0/video.js"></script> -{% block pagetitle %} {{module.name}} {% endblock %} -<nav class="navbar navbar-inverse navbar-fixed-top"> +<head> + <link rel="stylesheet" href="../static/css/bootstrap.min.css"> + <link rel="stylesheet" href="../static/css/offline.css"> + <title> + {% block pagetitle %} {{module.name}} {% endblock %} + </title> +</head> +<body> + <nav class="navbar bg-dark navbar-dark"> <div class="container-fluid"> <div class="navbar-header"> - <a class="navbar-brand" href="#"> + <a class="navbar-brand" href="../../index.html"> <img src="../static/images/yaksh_banner.png" alt="YAKSH"> </img> </a> @@ -34,10 +35,16 @@ <h4><strong>Lessons (Click on lesson name to open lesson) </strong></h4> <ul class="list-group"> - {% for lesson in lessons %} - <a href="{{lesson.name|replace_spaces}}/{{lesson.name|replace_spaces}}.html" target="_blank" class="list-group-item"> - {{lesson.name}} + {% for unit in units %} + {% if unit.type == 'lesson' %} + <a href="{{unit.lesson.name|replace_spaces}}/{{unit.lesson.name|replace_spaces}}.html" target="_blank" class="list-group-item"> + {{unit.lesson.name}} + </a> + {% else %} + <a href="{{unit.quiz.description|replace_spaces}}/{{unit.quiz.description|replace_spaces}}.html" target="_blank" class="list-group-item"> + {{unit.quiz.description}} </a> + {% endif %} {% endfor %} </ul> </td> @@ -53,4 +60,8 @@ <p align="center">Developed by FOSSEE group, IIT Bombay</p> </div> </footer> +</body> +<script src="../static/js/jquery-3.3.1.min.js"></script> +<script src="../static/js/bootstrap.min.js"></script> +<script src="https://vjs.zencdn.net/6.9.0/video.js"></script> </html>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/download_course_templates/quiz.html b/yaksh/templates/yaksh/download_course_templates/quiz.html new file mode 100644 index 0000000..48bc12e --- /dev/null +++ b/yaksh/templates/yaksh/download_course_templates/quiz.html @@ -0,0 +1,114 @@ +{% load custom_filters %} +<html> +<head> + <link rel="stylesheet" href="../../static/css/bootstrap.min.css"> + <link rel="stylesheet" href="../../static/css/offline.css"> + <link rel="stylesheet" href="../../static/css/video-js.css"> + <link rel="stylesheet" href="../../static/css/yakshcustom.css" type="text/css" /> + + <title> + {% block pagetitle %} {{course.name}} {% endblock %} + </title> +</head> +<body> +<nav class="navbar bg-dark navbar-dark fixed-top"> + <div class="container-fluid"> + <div class="navbar-header"> + <a class="navbar-brand" href="../../index.html"> + <img src="../../static/images/yaksh_banner.png" alt="YAKSH"> + </img> + </a> + </div> + </div> +</nav> +<div class="container" style="margin-top:50px"> + + <div class="row"> + <nav class="col-md-2 d-none d-md-block bg-light sidebar"> + <div class="sidebar-sticky"> + <ul class="nav flex-column"> + <li class="nav-item"> + <a class="nav-link active" href="#"> + {{ module.name }} + </a> + </li> + <div class="sidebar-submenu"> + <ul> + <!-- loop --> + {% for unit in module.get_learning_units %} + {% if unit.type == 'lesson' %} + <li class="nav-item"> + <a class="nav-link {% if unit.lesson.name == lesson.name %}active{% endif %}" href="../{{unit.lesson.name|replace_spaces}}/{{unit.lesson.name|replace_spaces}}.html"> + {{unit.lesson.name}} + </a> + </li> + {% else %} + <li class="nav-item"> + <a class="nav-link {% if unit.lesson.name == lesson.name %}active{% endif %}" href="../{{unit.quiz.description|replace_spaces}}/{{unit.quiz.description|replace_spaces}}.html"> + {{unit.quiz.description}} + </a> + </li> + {% endif %} + {% endfor %} + <!-- End of loop --> + </ul> + </div> + </ul> + </div> + </nav> + <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4"> + <div class="col-md-10"> + <center> + <h1> + {% block subtitle %} + {{course.name}} + {% endblock %} + </h1> + <hr> + </center> + {% block content %} + <center><h2>{{module.name}}</h2></center> + <hr> + <div id="status"></div> + <hr> + <br> + <div class="text-center"> + <!-- Change Yaksh TODO --> + <a class="btn btn-success" href="http://yaksh.fossee.in/exam/start/{{quiz.questionpaper_set.get.id}}/{{module.id}}/{{course.id}}" target="_blank">{{quiz.description}}</a> + {% if next_unit.type == 'lesson' %} + <a class="btn btn-info" href="../{{next_unit.lesson.name|replace_spaces}}/{{next_unit.lesson.name|replace_spaces}}.html"> + Next + </a> + {% else %} + <a class="btn btn-info" href="../{{next_unit.quiz.description|replace_spaces}}/{{next_unit.quiz.description|replace_spaces}}.html" target="_blank"> + Next + </a> + {% endif %} + </div> + + {% endblock %} + </div> + </main> + </div> + <footer class="footer" id="footer_div"> + <p align="center">Developed by FOSSEE group, IIT Bombay</p> + </footer> +</div> + +</body> +<script src="../../static/js/jquery-3.3.1.min.js"></script> +<script src="../../static/js/bootstrap.min.js"></script> +<script src="../../static/js/video.js"></script> + +<script type="text/javascript"> +$(document).ready(function(){ + var online = navigator.onLine; + if(online){ + var status = document.getElementById("status").innerHTML = "<span class='badge badge-success'>User is online</span>"; + + }else{ + document.getElementById("status").innerHTML = "<span class='badge badge-danger'>User is offline</span>"; + } +}); +</script> +</html>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/download_course_templates/unit.html b/yaksh/templates/yaksh/download_course_templates/unit.html new file mode 100644 index 0000000..7e618c7 --- /dev/null +++ b/yaksh/templates/yaksh/download_course_templates/unit.html @@ -0,0 +1,133 @@ +{% load custom_filters %} +<html> +<head> + <link rel="stylesheet" href="../../static/css/bootstrap.min.css"> + <link rel="stylesheet" href="../../static/css/offline.css"> + <link rel="stylesheet" href="../../static/css/video-js.css"> + <link rel="stylesheet" href="../../static/css/yakshcustom.css" type="text/css" /> + + <title> + {% block pagetitle %} {{module.name}} {% endblock %} + </title> +</head> +<body> +<nav class="navbar bg-dark navbar-dark fixed-top"> + <div class="container-fluid"> + <div class="navbar-header"> + <a class="navbar-brand" href="../../index.html"> + <img src="../../static/images/yaksh_banner.png" alt="YAKSH"> + </img> + </a> + </div> + </div> +</nav> +<div class="container" style="margin-top:50px"> + + <div class="row"> + <nav class="col-md-2 d-none d-md-block bg-light sidebar"> + <div class="sidebar-sticky"> + <ul class="nav flex-column"> + <li class="nav-item"> + <a class="nav-link active" href="#"> + {{ module.name }} + </a> + </li> + <div class="sidebar-submenu"> + <ul> + <!-- loop --> + {% for unit in module.get_learning_units %} + {% if unit.type == 'lesson' %} + <li class="nav-item"> + <a class="nav-link {% if unit.lesson.name == lesson.name %}active{% endif %}" href="../{{unit.lesson.name|replace_spaces}}/{{unit.lesson.name|replace_spaces}}.html"> + {{unit.lesson.name}} + </a> + </li> + {% else %} + <li class="nav-item"> + <a class="nav-link {% if unit.lesson.name == lesson.name %}active{% endif %}" href="../{{unit.quiz.description|replace_spaces}}/{{unit.quiz.description|replace_spaces}}.html"> + {{unit.quiz.description}} + </a> + </li> + {% endif %} + {% endfor %} + <!-- End of loop --> + </ul> + </div> + </ul> + </div> + </nav> + + <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4"> + <div class="col-md-10"> + <center> + <h1> + {% block subtitle %} + {{course.name}} + {% endblock %} + </h1> + <hr> + </center> + {% block content %} + <center><h2>{{module.name}}</h2></center> + <hr> + <h3>{{lesson.name}}</h3> + {% if lesson.video_file %} + <video id="lesson_video" height="500" class="video-js" controls preload="auto" data-setup='{"playbackRates": [0.5, 1, 1.5, 2]}'> + <source src="{{lesson.video_file.name|file_title}}"> + </video> + {% endif %} + <br> + <table class="table"> + <tr> + <td> + {{lesson.html_data|safe}} + </td> + </tr> + <tr> + <td> + {% if lesson_files %} + <h4><strong>Lesson Files (Click on lesson file to download) + </strong></h4> + <ul class="list-group"> + {% for file in lesson_files %} + <a href="{{file.file.name|file_title}}" class="list-group-item"> + {{file.file.name|file_title}} + </a> + {% endfor %} + </ul> + {% else %} + <ul class="list-group"> + <li class="list-group-item"> + <h4>No files for {{lesson.name}}</h4> + </li> + </ul> + {% endif %} + </td> + </tr> + </table> + <div class="text-center"> + <!-- Change Yaksh TODO --> + {% if next_unit.type == 'lesson' %} + <a class="btn btn-info" href="../{{next_unit.lesson.name|replace_spaces}}/{{next_unit.lesson.name|replace_spaces}}.html"> + Next + </a> + {% else %} + <a class="btn btn-info" href="../{{next_unit.quiz.description|replace_spaces}}/{{next_unit.quiz.description|replace_spaces}}.html" target="_blank"> + Next + </a> + {% endif %} + </div> + {% endblock %} + </div> + </main> + </div> + <footer class="footer" id="footer_div"> + <p align="center">Developed by FOSSEE group, IIT Bombay</p> + </footer> +</div> + +</body> +<script src="../../static/js/jquery-3.3.1.min.js"></script> +<script src="../../static/js/bootstrap.min.js"></script> +<script src="../../static/js/video.js"></script> +</html>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/editprofile.html b/yaksh/templates/yaksh/editprofile.html index e5191ad..47e74ea 100644 --- a/yaksh/templates/yaksh/editprofile.html +++ b/yaksh/templates/yaksh/editprofile.html @@ -1,13 +1,52 @@ {% extends template %} -{% block pagetitle %} Please fill in the following details {% endblock %} +{% block title %} Edit Profile {% endblock %} +{% block pagetitle %} My Profile {% endblock %} {% block main %} -<form action="{{URL_ROOT}}/exam/editprofile/" method="post" > - {% csrf_token %} - <center> - <table class="table table-bordered"> - {{ form.as_table }} - </table> - </center> - <button class="btn btn-primary pull-right" type="submit">Save Profile</button> -</form> +<div class="container"> + <br> + <form action="{% url 'yaksh:edit_profile'%}" method="post" > + {% csrf_token %} + <center> + <div class="row justify-content-center form-group"> + <div class="col-md-4 col-md-offset-4"> + <form action="" method="post"> + <fieldset> + {% csrf_token %} + <center> + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + {% for field in form %} + <td>{{ field }} <small>{{ field.help_text }}</small></td> + <br> + {% endfor %} + <br> + <br> + </center> + <button class="btn btn-success btn-lg" type="submit">Update</button> + <a href="{% url 'yaksh:index' %}" class="btn btn-primary btn-lg">Cancel</a></center> + </fieldset> + </form> + </div> + </div> + </center> + </form> +</div> {% endblock main %} diff --git a/yaksh/templates/yaksh/editquestionpaper.html b/yaksh/templates/yaksh/editquestionpaper.html index fa6d7d7..c91feaf 100644 --- a/yaksh/templates/yaksh/editquestionpaper.html +++ b/yaksh/templates/yaksh/editquestionpaper.html @@ -8,6 +8,7 @@ {% endblock %} {% block manage %} +<div class="yakshwell container"> <form name=frm action="" method="post"> {% csrf_token %} <p><u> Fixed Questions </u></p> @@ -23,4 +24,5 @@ {% endfor %} <br> </form> +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/error_template.html b/yaksh/templates/yaksh/error_template.html index 301020e..9cfeac1 100644 --- a/yaksh/templates/yaksh/error_template.html +++ b/yaksh/templates/yaksh/error_template.html @@ -1,15 +1,18 @@ +{% load static %} {% block css%} - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/dashboard.css' %}" type="text/css" /> +{% endblock %} +{% block script %} + <script src="{% static 'yaksh/js/jquery-ui.js' %}"></script> {% endblock %} {% load custom_filters %} {% if error_message %} {% for error in error_message %} - - <div class="panel panel-danger"> - <div class="panel-heading">Error No. {{ forloop.counter }}</div> - <div class="panel-body"> - <div class="well well-sm"> + <div class="card "> + <div class="card-header alert-danger">Error No. {{ forloop.counter }}</div> + <div class="card-body "> + <div class=""> {% if not error.type %} <pre><code> {{error|safe}} </code></pre> @@ -18,16 +21,16 @@ {% if error.test_case %} <strong> We tried your code with the following test case:</strong> <br/></br> - <pre><code><strong style="color:#d9534f"> + <pre><code><strong class="text-danger"> {{error.test_case}} </strong></code></pre> {% endif %} <p> <b>The following error took place: </b></p> - <table class="table table-bordered" width="100%" id='assertion'> + <table class="table table-borderless border border-danger table-responsive-sm" width="100%" id='assertion'> <col width="30%"> - <tr class = "active"> + <tr class = "bg-light"> <td><b>Exception Name: </b></td> - <td><span style="color: #d9534f">{{error.exception}}</span></td> + <td><span class="text-danger">{{error.exception}}</span></td> </tr> <tr> <td><b>Exception Message: </b></td><td>{{error.message}}</td> @@ -44,16 +47,16 @@ {% elif error.type == 'stdio' %} {% if error.given_input %} - <table class="table table-bordered"> + <table class="table table-borderless table-responsive-sm"> <col width="30%"> - <tr class = "active"> + <tr class = "bg-light"> <td> For given Input value(s):</td> <td>{{error.given_input}}</td> </tr> </table> {% endif %} - <table class="table table-bordered" width="100%" id="stdio"> + <table class="table table-borderless table-responsive-sm" width="100%" id="stdio"> <col width="10%"> <col width="40%"> <col width="40%"> @@ -66,19 +69,19 @@ </tr> {% for expected,user in error.expected_output|zip:error.user_output %} <td> {{forloop.counter}} </td> - <td>{{expected|default:""}} </td> - <td>{{user|default:""}}</td> + <td>{{expected|default:""|highlight_spaces|safe}} </td> + <td>{{user|default:""|highlight_spaces|safe}}</td> {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} - <td><span class ="glyphicon glyphicon-remove text-warning"/></td> + <td><span class ="fa fa-times text-warning"/></td> {% else %} - <td><span class ="glyphicon glyphicon-ok text-success"/></td> + <td><span class ="fa fa-check text-success"/></td> {% endif %} </tr> {% endfor %} </table> - <table width="100%" class='table table-bordered'> + <table width="100%" class="table table-borderless table-responsive-sm"> <col width="10"> - <tr class = "danger"> + <tr class = "bg-light"> <td><b>Error:</b></td> <td>{{error.error_msg}}</td> </tr> @@ -87,5 +90,7 @@ </div> </div> </div> - {% endfor %} + <br> + </div> + {% endfor %} {% endif %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 8430e91..7206525 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -1,15 +1,15 @@ {% extends "manage.html" %} {% load custom_filters %} +{% load static %} {% block title %} Grade User {% endblock %} {% block pagetitle %} Grade User {% endblock pagetitle %} -{% block content %} - {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.tablesorter.min.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script> +<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"> +</script> +<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML"></script> <script type="text/javascript"> $(document).ready(function() { @@ -19,347 +19,486 @@ $(document).ready(function() </script> {% endblock script %} -{% if course_details %} - <table id="course-details" class="table table-bordered"> - <tr> - <th>Courses</th> - <th> Quizzes </th> - </tr> - - {% for course in course_details %} - <tr> - <td><ul class="list-group">{{course.name}} </td> - - {% 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}}/{{course.id}}/"> - {{quiz.description}} - </a></li> - {% endfor %} - </td> - {% else %} - <td> No quiz</td> - {% endif %} - </ul></tr> - {% endfor %} - </table> -{% endif %} - -<div class="row"> -{% if not course_details %} -{% 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}}/{{course_id}}/"> - {{user.user__first_name}} {{user.user__last_name}}</a></p> - {% endfor %} +{% block content %} +<div class="container"> +{% if objects %} + {% include "yaksh/paginator.html" %} + <div id="accordion"> + {% for course in objects %} + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col-md-9"> + <h5 data-toggle="tooltip" title="{{course.name}}"> + {{ course.name }} + </h5> + </div> + <div class="col-md"> + <a class="card-link btn btn-info" data-toggle="collapse" href="#collapse{{course.id}}"> + Details + <i class="fa fa-toggle-down" id="toggle_course_{{course.id}}"></i> + </a> + </div> + </div> + </div> + <div id="collapse{{course.id}}" class="collapse hide" data-parent="#accordion"> + <div class="card-body"> + {% with course.get_quizzes as quizzes %} + {% if quizzes %} + <ul class="list-group"> + {% for quiz in quizzes %} + <li class="list-group-item"> + <div class="row"> + <div class="col-md-8"> + {{quiz.description}} + </div> + <div class="col-md-2"> + <a href="{% url 'yaksh:grade_user' quiz.id course.id%}" class="btn btn-primary"> + Grade + </a> + </div> + </div> + </li> + {% endfor %} + </ul> + {% else %} + <center> + <p class="badge badge-danger badge-pill"> + No Quizzes + </p> + </center> + {% endif %} + {% endwith %} + </div> + </div> + </div> + <br> + {% endfor %} </div> -{% else %} -<h4>No Users Found for {{ quiz.description }}</h4> -{% endif %} -{% endif %} - -{% if has_quiz_assignments %} - -<a href="{{URL_ROOT}}/exam/manage/download/quiz_assignments/{{quiz_id}}/"> - Download All Assignments</a> -{% endif %} - -<div id = "paper" class="col-md-10"> -{% if data %} - - -<p> <h3> <center> Showing paper for {{data.user.get_full_name.title}} </center></h3> -<p><b>Name:</b> {{ data.user.get_full_name.title }} -{% if data.profile %} - -<p><b> Roll number:</b> {{ data.profile.roll_number }} -<p><b>Position: </b> {{ data.profile.position }} -<p><b>Department: </b>{{ data.profile.department }} -<p><b>Institute: </b>{{ data.profile.institute }} + {% include "yaksh/paginator.html" %} +{% elif msg == 'grade' and not objects %} + <br> + <div class="alert alert-info"> + <center><h3>No courses found to grade</h3></center> + </div> {% endif %} - -{% if data.papers %} - -{% for paper in data.papers %} -<hr> -{{ paper.total_marks }} - -<h4> Course: {{ paper.question_paper.quiz.course.name }}</h4> -<h4> Quiz: {{ paper.question_paper.quiz.description }} </h4> - -<p> -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}}/{{course_id}}/"> -{{attempt.attempt_number}} -</option> -{% endfor %} -</select> -<br/>Questions correctly answered: {{ paper.get_answered_str }} <br/> -Total attempts at questions: {{ paper.answers.count }} <br/> -Marks obtained: {{ paper.marks_obtained }} <br/> -Start time: {{ paper.start_time }} <br/> -End time: {{ paper.end_time }} <br/> -{%if paper.percent%} -Percentage obtained: {{paper.percent}}% <br/> -{% endif %} -{% if paper.passed %} -Status : <b style="color: green;"> Passed </b><br/> -{% else %} -Status : <b style="color: red;"> Failed </b><br/> -{% endif %} -</p> -{% if paper.answers.count %} - -<h4> Report </h4><br> -<table class="tablesorter table table-striped table-bordered" id ='marks_table'> - <thead> - <tr> - <th>Question Id</th> - <th>Questions</th> - <th>Marks Obtained</th> - </tr> - </thead> - <tbody> - {% for question, answers in paper.get_question_answers.items %} - {% with answers|last as answer %} - <tr> - <td>{{question.id}}</td> - <td><a href="#question_{{question.id}}">{{ question.summary }}</a></td> - <td>{{ answer.answer.marks }}</td> - </tr> - {% endwith %} - {% endfor %} - </tbody> -</table> - - -<h3> Answers </h3><br> -<form name=frm id="q{{ paper.quiz.id }}_form" - action="{{URL_ROOT}}/exam/manage/gradeuser/{{quiz_id}}/{{user_id}}/{{paper.attempt_number}}/{{course_id}}/" - method="post"> -{% csrf_token %} - -{% for question, answers in paper.get_question_answers.items %} -<div class = "well well-sm"> -<div class="panel panel-info"> - <div class="panel-heading" id="question_{{question.id}}"> - <strong> Details: {{forloop.counter}}. {{ question.summary }} - <span class="marks pull-right"> Mark(s): {{ question.points }} </span> - </strong> - </div> - <div class="panel-body"> - <h5><u>Question:</u></h5> <strong>{{ question.description|safe }}</strong> - {% if question.type == "mcq" or question.type == "mcc" %} - <h5> <u>Choices:</u></h5> - {% for testcase in question.get_test_cases %} - {% if testcase.correct %} - <br/> - <strong>{{ forloop.counter }}. {{ testcase.options|safe }}</strong> - <span class="label label-success"> Correct </span> - {% else %} - <br/><strong> - {{ forloop.counter }}. {{ testcase.options|safe }}</strong> - {% endif %} - {% endfor %} - - {% elif question.type == "integer" or question.type == "string" or question.type == "float" %} - <h5> <u>Correct Answer:</u></h5> - {% for testcase in question.get_test_cases %} - <strong>{{ testcase.correct|safe }}</strong> - {% if testcase.error_margin %} - <strong>{{ testcase.error_margin|safe }}</strong> - {% endif %} - {% endfor %} - {% elif question.type == "arrange" %} - <h5> <u>Correct Order:</u></h5> - <div class="list-group" > - {% for testcase in question.get_test_cases %} - <li class="list-group-item"><strong>{{ testcase.options|safe }}</strong></li> - {% endfor %} - </div> - - {% else %} - <h5> <u>Test cases: </u></h5> - {% for testcase in question.get_test_cases %} - <br/><strong>{{ forloop.counter }}. {{ testcase }}</strong> - {% endfor %} - {%endif%} +</div> +<div class="container-fluid"> + <div class="row"> + {% if status == "grade" %} + {% if users %} + <div id="student" class="col-md-3"> + <ul class="nav nav-pills list-group"> + {% for user in users %} + <li class="nav-item"> + <a href="{% url 'yaksh:grade_user' quiz_id user.user__id course_id %}" class="list-group-item{% if user.user__id == data.user.id %} active {% endif %}"> + {{user.user__first_name}} {{user.user__last_name}} + </a> + </li> + {% endfor %} + </ul> </div> - </div> - <h5>Student answer: </h5> - {% if question.type == "upload" %} - {% if has_user_assignments %} - <a href="{{URL_ROOT}}/exam/manage/download/user_assignment/{{question.id}}/{{data.user.id}}/{{paper.question_paper.quiz.id}}"> - <div class="panel"> - Assignment File for {{ data.user.get_full_name.title }} + {% else %} + <div class="col-md-1"></div> + <div class="col-md-10"> + <div class="alert alert-warning"> + <center> + <h4>No Users Found for {{ quiz.description }}</h4> + </center> + </div> </div> - </a> - {% with answers|last as answer%} - {% if answer.answer.correct %} - <div class="panel panel-success"> - <div class="panel-heading">Correct answer</div></div> - {% else %} - <div class="panel panel-danger"> - <div class="panel-heading">Incorrect Answer</div></div> - {% endif %} - {% endwith %} - {% else %} - <h5>No Assignment submitted by {{ data.user.get_full_name.title }}</h5> + {% endif %} {% endif %} - {% else %} - {% for ans in answers %} - {% if ans.answer.correct %} - <div class="panel panel-success"> - <div class="panel-heading">Correct answer: - {% else %} - <div class="panel panel-danger"> - <div class="panel-heading">Error: - {% endif %} - {% with ans.error_list as err %} - {% for error in err %} - {% if error.type == 'stdio' %} - <div class = "well well-sm"> - {% if error.given_input %} - <table class="table table-bordered"> - <col width="30%"> - <tr class = "active"> - <td> For given Input value(s):</td> - <td>{{error.given_input}}</td> - </tr> - </table> - {% endif %} - <table class="table table-bordered" width="100%" id="output" style="table-layout: fixed"> - <col width="10%"> - <col width="40%"> - <col width="40%"> - <col width="10%"> - <tr> - <th><center>Line No.</center></th> - <th><center>Expected Output</center></th> - <th><center>User output</center></th> - <th><center>Status</center></th> - </tr> - {% for expected,user in error.expected_output|zip:error.user_output %} - <td> {{forloop.counter}} </td> - <td>{{expected|default:""}} </td> - <td>{{user|default:""}}</td> - {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} - <td><span class ="glyphicon glyphicon-remove text-warning"/></td> - {% else %} - <td><span class ="glyphicon glyphicon-ok text-success"/></td> - {% endif %} - </tr> - {% endfor %} - </table> - <table width="100%" class='table table-bordered'> - <col width="10"> - <tr> - <td><b>Error:</b></td> - <td>{{error.error_msg}}</td> - </tr> - </table> - </div> - {% elif error.type == 'assertion' %} - {% if error.test_case %} - <strong> We tried you code with the following test case:</strong><br/></br> - <pre><code><strong style="color:#d9534f">{{error.test_case}}</strong></code></pre> - {% endif %} - <p> <b>The following error took place: </b></p> - <div class="well well-sm"> - <table class="table table-bordered" width="100%" style="table-layout: fixed"> - <col width="30%"> - <tr class = "active"> - <td><b>Exception Name: </b></td> - <td><span style="color: #d9534f">{{error.exception}}</span></td> - </tr> - <tr> - <td><b>Exception Message: </b></td><td>{{error.message}}</td> - </tr> - <tr> - {% if error.traceback %} - <td><b>Full Traceback: </b></td> - <td><pre>{{error.traceback}}</pre></td> - {% endif %} - </tr> - </table> - </div> <!-- Closes well --> - {% else %} - <pre><code> {{error|safe}} </code></pre> - {% endif %} - {% endfor %} - {% endwith %} - </div> - - <div class="panel-body"> - {% if question.type == "code" %} - <pre><code>{{ ans.answer.answer.strip|safe }}</code></pre> - {% elif question.type == "mcc"%} - <div class="well well-sm"> - {% for testcases in question.get_test_cases %} - {%if testcases.id|stringformat:"i" in ans.answer.answer.strip|safe %} - <li>{{ testcases.options.strip|safe }}</li> - {% endif %} - {% endfor %} - </div> - {% elif question.type == "mcq"%} - <div class="well well-sm"> - {% for testcases in question.get_test_cases %} - {%if testcases.id|stringformat:"i" == ans.answer.answer.strip|safe %} - <li>{{ testcases.options.strip|safe }}</li> - {% endif %} - {% endfor %} + <div id="paper" class="col-md-9"> + {% if has_quiz_assignments %} + <a href="{% url 'yaksh:download_quiz_assignment' quiz_id course_id %}" class="btn btn-outline-info"> + <i class="fa fa-download"></i> Download All Assignments + </a> + <br><br> + {% endif %} + + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> </div> - - {% elif question.type == "arrange"%} - <div class="well well-sm"> - {% get_answer_for_arrange_options ans.answer.answer question as tc_list %} - {% for testcases in tc_list %} - <li>{{ testcases.options.strip|safe }}</li> {% endfor %} + {% endif %} + + {% if data %} + <div class="card"> + <div class="card-header"> + Student Details + </div> + <div class="card-body"> + <p><b>Name:</b> {{ data.user.get_full_name.title }}</p> + {% with data.profile as profile %} + {% if profile %} + <div class="row"> + <div class="col-md-4"> + <p><b> Roll number:</b> {{ profile.roll_number }}</p> + <p><b>Position: </b> {{ profile.position }}</p> + </div> + <div class="col-md-7"> + <p><b>Department: </b>{{ profile.department }}</p> + <p><b>Institute: </b>{{ profile.institute }}</p> + </div> + </div> + {% endif %} + {% endwith %} + </div> </div> - - {% else %} - <div class="well well-sm"> - {{ ans.answer.answer.strip|safe }} - </div> - {% endif %} - </div> - </div> - {% endfor %} - {% endif %} - {% with answers|last as answer %} - Marks: <input id="q{{ question.id }}" type="text" - name="q{{ question.id }}_marks" size="4" - value="{{ answer.answer.marks }}"><br><br> - {% endwith %} - <hr/> - </div> - {% endfor %} {# for question, answers ... #} -<div class="form-group"> -<h3>Teacher comments: </h3> -<textarea id="comments_{{paper.question_paper.id}}" class="form-control" - name="comments_{{ paper.question_paper.id }}">{{ paper.comments }}</textarea> -</div> -<br><button class="btn btn-primary" type="submit" name="submit_{{paper.quiz.id}}">Save Marks</button> - -</form> -</div> - -{% endif %} {# if paper.answers.count #} - - -{% endfor %} {# for paper in data.papers #} - -{% endif %} {# if data.papers #} -{% else %} + <hr> + {% if data.papers %} + {% with data.papers.0 as paper %} + <div class="card"> + <div class="card-header"> + Course Details + </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + <p><b>Course:</b> {{ paper.course.name }}</p> + <p><b>Quiz:</b> {{ paper.question_paper.quiz.description }}</p> + </div> + <div class="col-md-6"> + <p><b>Start time:</b> {{ paper.start_time }}</p> + <p><b>End time:</b> {{ paper.end_time }}</p> + </div> + </div> + </div> + </div> + {% endwith %} + {% for paper in data.papers %} + <hr> + <div class="card"> + <div class="card-header"> + Scorecard + </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-4"> + <p><b>Status:</b> + {% if paper.passed %} + <span class="badge badge-pill badge-success"> Passed </span> + {% else %} + <span class="badge badge-pill badge-danger"> Failed </span> + {% endif %} + </p> + <p><b>Total Marks:</b> {{ paper.question_paper.total_marks }}</p> + <p><b>Marks obtained:</b> {{ paper.marks_obtained }}</p> + </div> + <div class="col-md-4"> + {% if paper.percent %} + <p><b>Percentage obtained:</b> {{paper.percent}}%</p> + {% endif %} + <p><b>Total attempts at questions:</b> {{ paper.answers.count }}</p> + <p> + <b>Attempt Number:</b> + <span class="badge badge-pill badge-info"> + {{paper.attempt_number}} + </span> + <select id="attempt" onchange="window.location.href=this.value" class="custom-select"> + <option selected="">Select attempt number</option> + {% for attempt in attempts %} + <option value="{% url 'yaksh:grade_user' quiz_id user_id attempt.attempt_number course_id %}"> + {{attempt.attempt_number}} + </option> + {% endfor %} + </select> + </p> + </div> + </div> + </div> + </div> + <hr> + {% if paper.answers.count %} + <div class="card"> + <div class="card-header"> + Submission Details + </div> + <div class="card-body"> + <table class="tablesorter table table-striped table-bordered table-responsive-sm" id='marks_table'> + <thead> + <tr> + <th>Questions</th> + <th>Type</th> + <th>Marks Obtained</th> + </tr> + </thead> + <tbody> + {% for question, answers in paper.get_question_answers.items %} + {% with answers|last as answer %} + <tr> + <td> + <a href="#question_{{question.id}}"> + {{ question.summary }} + </a> + </td> + <td>{{ question.type }}</td> + <td>{{ answer.answer.marks }}</td> + </tr> + {% endwith %} + {% endfor %} + </tbody> + </table> + <form name=frm id="q{{ paper.quiz.id }}_form" + action="{% url 'yaksh:grade_user' quiz_id user_id paper.attempt_number course_id %}" + method="post"> + {% csrf_token %} + {% for question, answers in paper.get_question_answers.items %} + <div class="card" id="question_{{question.id}}"> + <div class="card-header text-white bg-info"> + <strong> + Details: {{forloop.counter}}. {{ question.summary }} + <span class="marks pull-right"> Mark(s): {{ question.points }} </span> + </strong> + </div> + <div class="card-body"> + <h5> + <span class="badge badge-pill badge-primary">Question:</span> + </h5> + <strong>{{ question.description|safe }}</strong> + <br><br> + {% if question.type == "mcq" or question.type == "mcc" %} + <h5> + <span class="badge badge-pill badge-primary">Choices:</span> + </h5> + {% for testcase in question.get_test_cases %} + {% if testcase.correct %} + <strong> + <span class="badge badge-pill badge-success"> + {{ forloop.counter }}. + </span> + {{ testcase.options|safe }} + </strong> + {% else %} + <strong> + <span class="badge badge-pill badge-secondary"> + {{ forloop.counter }}. + </span> + {{ testcase.options|safe }} + </strong> + {% endif %} + <br> + {% endfor %} + {% elif question.type == "integer" or question.type == "string" or question.type == "float" %} + <h5> + <span class="badge badge-pill badge-primary"> + Correct Answer: + </span> + </h5> + {% for testcase in question.get_test_cases %} + <strong>{{ testcase.correct }}</strong> + {% if testcase.error_margin %} + <strong>{{ testcase.error_margin }}</strong> + {% endif %} + {% endfor %} + {% elif question.type == "arrange" %} + <h5> + <span class="badge badge-pill badge-primary"> + Correct Order:</span> + </h5> + <div class="list-group" > + {% for testcase in question.get_test_cases %} + <li class="list-group-item"> + <strong>{{ testcase.options }}</strong> + </li> + {% endfor %} + </div> + {% else %} + <h5> + <span class="badge badge-pill badge-primary">Test cases: + </span> + </h5> + {% for testcase in question.get_test_cases %} + <strong> + {{ forloop.counter }}. {{ testcase }} + </strong> + <br> + {% endfor %} + {% endif %} + <br> + <h5> + <span class="badge badge-pill badge-primary">Student answer(s): + </span> + </h5> + {% if question.type == "upload" %} + {% if has_user_assignments %} + <a href="{% url 'yaksh:download_user_assignment' question.id data.user.id paper.question_paper.quiz.id course_id %}"> + <div class="btn btn-outline-info text-center"> + Assignment File for {{ data.user.get_full_name.title }} + </div> + </a> + {% else %} + <center> + <div class="alert alert-warning"> + <h5> + Assignment not submitted by {{ data.user.get_full_name.title }} + </h5> + </div> + </center> + {% endif %} <!-- End has_user_assignments --> + {% else %} + {% for ans in answers %} + <strong> + Attempt Number: {{forloop.counter}} + </strong> + <div id="accordian"> + <div class="card"> + {% if ans.answer.correct %} + <div class="card-header"> + <span class="badge badge-success"> + Correct answer: + </span> + <a class="card-link" data-toggle="collapse" href="#submitted_{{ans.answer.id}}"> + <span class="pull-right"> + Details <i class="fa fa-toggle-down"></i> + </span> + </a> + </div> + {% else %} + <div class="card-header"> + <span class="badge badge-danger"> + Error: + </span> + <a class="card-link" data-toggle="collapse" href="#submitted_{{ans.answer.id}}"> + <span class="pull-right"> + Details <i class="fa fa-toggle-down"></i> + </span> + </a> + </div> + {% endif %} + <div class="collapse hide" id="submitted_{{ans.answer.id}}" data-parent="#accordion"> + <div class="card-body"> + {% with ans.error_list as err %} + {% for error in err %} + {% if error.type == 'stdio' %} + {% if error.given_input %} + <table class="table table-bordered table-responsive-sm"> + <tr class="table-active"> + <td> For given Input value(s):</td> + <td>{{error.given_input}}</td> + </tr> + </table> + {% endif %} + <table id="course-detail" class="table table-bordered table-responsive-sm" width="100%" id="output"> + <tr> + <th><center>Line No.</center></th> + <th><center>Expected Output</center></th> + <th><center>User output</center></th> + <th><center>Status</center></th> + </tr> + {% for expected,user in error.expected_output|zip:error.user_output %} + <td> {{forloop.counter}} </td> + <td>{{expected|default:""}} </td> + <td>{{user|default:""}}</td> + {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} + <td><span class ="fa fa-times text-warning"/></td> + {% else %} + <td><span class ="fa fa-check text-success"/></td> + {% endif %} + </tr> + {% endfor %} + </table> + <table width="100%" class="table table-bordered table-responsive-sm"> + <col width="10"> + <tr> + <td>Error:</td> + <td>{{error.error_msg}}</td> + </tr> + </table> + {% elif error.type == 'assertion' %} + {% if error.test_case %} + <strong> + We tried you code with the following test case: + </strong><br><br> + <pre><code> + <strong>{{error.test_case}}</strong> + </code></pre> + {% endif %} + <p><b>The following error took place: </b></p> + <table id="course-detail" class="table table-bordered table-responsive-sm" width="100%"> + <tr class = "active"> + <td><b>Exception Name: </b></td> + <td><span>{{error.exception}}</span></td> + </tr> + <tr> + <td><b>Exception Message: </b></td><td>{{error.message}}</td> + </tr> + <tr> + {% if error.traceback %} + <td><b>Full Traceback: </b></td> + <td><pre>{{error.traceback}}</pre></td> + {% endif %} + </tr> + </table> + {% else %} + <pre><code> {{error}} </code></pre> + {% endif %} + {% endfor %} + {% endwith %} + {% if question.type == "code" %} + {% pygmentise_user_answer question.language ans.answer.answer.strip as user_answer %} + <style type="text/css">{{user_answer.1}}</style> + <pre><code>{{user_answer.0|safe}}</code></pre> + {% elif question.type == "mcc" or question.type == "mcq" %} + {% for testcases in question.get_test_cases %} + {% if testcases.id|stringformat:"i" in ans.answer.answer.strip %} + <li>{{ testcases.options.strip|safe }}</li> + {% endif %} + {% endfor %} + {% elif question.type == "arrange"%} + {% get_answer_for_arrange_options ans.answer.answer question as tc_list %} + {% for testcases in tc_list %} + <li>{{ testcases.options.strip }}</li> + {% endfor %} + {% else %} + {{ ans.answer.answer.strip }} + {% endif %} + </div> + </div> + </div> + </div> + <br> + {% endfor %} <!-- End for ans in answers --> + </div> + </div> + {% endif %} + <br> + <div class="form-group"> + <div class="col-md-2"> + <label class="col-form-label" for="q{{ question.id }}">Marks:</label> + {% with answers|last as answer %} + <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answer.answer.marks }}"><br><br> + {% endwith %} + </div> + </div> + <hr/> + {% endfor %} {# for question, answers ... #} + <div class="form-group"> + <h3>Teacher comments: </h3> + <textarea id="comments_{{paper.question_paper.id}}" class="form-control" + name="comments_{{ paper.question_paper.id }}">{{ paper.comments }}</textarea> + <br> + <button class="btn btn-success btn-lg" type="submit" name="submit_{{paper.quiz.id}}"> + <i class="fa fa-save"></i> Save + </button> + </div> + </form> + </div> + </div> + {% endif %} {# if paper.answers.count #} + {% endfor %} {# for paper in data.papers #} + {% endif %} {# if data.papers #} + {% else %} + <!-- No Data --> + {% endif %} {#if data#} </div> -{% endif %} {#if data#} - + </div> </div> {% endblock%} diff --git a/yaksh/templates/yaksh/index.html b/yaksh/templates/yaksh/index.html deleted file mode 100644 index a90cf4c..0000000 --- a/yaksh/templates/yaksh/index.html +++ /dev/null @@ -1,59 +0,0 @@ -{% load custom_filters %} -<html> -<link rel="stylesheet" href="static/css/bootstrap.css"> -<link rel="stylesheet" href="static/css/bootstrap.min.css"> -<link rel="stylesheet" href="static/css/offline.css"> -<script src="static/js/jquery-1.9.1.min.js"></script> -<script src="static/js/bootstrap.min.js"></script> -{% block pagetitle %} {{course.name}} {% endblock %} -<nav class="navbar navbar-inverse navbar-fixed-top"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" href="#"> - <img src="static/images/yaksh_banner.png" alt="YAKSH"> - </img> - </a> - </div> - </div> -</nav> -<div class="container" style="margin-top:50px"> - <h1> - <center> - {% block subtitle %} - {{course.name}} - {% endblock %} - </center> - </h1> - {% block content %} - <table class="table"> - {% for module in modules %} - <tr> - <td> - {{module.name}} - <div id="{{module.id}}" class="collapse"> - <ul class="list"> - {% for lesson in module.get_lesson_units %} - <li>{{lesson.name}}</li> - {% endfor %} - </ul> - </div> - </td> - <td> - <button class="btn btn-info" data-toggle="collapse" data-target="#{{module.id}}"> - View Lessons - </button> - </td> - <td> - <a href="{{module.name|replace_spaces}}/{{module.name|replace_spaces}}.html" target="_blank" class="btn btn-primary">Go to Module</a> - </td> - </tr> - {% endfor %} - </table> - {% endblock %} -</div> -<footer class="footer" id="footer_div"> - <div class="container"> - <p align="center">Developed by FOSSEE group, IIT Bombay</p> - </div> -</footer> -</html>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/intro.html b/yaksh/templates/yaksh/intro.html index 6bd2fab..7657a65 100644 --- a/yaksh/templates/yaksh/intro.html +++ b/yaksh/templates/yaksh/intro.html @@ -1,55 +1,54 @@ {% extends "base.html" %} -{% block pagetitle %} OnlineTest Instructions and Rules -<h3> Important instructions & rules </h3> -{% endblock pagetitle %} -{% block content %} +{% block title %} {{questionpaper.quiz.description}} {% endblock %} +{% block pagetitle %} Quiz Instructions and Rules {% endblock pagetitle %} - {% if questionpaper.quiz.is_expired %} - <div class="alert alert-error"> - This Quiz has expired. You can no longer attempt this Quiz. - <br/> - </div> - {% else %} - <div class="alert"> - {% load tz %} - {% get_current_timezone as TIME_ZONE %} - You can attempt this Quiz at any time between {{ questionpaper.quiz.start_date_time }} {{ TIME_ZONE }} and {{ questionpaper.quiz.end_date_time }} {{ TIME_ZONE }} - <br/> - You are not allowed to attempt the Quiz before or after this duration - <br/> - </div> - {% endif %} - <p> Welcome <strong>{{user.get_full_name|title}}</strong>, to the programming quiz! </p> - {{ questionpaper.quiz.instructions|safe }} - <div class="row"> - <div class="col-md-6"> - <center> - {% 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 }}/{{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> - {% endif %} - </div> +{% block content %} +<div class="container"> + <div class="card"> + <div class="card-header"> + {{questionpaper.quiz.description}} + </div> + <div class="card-body"> + {% if questionpaper.quiz.is_expired %} + <div class="alert alert-error"> + This Quiz has expired. You can no longer attempt this Quiz. + </div> + {% else %} + <div class="alert alert-info"> + You can attempt this Quiz at any time between <b>{{ questionpaper.quiz.start_date_time }}</b> and <b>{{ questionpaper.quiz.end_date_time }}</b> + </div> + {% endif %} + <p> Welcome <strong>{{user.get_full_name|title}}</strong>, to the programming quiz! </p> + {{ questionpaper.quiz.instructions|safe }} + <div class="row"> + <div class="col-md-6"> + <center> + {% if status != "moderator" %} + <a href="{% url 'yaksh:view_module' module.id course.id %}" class="btn btn-primary btn-lg" name="home"> + <i class="fa fa-step-backward"></i> + Go Back + </a> + {% else %} + <a href="{% url 'yaksh:index' %}" class="btn btn-primary btn-lg" name="home"> + <i class="fa fa-step-backward"></i> + Go Back + </a> + {% endif %} + </center> + </div> + <div class="col-md-6"> + {% if not questionpaper.quiz.is_expired %} + <form action="{% url 'yaksh:start_quiz' attempt_num module.id questionpaper.id course.id %}" method="post" align="center"> + {% csrf_token %} + <button class="btn btn-success btn-lg" type="submit" name="start"> + Start <i class="fa fa-play"></i> + </button> + </form> + {% endif %} </div> + </div> + </div> + </div> +</div> {% endblock content %} -{% if user %} - {% block info %} - <h5>{{user.get_full_name|title}}({{user.profile.roll_number}}) Logged in as {{user.username}}</h5> - {% endblock %} -{% endif %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/lessons.html b/yaksh/templates/yaksh/lessons.html new file mode 100644 index 0000000..e5af061 --- /dev/null +++ b/yaksh/templates/yaksh/lessons.html @@ -0,0 +1,112 @@ +{% extends "manage.html" %} +{% load static %} +{% block title %} My Lessons {% endblock %} +{% block content %} +<div class="container"> + <div class="row"> + <div class="col-md-8"> + <ul class="nav nav-pills" id="course_tabs"> + <li class="nav-item"> + <a class="nav-link {% if created %}active{% endif %}" href="{% url 'yaksh:courses' %}"> + My Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add/Edit Course + </a> + </li> + <li class="nav-item dropdown hide"> + <a class="nav-link dropdown-toggle active" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">More</a> + <div class="dropdown-menu hide" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 37px, 0px); top: 0px; left: 0px; will-change: transform;"> + <a class="dropdown-item" href="{% url 'yaksh:show_all_quizzes' %}"> + Add/View Quizzes + </a> + <a class="dropdown-item active" href="{% url 'yaksh:show_all_lessons' %}"> + Add/View Lessons + </a> + <a class="dropdown-item" href="{% url 'yaksh:show_all_modules' %}"> + Add/View Modules + </a> + <a href="{% url 'grades:grading_systems'%}" class="dropdown-item" > + Add/View Grading Systems + </a> + </div> + </li> + </ul> + </div> + </div> +</div> +<div class="container"> + <hr> + <a href="{% url 'yaksh:edit_lesson' %}" class="btn btn-primary btn-lg"> + <i class="fa fa-plus-circle"></i> Add new Lesson + </a> + {% if not lessons %} + <br><br> + <div class="alert alert-info"> + <center><h3> No lessons found</h3></center> + </div> + {% else %} + <hr> + <form name=frm action="" method="post"> + {% csrf_token %} + <div class="card"> + <div class="card-header"> + <h3> Search/Filter Lessons </h3> + </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + {{ form.search_tags }} + </div> + <div class="col-md-3"> + {{ form.search_status }} + </div> + </div> + <br> + <button class="btn btn-success" type="submit">Search</button> + <a class="btn btn-primary" href="{% url 'yaksh:show_all_lessons' %}"> + Clear Search + </a> + </div> + </div> + </form> + <hr> + <center><h4 class="badge badge-success">{{ lessons_found }} Lesson(s) Available</h4></center> + + <table id="course-details" class="table table-bordered table-responsive-sm"> + <tr> + <th>Sr.No</th> + <th>Lesson</th> + </tr> + + {% for lesson in lessons %} + <tr> + <td width="2%">{{forloop.counter}}</td> + <td width="30%"> + <div class="row"> + <div class="col-md-8"> + <a href="{% url 'yaksh:edit_lesson' lesson.id %}"> + {{ lesson.name }} + </a> + </div> + <div class="col-md-4"> + {% if lesson.active %} + <span class="badge badge-success badge-pill"> + Active + </span> + {% else %} + <span class="badge badge-danger badge-pill"> + Closed + </span> + {% endif %} + </div> + </div> + </td> + {% endfor %} <!-- end for lessons --> + </tr> + </table> + {% endif %} +</div> +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/login.html b/yaksh/templates/yaksh/login.html index 9c377b9..63a2ef2 100644 --- a/yaksh/templates/yaksh/login.html +++ b/yaksh/templates/yaksh/login.html @@ -1,52 +1,82 @@ {% extends "base.html" %} +{% load static %} -{% block pagetitle %}<img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_text.png" width="100" alt="YAKSH"> -</img>{% endblock %} +{% block title %} Login {% endblock %} + +{% block nav %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} {% block content %} - <div class="row"> - <div class="col-md-6" style="border-right:1px solid gray;"> - <form action="" method="post"> - {% csrf_token %} - - <center><table class="table"> - {{ form.as_table }} - </table></center> - <button class="btn btn-primary" type="submit">Login</button> - <a class="btn btn-primary" href="{{URL_ROOT}}/exam/reset/forgotpassword/">Forgot Password?</a> - <a class="btn btn-primary" href="{{URL_ROOT}}/exam/register/">New User? Sign-Up </a> - <h3> Login with </h3> - <a class="btn btn-social-icon btn-google" href="{% url 'social:begin' 'google-oauth2' %}"> - <span class="fa fa-google" style="font-size:32px;color:red" ></span> - </a> - <a class="btn btn-social-icon btn-facebook" href="{% url 'social:begin' 'facebook' %}"> - <span class="fa fa-facebook-square" style="font-size:32px"></span> - </a> - </form> - </div> - <div class="col-md-6"> - <p> Online Test Interface for conducting online programming quiz. - <ul> - <li>Define fairly complicated programming problems and have users - solve the problem. </li> - <li>Immediate verification of code solution. </li> - <li>Supports pretty much arbitrary programming questions in Python, C, C++ and - simple Bash and uses "test cases" to test the implementations of the students.</li> - <li>Supports simple multiple choice questions and File uploads.</li> - <li>Since it runs on your Python, you could technically test any Python based library.</li> - <li>Scales to over 500+ simultaneous users.</li> - </ul> - </p> - <br/> - <p><b>Fork us at:</b> - <a class = "btn btn-social-icon btn-github" - href ="https://github.com/fossee/online_test" - style="color:black"> - - <span class="fa fa-github" style="font-size:48px"></span> - </p> - </a> +<div class="container"> + <div class="row justify-content-center"> + <div class="col-md-6 col-md-offset-6"> + <div class="card border-primary"> + <div class="card-header"> + <h3>Log in to Your Account</h3> + </div> + <div class="card-body"> + <div class="form-group"> + <form action="" method="post"> + {% csrf_token %} + + <center> + <table class="table table-borderless"> + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + {{form.username}} + <br> + {{form.password}} + </table> + </center> + <div class="row justify-content-center"> + <button class="btn btn-lg btn-success btn-block" type="submit" id="login-btn"> + <i class="fa fa-sign-in"></i> Login + </button> + <a href="{% url 'yaksh:register' %}" class="btn btn-lg btn-primary btn-block" id="signup-btn"> + <i class="fa fa-user-plus"></i> NEW USER? SIGN UP + </a> + <a class="btn btn-lg btn-primary btn-block" href="{% url 'password_reset' %}" id="forgot-btn"> + Forgot Password? + </a> + </div> + <hr> + <center><h1> OR </h1></center> + Login with + <a class="btn btn-social-icon btn-google" href="{% url 'social:begin' 'google-oauth2' %}"> + <span class="fa fa-google" style="font-size:32px;color:red" ></span> + </a> + <a class="btn btn-social-icon btn-facebook" href="{% url 'social:begin' 'facebook' %}"> + <span class="fa fa-facebook-square" style="font-size:32px"></span> + </a> + </form> + </br> + </div> + </div> + </div> </div> </div> - +</div> {% endblock content %} diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html index c848074..b2d38b0 100644 --- a/yaksh/templates/yaksh/moderator_dashboard.html +++ b/yaksh/templates/yaksh/moderator_dashboard.html @@ -1,107 +1,121 @@ {% extends "manage.html" %} {% load custom_filters %} -{% block pagetitle %} Moderator's Dashboard {% endblock pagetitle %} -{% block script %} -<script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/moderator_dashboard.js"></script> -{% endblock %} +{% block title %} My Dashboard {% endblock %} +{% block pagetitle %} <h2>My Dashboard</h2> {% endblock %} {% block content %} - -<center><h4 class="pull-left">List of quizzes! Click on the given links to have a look at answer papers for a quiz.</h4></center> -<a href="{{URL_ROOT}}/exam/toggle_moderator/" class="btn btn-primary pull-right"> - Switch To Student -</a> -<table class="table table-bordered"> - <th>Courses</th> - <th>Quizzes</th> - {% for course in courses %} - <tr> - <td> - <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}"> - {{ course }} - </a> - </td> - <td> - {% 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"> - Add New Course - </a> - <a href="{{URL_ROOT}}/exam/manage/create_demo_course" class="btn btn-default"> - Create Demo Course - </a> - <a data-toggle="collapse" data-target="#help"> - <span class="glyphicon glyphicon-question-sign"></span> What's This - </a> - <div id="help" class="collapse"> - <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> - <li>Click on the Demo Quiz and Click on User Mode or God Mode to take the quiz.</li> - <li>You can also edit the Demo quiz.</li> - </ul> - </div> - {% if msg %} - <h4>{{ msg }}</h4> +<div class="container"> + <center> + <h4> + List of quizzes! Click on the given links to have a look at answer papers for a quiz + </h4> + </center> + <hr> + <center> + <a href="{% url 'yaksh:add_course' %}" class="btn btn-success btn-lg"> + <span class=" fa fa-plus-circle"></span> Add Course + </a> + <a href="{% url 'yaksh:create_demo_course' %}" class="btn btn-primary btn-lg"> + Create Demo Course + </a> + <br><br> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} + {% endif %} + </center> + {% with objects as courses %} + <br> + {% if not courses %} + <div class="alert alert-info"> + No Courses found. Add a new course or Create demo course + </div> + {% else %} + {% include "yaksh/paginator.html" %} + <br> + <div id="accordion"> + {% for course in courses %} + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col-md-4"> + <h4 data-toggle="tooltip" title="{{course.name}}"> + {{ course.name | truncatechars:40 }} + </h4> + </div> + <div class="col-md-2"> + {% if course.active %} + <span class="badge badge-pill badge-success"> + Active + </span> + {% else %} + <span class="badge badge-pill badge-danger"> + Inactive + </span> + {% endif %} + </div> + <div class="col-md-3"> + <a href="{% url 'yaksh:course_detail' course.id %}" class="btn btn-primary"> + <i class="fa fa-tasks"></i> + Manage Course + </a> + </div> + <div class="col-md"> + <a class="card-link btn btn-info" data-toggle="collapse" href="#collapse{{course.id}}"> + Details + <i class="fa fa-toggle-down" id="toggle_course_{{course.id}}"></i> + </a> + </div> + </div> + </div> + <div id="collapse{{course.id}}" class="collapse hide" data-parent="#accordion"> + <div class="card-body"> + <strong>{{ course.name }}</strong> + {% get_course_details course as course_details %} + {% if course_details %} + <table class="table table-bordered table-responsive-sm"> + <tr> + <th>Quiz</th> + <th>Taken By</th> + <th>No. of users Passed</th> + <th>No. of users Failed</th> + </tr> + {% for quiz, users_no, passed, failed in course_details %} + <tr> + <td> + <a href="{% url 'yaksh: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 %} + <br><br> + <div class="alert alert-info"> + <strong>No Quizzes</strong> + </div> + {% endif %} + </div> + </div> + </div> + <br> + {% endfor %} + </div> + {% include "yaksh/paginator.html" %} + <br> {% endif %} -</center> -{% if trial_paper %} - <br/> - <p><center><strong> You have trial papers </strong><br/></center></p> - <input type="checkbox" class="selectall"/> Select all - <br/> - <div id="trial"> - <table class="table table-bordered"> - <form action="" method="post"> - {% csrf_token %} - {% 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.course.id}}/">{{paper.question_paper.quiz.description}}</a></td> - </tr> - {% endfor %} - </table> - <center><button class="btn" type="submit">Delete Selected</button></center> - </form> - </div> - {% endif %} + {% endwith %} +</div> {% endblock %} -{% if user %} - {% block info %} - <h5>{{user.get_full_name|title}}({{user.profile.roll_number}}) Logged in as {{user.username}}</h5> - {% endblock %} -{% endif %} + diff --git a/yaksh/templates/yaksh/modules.html b/yaksh/templates/yaksh/modules.html new file mode 100644 index 0000000..8da207c --- /dev/null +++ b/yaksh/templates/yaksh/modules.html @@ -0,0 +1,140 @@ +{% extends "manage.html" %} +{% load static %} + +{% block title %} My Modules {% endblock %} +{% block content %} +<div class="container"> + <div class="row"> + <div class="col-md-8"> + <ul class="nav nav-pills" id="course_tabs"> + <li class="nav-item"> + <a class="nav-link {% if created %}active{% endif %}" href="{% url 'yaksh:courses' %}"> + My Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add/Edit Course + </a> + </li> + <li class="nav-item dropdown hide"> + <a class="nav-link dropdown-toggle active" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">More</a> + <div class="dropdown-menu hide" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 37px, 0px); top: 0px; left: 0px; will-change: transform;"> + <a class="dropdown-item" href="{% url 'yaksh:show_all_quizzes' %}"> + Add/View Quizzes + </a> + <a class="dropdown-item" href="{% url 'yaksh:show_all_lessons' %}"> + Add/View Lessons + </a> + <a class="dropdown-item active" href="{% url 'yaksh:show_all_modules' %}"> + Add/View Modules + </a> + <a href="{% url 'grades:grading_systems'%}" class="dropdown-item" > + Add/View Grading Systems + </a> + </div> + </li> + </ul> + </div> + </div> +</div> +<div class="container"> + <hr> + <a href="{% url 'yaksh:add_module' %}" class="btn btn-primary btn-lg"> + <i class="fa fa-plus-circle"></i> Add new Module + </a> + {% if not modules %} + <br><br> + <div class="alert alert-info"> + <center><h3> No learning modules found</h3></center> + </div> + {% else %} + <hr> + <form name=frm action="" method="post"> + {% csrf_token %} + <div class="card"> + <div class="card-header"> + <h3> Search/Filter Learning Modules </h3> + </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + {{ form.search_tags }} + </div> + <div class="col-md-3"> + {{ form.search_status }} + </div> + </div> + <br> + <button class="btn btn-success" type="submit">Search</button> + <a class="btn btn-primary" href="{% url 'yaksh:show_all_modules' %}"> + Clear Search + </a> + </div> + </div> + </form> + <hr> + <center><h4 class="badge badge-success">{{ modules_found }} Learning Module(s) Available</h4></center> + + <table class="table table-bordered table-responsive-sm"> + <tr> + <th>Sr.No</th> + <th>Learning Modules</th> + <th>Design Module</th> + <th>Lessons/Quizzes</th> + </tr> + {% for module in modules %} + <tr> + <td width="2%">{{forloop.counter}}</td> + <td width="30%"> + <div class="row"> + <div class="col-md-7"> + <a href="{% url 'yaksh:edit_module' module.id %}"> + {{ module.name }} + </a> + </div> + <div class="col-md-4"> + {% if module.active %} + <span class="badge badge-success badge-pill"> + Active + </span> + {% else %} + <span class="badge badge-danger badge-pill"> + Closed + </span> + {% endif %} + </div> + </div> + </td> + <td width="40%"> + <a href="{% url 'yaksh:design_module' module.id %}"> + Add Quizzes/Lessons for {{module.name}} + </a> + </td> + <td width="30%"> + {% with module.get_learning_units as units %} + {% if units %} + <ul class="list-group"> + {% for unit in units %} + <li class="list-group-item"> + {% if unit.type == 'quiz' %} + {{unit.quiz.description}} + {% else %} + {{unit.lesson.name}} + {% endif %} + </li> + {% endfor %} <!-- end for learning units --> + </ul> + {% else %} + <span class="badge badge-danger badge-pill"> + No Learning units + </span> + {% endif %} + {% endwith %} + </td> + {% endfor %} <!-- end for modules --> + </tr> + </table> + {% endif %} +</div> +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html index e40293b..cf6888c 100644 --- a/yaksh/templates/yaksh/monitor.html +++ b/yaksh/templates/yaksh/monitor.html @@ -1,14 +1,15 @@ {% extends "manage.html" %} {% load custom_filters %} +{% load static %} {% block title %} Monitor {% endblock %} -{% block pagetitle %} {{ msg }} {% endblock pagetitle %} +{% block pagetitle %} Monitor {% endblock pagetitle %} {% block meta %} <meta http-equiv="refresh" content="30"/> {% endblock meta %} - {% block script %} {% if papers %} -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.tablesorter.min.js"></script> +<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"> +</script> <script type="text/javascript"> $(document).ready(function() { @@ -28,136 +29,211 @@ $(document).ready(function() {% endblock %} {% block content %} - -{# ############################################################### #} -{# This is rendered when we are just viewing exam/monitor #} - -{% if course_details %} - <table id="course-details" class="table table-bordered"> - <tr> - <th>Courses</th> - <th> Quizzes </th> - </tr> - - {% for course in course_details %} - <tr> - <td><ul class="list-group">{{course.name}} </td> - - {% 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}}/{{course.id}}/"> - {{quiz.description}} - </a></li> - {% endfor %} - </td> - {% else %} - <td> No quiz</td> - {% endif %} - </ul></tr> - {% endfor %} - </table> -{% endif %} - -{# ############################################################### #} -{# This is rendered when we are just viewing exam/monitor/quiz_num #} -{% if msg != "Monitor" %} -{% if quiz %} -{% if papers %} -<p>Course Name: {{ course.name }}</p> -<p>Quiz Name: {{ quiz.description }}</p> -<p>Number of papers: {{ papers|length }} </p> -{% completed papers as completed_papers %} - {# template tag used to get the count of completed papers #} - <p>Papers completed: <b> {{ completed_papers }} </b></p> - -{% inprogress papers as inprogress_papers %} - {# 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}}/{{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> - </button></p> -<table id="result-table" class="tablesorter table table table-striped"> - <thead> - <tr> - <th> Name </th> - <th> Username </th> - <th> Roll number </th> - <th> Institute </th> - <th> Questions answered </th> - <th> Marks obtained </th> - <th> Attempts </th> - <th> Time Remaining </th> - <th> Status </th> - </tr> - </thead> - <tbody> - {% for paper in latest_attempts %} - <tr> - <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> - <td> {{ paper.get_answered_str }} </td> - <td> {{ paper.marks_obtained }} </td> - <td> {{ paper.answers.count }} </td> - <td id="time_left{{forloop.counter0}}"> {{ paper.time_left }} </td> - <td>{{ paper.status }}</td> - </div> - </tr> - {% endfor %} - </tbody> -</table> -{% else %} -<p> No answer papers found for {{ quiz.description }}</p> -{% endif %} {# if papers #} -{% else %} -<h4>No Quiz Found</h4> -{% endif %} -{% endif %} - -<!-- CSV Modal --> -<div class="modal fade" id="csvModal" role="dialog"> - <div class="modal-dialog"> - - <!-- Modal content--> - <div class="modal-content"> - <div class="modal-header"> - <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/{{ course.id }}/{{ quiz.id }}/" method="post"> - {% csrf_token %} - <div class="modal-body"> - {% for field in csv_fields %} - <div class="form-check form-check-inline"> - <label class="form-check-label"> - <input class="form-check-input" name="csv_fields" type="checkbox" value="{{ field }}" checked> {{ field }} - </label> - </div> +<div class="container"> + {# ############################################################### #} + {# This is rendered when we are just viewing exam/monitor #} + {% if objects %} + {% include "yaksh/paginator.html" %} + <div id="accordion"> + {% for course in objects %} + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col-md-9"> + <h5 data-toggle="tooltip" title="{{course.name}}"> + {{ course.name }} + </h5> + </div> + <div class="col-md"> + <a class="card-link btn btn-info" data-toggle="collapse" href="#collapse{{course.id}}"> + Details + <i class="fa fa-toggle-down" id="toggle_course_{{course.id}}"></i> + </a> + </div> + </div> + </div> + <div id="collapse{{course.id}}" class="collapse hide" data-parent="#accordion"> + <div class="card-body"> + {% with course.get_quizzes as quizzes %} + {% if quizzes %} + <ul class="list-group"> + {% for quiz in quizzes %} + <li class="list-group-item"> + <div class="row"> + <div class="col-md-8"> + {{quiz.description}} + </div> + <div class="col-md-2"> + <a href="{% url 'yaksh:monitor' quiz.id course.id%}" class="btn btn-primary"> + Monitor + </a> + </div> + </div> + </li> + {% endfor %} + </ul> + {% else %} + <center> + <p class="badge badge-danger badge-pill"> + No Quizzes + </p> + </center> + {% endif %} + {% endwith %} + </div> + </div> + </div> + <br> {% endfor %} - <b>Select Attempt Number: Default latest attempt</b> - <select class="form-control" name = "attempt_number"> - {%for attempt_number in attempt_numbers %} - {% if forloop.last %} - <option value="{{ attempt_number }}" selected>{{ attempt_number }} (Latest)</option> - {% else %} - <option value = "{{ attempt_number }}"> {{ attempt_number }}</option> - {% endif %} - {% endfor %} - </select> - </div> - <div class="modal-footer"> - <button type="submit" class="btn btn-primary"> Download <span class="glyphicon glyphicon-save"></span></button> - <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> - </form> - </div> - </div> -</div> + {% include "yaksh/paginator.html" %} + {% elif msg == 'Monitor' and not objects %} + <br> + <div class="alert alert-info"> + <center><h3>No courses to monitor</h3></center> + </div> + {% endif %} + {# ############################################################### #} + {# This is rendered when we are just viewing exam/monitor/quiz_num #} + {% if msg != "Monitor" %} + {% if quiz %} + {% if papers %} + <div class="card"> + <div class="table-responsive"> + <table id="course-detail" class="table"> + <tr> + <td><b>Course Name: </b></td> + <td>{{course.name}}</td> + </tr> + <tr> + <td><b>Quiz Name: </b></td> + <td>{{quiz.description}}</td> + </tr> + <tr> + <td><b>Number of papers:  </b></td> + <td>{{papers|length}}</td> + </tr> + <tr> + <td><b>Papers Completed:  </b></td> + <td> + {% completed papers as completed_papers %} + <b>{{completed_papers}}</b> + </td> + </tr> + <tr> + <td><b>Papers in progress:  </b></td> + <td> + {% inprogress papers as inprogress_papers %} + <b>{{ inprogress_papers }}</b> + </td> + </tr> + </table> + </div> + </div> + <br> + <div class="row"> + <div class="col-md-4"> + <a href="{% url 'yaksh:show_statistics' papers.0.question_paper.id course.id %}" class="btn btn-primary"> + <i class="fa fa-line-chart"></i> Question Statistics + </a> + </div> + <div class="col-md-4"> + <button type="button" class="btn btn-info" data-toggle="modal" data-target="#csvModal"> + <i class="fa fa-download"></i> Download CSV + </button> + </div> + </div> + <br> + <table id="result-table" class="tablesorter table table-striped table-responsive-sm"> + <thead> + <tr> + <th> Name <i class="fa fa-sort"></i> </th> + <th> Username <i class="fa fa-sort"></i> </th> + <th> Roll No <i class="fa fa-sort"></i> </th> + <th> Institute <i class="fa fa-sort"></i> </th> + <th> Marks <i class="fa fa-sort"></i> </th> + <th> Attempts <i class="fa fa-sort"></i> </th> + <th> Time <i class="fa fa-sort"></i> </th> + <th> Status <i class="fa fa-sort"></i> </th> + </tr> + </thead> + <tbody> + {% for paper in latest_attempts %} + <tr> + <td> <a href="{% url 'yaksh: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> + <td> {{ paper.marks_obtained }} </td> + <td> {{ paper.answers.count }} </td> + <td id="time_left{{forloop.counter0}}"> {{ paper.time_left }} </td> + <td>{{ paper.status }}</td> + </tr> + {% endfor %} + </tbody> + </table> + <!-- CSV Modal --> + <div class="modal fade" id="csvModal" role="dialog"> + <div class="modal-dialog"> + <!-- Modal content--> + <div class="modal-content"> + <div class="modal-header"> + <h3 class="modal-title">Download CSV for {{quiz.description}} </h3> + <button type="button" class="close" data-dismiss="modal"> + <i class="fa fa-close"></i> + </button> + </div> + <form action="{% url 'yaksh:download_quiz_csv' course.id quiz.id %}" method="post"> + {% csrf_token %} + <div class="modal-body"> + <b>Uncheck unwanted columns</b> + <br> + {% for field in csv_fields %} + <div class="form-check form-check-inline"> + <label class="form-check-label"> + <input class="form-check-input" name="csv_fields" type="checkbox" value="{{ field }}" checked> {{ field }} + </label> + </div> + <br> + {% endfor %} + <b>Select Attempt Number: Default latest attempt</b> + <select class="form-control" name = "attempt_number"> + {%for attempt_number in attempt_numbers %} + {% if forloop.last %} + <option value="{{ attempt_number }}" selected>{{ attempt_number }} (Latest)</option> + {% else %} + <option value = "{{ attempt_number }}"> {{ attempt_number }}</option> + {% endif %} + {% endfor %} + </select> + </div> + <div class="modal-footer"> + <button type="submit" class="btn btn-success"> + <span class="fa fa-save"></span> Download + </button> + <button type="button" class="btn btn-secondary" data-dismiss="modal"> + Close + </button> + </div> + </form> + </div> + </div> + </div> + {% else %} + <div class="col-md-12"> + <div class="alert alert-warning"> + <center> + <h4>No Users Found for {{ quiz.description }}</h4> + </center> + </div> + </div> + {% endif %} {# if papers #} + {% else %} + <h4>No Quiz Found</h4> + {% endif %} + {% endif %} +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/paginator.html b/yaksh/templates/yaksh/paginator.html new file mode 100644 index 0000000..5f0df7a --- /dev/null +++ b/yaksh/templates/yaksh/paginator.html @@ -0,0 +1,33 @@ +<ul class="pagination pagination"> + {% if objects.has_previous %} + <li class="page-item"> + <a class="page-link" href="?page=1" aria-label="Previous"> + <span aria-hidden="true"> + <i class="fa fa-angle-double-left"></i> + </span> + <span class="sr-only">begin</span> + </a> + </li> + {% endif %} + + {% for n in objects.paginator.page_range %} + {% if objects.number == n %} + <li class="page-item active"> + <span class="page-link">{{ n }}<span class="sr-only">(current)</span></span> + </li> + {% elif n > objects.number|add:'-5' and n < objects.number|add:'5' %} + <li class="page-item"><a class="page-link" href="?page={{ n }}">{{ n }}</a></li> + {% endif %} + {% endfor %} + + {% if objects.has_next %} + <li class="page-item"> + <a class="page-link" href="?page={{ objects.paginator.num_pages }}" aria-label="Next"> + <span aria-hidden="true"> + <i class="fa fa-angle-double-right"></i> + </span> + <span class="sr-only">end</span> + </a> + </li> + {% endif %} +</ul>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/preview_questionpaper.html b/yaksh/templates/yaksh/preview_questionpaper.html index 123218f..72355ea 100644 --- a/yaksh/templates/yaksh/preview_questionpaper.html +++ b/yaksh/templates/yaksh/preview_questionpaper.html @@ -1,32 +1,42 @@ {% extends "base.html" %} +{% block title %} Preview Question paper {% endblock title %} {% block pagetitle %} Quiz: {{ paper.quiz.description }} {% endblock pagetitle %} {% block content %} -<div class="well"> - <div class="col-md-12"> - <div class="col-md-6">Maximum Mark(s): {{ paper.total_marks }}</div> - <div class="col-md-6"><span class="pull-right">Total Time: {{ paper.quiz.duration }} minutes</span></div> - </div> +<div class="container"> +<div class="card"> + <div class="card-body"> + <div class="row"> + <div class="col-md-6">Maximum Mark(s): {{ paper.total_marks }}</div> + <div class="col-md-6"> + <span class="pull-right"> + Total Time: {{ paper.quiz.duration }} minutes + </span> + </div> + </div> + </div> </div> -<div class="panel panel-default"> - <div class="panel-heading">Instructions</div> - <div class="panel-body" id="instructions"> - {{ paper.quiz.instructions|safe }} - </div> +<br> +<div class="card"> + <div class="card-header">Instructions</div> + <div class="card-body" id="instructions"> + {{ paper.quiz.instructions|safe }} + </div> </div> +<br> {% for question in questions %} - <div class="panel panel-info"> - <div class="panel-heading"> + <div class="card"> + <div class="card-header"> <strong> {{forloop.counter}}. {{ question.summary }} <span class="marks pull-right"> Mark(s): {{ question.points }} </span> </strong> </div> - <div class="panel-body"> + <div class="card-body"> <h5><u>Question:</u></h5> <strong>{{ question.description|safe }}</strong> <br/><b>Answer:</b><br/> {% if question.type == "code" %} - <div class="well">{{ question.snippet }}<br/></div> + <div class="card"><pre>{{ question.snippet }}</pre><br/></div> {% endif %} {% if question.type == "mcq" or question.type == "mcc" %} <h5> <u>Choices:</u></h5> @@ -38,5 +48,7 @@ </div> </div> + <br> {% endfor %} +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/profile_updated.html b/yaksh/templates/yaksh/profile_updated.html index 2a2c7c5..557719c 100644 --- a/yaksh/templates/yaksh/profile_updated.html +++ b/yaksh/templates/yaksh/profile_updated.html @@ -1,13 +1,31 @@ {% extends "base.html" %} -<!DOCTYPE html> +{% load static %} {% block title %} Profile {% endblock %} +{% block nav %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} +<!DOCTYPE html> + {% block script %} <script> - window.setTimeout(function(){ location.href="{{ URL_ROOT }}/exam/" }, 2000); + window.setTimeout(function(){ location.href="{% url 'yaksh:index' %}" }, 2000); </script> {% endblock script %} {% block content %} -<h3>Your Profile is changed {{ user.first_name }}</h3> -<h3>Redirecting...</h3> +<center> + <div class="container"> + <div class="row align-items-center"> + <div class="col"> + <h3>Your Profile is changed</h3> + <h3>Redirecting...</h3> + </div> + </div> + <div class="col"><img src="{% static 'yaksh/images/profile_change.gif' %}"></div> + </div> +</center> {% endblock content %} diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index ebfe066..74343f8 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -1,12 +1,12 @@ {% extends "exam.html" %} {% load custom_filters %} +{% load static %} -{% block pagetitle %} {{ paper.question_paper.quiz.description }} {% endblock pagetitle %} {% block css %} -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" /> -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question.css" type="text/css" /> -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/codemirror/lib/codemirror.css" type="text/css" /> -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/exam.css" type="text/css" /> + +<link rel="stylesheet" href="{% static 'yaksh/css/question.css' %}" type="text/css" /> +<link rel="stylesheet" href="{% static 'yaksh/css/codemirror/lib/codemirror.css' %}" type="text/css" /> +<link rel="stylesheet" href="{% static 'yaksh/css/exam.css' %}" type="text/css" /> <style> .CodeMirror{ border-style: groove; @@ -19,13 +19,15 @@ {% endblock %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/requesthandler.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/lib/codemirror.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/mode/python/python.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/mode/clike/clike.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/mode/shell/shell.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-sortable.js"></script> + + +<script src="{% static 'yaksh/js/requesthandler.js' %}"></script> +<script src="{% static 'yaksh/js/codemirror/lib/codemirror.js' %}"></script> +<script src="{% static 'yaksh/js/codemirror/mode/python/python.js' %}"></script> +<script src="{% static 'yaksh/js/codemirror/mode/clike/clike.js' %}"></script> +<script src="{% static 'yaksh/js/codemirror/mode/shell/shell.js' %}"></script> +<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML"></script> +<script src="{% static 'yaksh/js/jquery-sortable.js' %}"></script> <script> init_val = '{{ last_attempt|escape_quotes|safe }}'; lang = "{{ question.language }}" @@ -35,9 +37,9 @@ is_exercise = "{{ quiz.is_exercise }}" can_skip = "{{ can_skip }}" delay_time = new Number("{{ delay_time }}") -var time_left = {{ paper.time_left }} +var time_left = "{{ paper.time_left }}" {% if quiz.is_exercise %} - time_left = {{ delay_time }} + time_left = "{{ delay_time }}" {% endif %} function getTimeRemaining(endtime){ @@ -114,255 +116,277 @@ question_type = "{{ question.type }}" {% block onload %} onload="updateTime();" {% endblock %} -{% block learning_units %} -<center><h4>{{course.name}}</h4></center> - <br> - {% for learning_module in all_modules %} - {% if learning_module.id == module.id %} - <span class="glyphicon glyphicon-edit" data-toggle="tooltip" title="Currently on"> - </span> - {% endif %} - <b><u><a href="{{URL_ROOT}}/exam/quizzes/view_module/{{learning_module.id}}/{{course.id}}">{{learning_module.name}}</u></b> - </a> - <ul class="list"> - {% for unit in learning_module.get_learning_units %} - <span> - <li> - {% get_unit_status course learning_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}}/{{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> +{% block main %} + <div> + <center> + {% if notification %} + {% if question.type == "code" %} + <div id="notification" class="alert alert-info col-md-8" role="alert"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>Note:</strong> {{ notification }} + </div> {% else %} - <span class="glyphicon glyphicon-remove" style="color: #FF0000"></span> + <div id="notification" class="alert alert-info col-md-8" role="alert"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>Note:</strong> {{ notification }} + </div> {% endif %} - </li> - </span> - {% endfor %} - </ul> - {% endfor %} -{% endblock %} - -{% block main %} - <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"> - <div class="panel-heading"> - <h4> - <u> {{ question.summary }} - {% if question.type == "mcq" %} - (SINGLE CORRECT CHOICE) - {% elif question.type == "mcc" %} - (MULTIPLE CORRECT CHOICES) - {% elif question.type == "code" %} - (PROGRAMMING) - {% elif question.type == "upload" %} - (ASSIGNMENT UPLOAD) - {% elif question.type == "integer" %} - (FILL IN THE BLANKS WITH INTEGER ANSWER) - {% elif question.type == "string" %} - (FILL IN THE BLANKS WITH STRING ANSWER) - {% if testcase.string_check == "lower" %} - <h5>(CASE INSENSITIVE)</h5> - {% else %} - <h5>(CASE SENSITIVE)</h5> - {% endif %} - {% elif question.type == "float" %} - (FILL IN THE BLANKS WITH FLOAT ANSWER) - {% elif question.type == "arrange" %} - (ARRANGE THE OPTIONS IN CORRECT ORDER) - {% endif %} - - </u> - <font class=pull-right>(Marks : {{ question.points }}) </font> - </h4> - <font size=3 face=arial> {{ question.description|safe }} </font> - {% if files %} - <h4>Files to download for this question</h4> - {% for f_name in files %} - <h5><a href="{{f_name.file.url}}">{{f_name.file.name}}</a></h5> - {% endfor %} - {% endif %} + {% else %} + <div id="notification" role="alert"> + </div> + {% endif %} + </center> + </div> + <form id="code" action="{% url 'yaksh:check' question.id 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="card"> + <div class="card-header"> + <div class="row"> + <div class="col-md-6"> + {{ question.summary }} + </div> + <div class="col-md-4"> + {% if question.type == "mcq" %} + SINGLE CORRECT CHOICE + {% elif question.type == "mcc" %} + MULTIPLE CORRECT CHOICES + {% elif question.type == "code" %} + PROGRAMMING + {% elif question.type == "upload" %} + ASSIGNMENT UPLOAD + {% elif question.type == "integer" %} + FILL IN THE BLANKS WITH INTEGER ANSWER + {% elif question.type == "string" %} + FILL IN THE BLANKS WITH STRING ANSWER + {% if testcase.string_check == "lower" %} + <br>(CASE INSENSITIVE) + {% else %} + <br>(CASE SENSITIVE) + {% endif %} + {% elif question.type == "float" %} + FILL IN THE BLANKS WITH FLOAT ANSWER + {% elif question.type == "arrange" %} + ARRANGE THE OPTIONS IN CORRECT ORDER + {% endif %} + </div> + <div class="col-md-2"> + <span class="badge badge-info"> + {{ question.points }} Marks + </span> + </div> + </div> + </div> + <div class="card-body"> + <div> + {{ question.description|safe }} + </div> + {% if files %} + <div class="col-md-5"> + <div class="card"> + <div class="card-header"> + <span> Files to download for this question </span> </div> - <br/> - {% if quiz.is_exercise %} - {% if can_skip %} - <div class = "well well-sm" id="solution"> - {% else %} - <div id="solution" style="display:none"> - {% endif %} - {% if question.solution %} - <h4><u> Solution by teacher</u></h4> - {% endif%} - <font size=3 face=arial> {{ question.solution|safe }} </font> - </div> - {% endif %} - <div class="panel-body"> - {% if question.type == "mcq" %} - {% for test_case in test_cases %} - {% if last_attempt and last_attempt|safe == test_case.id|safe %} - <input name="answer" type="radio" value="{{ test_case.id }}" checked /> - {{ test_case.options|safe }} <br/> - {% else %} - <input name="answer" type="radio" value="{{ test_case.id }}" /> - {{ test_case.options|safe }} <br/> - {% endif %} - {% endfor %} - {% endif %} - - {% if question.type == "integer" %} - Enter Integer:<br/> - <input autofocus name="answer" type="number" id="integer" value="{{ last_attempt|safe }}" /> - <br/><br/> - {% endif %} - - {% if question.type == "string" %} - Enter Text:<br/> - <textarea autofocus name="answer" id="string">{{ last_attempt|safe }}</textarea> - <br/><br/> - {% endif %} - - {% if question.type == "float" %} - Enter Decimal Value :<br/> - <input autofocus name="answer" type="number" step="any" id="float" value="{{ last_attempt|safe }}" /> - <br/><br/> - {% endif %} - - {% if question.type == "mcc" %} - {% for test_case in test_cases %} - {% if last_attempt and test_case.id|safe in last_attempt|safe %} - <input name="answer" type="checkbox" value="{{ test_case.id }}" checked/> {{ test_case.options| safe }} - <br> - {% else %} - <input name="answer" type="checkbox" value="{{ test_case.id }}"> - {{ test_case.options| safe }} - <br/> - {% endif %} - {% endfor %} - {% endif %} - {% if question.type == "upload" %} - <p>Upload assignment file for the said question<p> - <input type=file id="assignment" name="assignment" multiple=""> - <hr> - {% endif %} + <div class="card-body"> + {% for f_name in files %} + <a href="{{f_name.file.url}}" class="list-group-item" target="_blank">{{f_name.get_filename}} + </a> + {% endfor %} + </div> + </div> + </div> + {% endif %} - {% if question.type == "arrange" %} - {% if last_attempt %} - {% get_answer_for_arrange_options last_attempt question as test_cases %} - {% endif %} - <input name="answer" type="hidden" id='arrange_order'/> - <div class="list-group"> - <ol class="arrange"> - {% for test_case in test_cases %} - <li class="list-group-item" id={{test_case.id}}>{{test_case.options| safe }}</li> - {% endfor %} - </ol> - </div> + {% if quiz.is_exercise %} + <div> + {% if can_skip %} + <div id="solution"> + {% else %} + <div id="solution" style="display:none"> + {% endif %} + {% if question.solution %} + <br> + <h4><u> Solution by teacher</u></h4> + {% endif %} + <font size=3 face=arial> {{ question.solution|safe }} </font> + </div> + </div> + {% endif %} + <br> + <div> + <!-- MCQ type question --> + {% if question.type == "mcq" %} + {% for test_case in test_cases %} + {% if last_attempt and last_attempt|safe == test_case.id|safe %} + <input name="answer" type="radio" value="{{ test_case.id }}" checked /> + {{ test_case.options|safe }} <br/> + {% else %} + <input name="answer" type="radio" value="{{ test_case.id }}" /> + {{ test_case.options|safe }} <br/> + {% endif %} + {% endfor %} + {% endif %} - <script type="text/javascript"> - var arrange = $("ol.arrange"); - var order_array = $(arrange).sortable(['serialize']); - </script> - {% endif %} + <!-- Integer type question --> + {% if question.type == "integer" %} + Enter Integer:<br/> + <input autofocus class="form-control" name="answer" type="number" id="integer" value="{{ last_attempt|safe }}" /> + <br><br> + {% endif %} + <!-- String type question --> + {% if question.type == "string" %} + Enter Text:<br/> + <textarea autofocus name="answer" id="string" class="form-control" style="width: 100%">{{ last_attempt|safe }}</textarea> + <br/><br/> + {% endif %} - {% if question.type == "code" %} - <div class="row"> - <div class="col-md-9"> - <h4>Write your program below:</h4> - </div> - <div class="col-md-3"> - <a href="#answer" class="pull-right" onclick="reset_editor()" name="reset" id="reset">Undo Changes <span class="glyphicon glyphicon-refresh"></span></a> - </div> - </div> - <textarea autofocus name="answer" id="answer"></textarea> - <br> - {% endif %} - <div class="from-group"> + <!-- Float type question --> + {% if question.type == "float" %} + Enter Decimal Value :<br/> + <input autofocus class="form-control" name="answer" type="number" step="any" id="float" value="{{ last_attempt|safe }}" /> + <br/><br/> + {% endif %} - {% if question.type == "mcq" or question.type == "mcc" or question.type == "integer" or question.type == "float" or question.type == "string" %} - <br><button class="btn btn-primary" type="submit" name="check" id="check">Submit Answer</button> - {% elif question.type == "upload" %} - <br><button class="btn btn-primary" type="submit" name="check" id="check" onClick="return validate();">Upload</button> - {% elif question.type == "arrange" %} - <br><button class="btn btn-primary" type="submit" name="check" id="check" onClick="return user_arranged_options();">Submit Answer</button> + <!-- MCC type question --> + {% if question.type == "mcc" %} + {% for test_case in test_cases %} + {% if last_attempt and test_case.id|safe in last_attempt|safe %} + <input name="answer" type="checkbox" value="{{ test_case.id }}" checked/> + {{ test_case.options| safe }} + <br> + {% else %} + <input name="answer" type="checkbox" value="{{ test_case.id }}"> + {{ test_case.options| safe }} + <br> + {% endif %} + {% endfor %} + {% endif %} + <!-- Upload type question --> + {% if question.type == "upload" %} + <p>Upload assignment file for the said question<p> + <input type=file id="assignment" name="assignment" multiple=""> + {% endif %} - {% else %} - {% if question in paper.get_questions_unanswered or quiz.is_exercise %} - <button class="btn btn-primary" type="submit" name="check" id="check" >Check Answer <span class="glyphicon glyphicon-cog"></span></button> - {% endif %} - {% endif %} - {% if quiz.is_exercise %} - {% if can_skip %} - <button id="skip_ex" 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"> Next <span class="glyphicon glyphicon-arrow-right"></span></button> - {% else %} - <button id="skip_ex" 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" style="visibility:hidden"> Next <span class="glyphicon glyphicon-arrow-right"></span></button> - {% endif %} - {% endif %} + <!-- Arrange type question --> + {% if question.type == "arrange" %} + {% if last_attempt %} + {% get_answer_for_arrange_options last_attempt question as test_cases %} + {% endif %} + <input name="answer" type="hidden" id='arrange_order'/> + <div class="list-group"> + <ol class="arrange"> + {% for test_case in test_cases %} + <li class="list-group-item yakshlight" id={{test_case.id}}> + {{test_case.options| safe }}</li> {% endfor %} + </ol> + </div> + <script type="text/javascript"> + var arrange = $("ol.arrange"); + var order_array = $(arrange).sortable(['serialize']); + </script> + {% endif %} - {% 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 }}/{{ 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> - </form> - </div> - </div> - </div> - <br/> - <p id="status"></p> - {% if notification %} + <!-- Code type question --> {% if question.type == "code" %} - <div id="notification" class="alert alert-success" role="alert"> - <strong>Note:</strong> {{ notification }} - </div> - {% else %} - <div id="notification" class="alert alert-warning" role="alert"> - <strong>Note:</strong> {{ notification }} - </div> + <div class="row align-items-center"> + <div class="col-md-9"> + <h4>Write your program below:</h4> + </div> + <div class="col-md-3 ml-auto"> + <a href="#answer" class=" btn btn-outline-primary" onclick="confirm()" name="reset" id="reset">Undo Changes <span class="fa fa-refresh"></span></a> + </div> + </div> + <br> + <div> + <textarea autofocus name="answer" id="answer"></textarea> + </div> {% endif %} - {% else %} - <div id="notification" role="alert"> + + <!-- Submit Buttons --> + <br> + <div> + {% if question.type == "mcq" or question.type == "mcc" or question.type == "integer" or question.type == "float" or question.type == "string" %} + <br><button class="btn btn-success" type="submit" name="check" id="check">Submit Answer</button> + {% elif question.type == "upload" %} + <br><button class="btn btn-success" type="submit" name="check" id="check" onClick="return validate();">Upload</button> + {% elif question.type == "arrange" %} + <br><button class="btn btn-success" type="submit" name="check" id="check" onClick="return user_arranged_options();">Submit Answer</button> + {% else %} + {% if question in paper.get_questions_unanswered or quiz.is_exercise %} + <button class="btn btn-success" type="submit" name="check" id="check" > + Check Answer + </button> + {% endif %} + {% endif %} + {% if quiz.is_exercise %} + {% if can_skip %} + <button id="skip_ex" 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"> Next <span class="fa fa-step-forward"></span></button> + {% else %} + <button id="skip_ex" 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" style="visibility:hidden"> Next <span class="fa fa-step-forward"></span> + </button> + {% endif %} + {% endif %} + + {% 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 }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip" id="skip"> + Attempt Later <span class="fa fa-step-forward"></span> + </button> + {% endif %} + {% endif %} </div> - {% endif %} + </div> + </div> + </div> + </form> + + <!-- Errors for code questions --> + <p id="status"></p> {% if question.type == 'code' or question.type == 'upload' %} - <div class="row" id="error_panel"></div> + <div id="error_panel"></div> {% endif %} - <!-- Modal --> - <div class="modal fade " id="upload_alert" > - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <h4 class="modal-title" id="myModalLabel">File not selected</h4> - </div> - <div id = "modal_body"class="modal-body"> - <font color="brown"><b>Kindly attach a file and then click upload.</b></font> - </div> - <div class="modal-footer"> - <button type="button" class="btn primary close" data-dismiss="modal">OK</button> - </div> + <!-- Modal --> + <div class="modal" id="upload_alert" > + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <h4 class="modal-title" id="myModalLabel">File not selected</h4> + </div> + <div id = "modal_body"class="modal-body"> + <font color="brown"><b>Kindly attach a file and then click upload.</b></font> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-primary" data-dismiss="modal">OK</button> </div> </div> - </div> + </div> + </div> + + <!-- UNDO CHANGES Modal --> + <div class="modal" id="undo_changes" > + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <h4 class="modal-title" id="myModalLabel">Are you Sure?</h4> + </div> + <div id = "modal_body"class="modal-body"> + <font color="brown"><b>Your code will be reset.</b></font> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-warning" onclick="reset_editor()">OK</button> + <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button> + </div> + </div> + </div> + </div> + {% endblock main %} -{% if user %} - {% block info %} - <h5>{{user.get_full_name|title}}({{user.profile.roll_number}}) Logged in as {{user.username}}</h5> - {% endblock %} -{% endif %} + diff --git a/yaksh/templates/yaksh/quit.html b/yaksh/templates/yaksh/quit.html index ee72026..ccb0893 100644 --- a/yaksh/templates/yaksh/quit.html +++ b/yaksh/templates/yaksh/quit.html @@ -1,32 +1,49 @@ {% extends "base.html" %} +{% load static %} + +{% block title %} Quit Quiz {% endblock %} + +{% block nav %} +<div class="container-fluid yakshnav"> + <nav class="navbar fixed-top navbar-expand-lg yakshheading yakshnav"> + <div class="container"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> + </div><!-- /.container --> + </nav><!-- /.navbar --> +</div> +{% endblock %} -{% block pagetitle %} <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_text.png" -width="80" alt="YAKSH"></img> {% endblock %} {% block content %} -<center><table class="table table-bordered" > - <caption> <center><h3>Submission Status</h3> </center> </caption> +<center> +<div class="col-md-8"> + <h3>Submission Status</h3> + <table class="table table-bordered table-responsive-sm" > <thead> - <tr> + <tr class="text-center"> <th> Question</th> - <th> State </th> + <th> Status </th> </tr> </thead> {% for question in paper.questions.all %} <tbody> {% if question in paper.questions_answered.all %} - <tr class="info"> + <tr class="table-success"> <td> {{ question.summary }} </td> <td> Attempted </td> {% else %} - <tr class="danger"> + <tr class="table-warning"> <td> {{ question }} </td> <td> Not completed </td> {% endif %} </tr> </tbody> {% endfor %} -</table></center> + </table> +</div> +</center> {% if paper.question_paper.quiz.is_exercise %} <center><h4> Are you sure you wish to quit the Exercise?</h4></center> @@ -35,11 +52,11 @@ width="80" alt="YAKSH"></img> {% endblock %} <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> {% endif %} - <form action="{{URL_ROOT}}/exam/complete/{{ paper.attempt_number }}/{{module_id}}/{{ paper.question_paper.id }}/{{course_id}}/" method="post"> + <form action="{% url 'yaksh: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 }}/{{module_id}}/{{ paper.question_paper.id }}/{{course_id}}'">No!</button> + <button class="btn btn-outline-success btn-lg" type="submit" name="yes">Yes</button> + <a class="btn btn-outline-danger btn-lg" name="no" href="{% url 'yaksh:start_quiz' paper.attempt_number module_id paper.question_paper.id course_id %}">No</a> </center> </form> {% endblock content %} diff --git a/yaksh/templates/yaksh/quizzes.html b/yaksh/templates/yaksh/quizzes.html new file mode 100644 index 0000000..58dec99 --- /dev/null +++ b/yaksh/templates/yaksh/quizzes.html @@ -0,0 +1,148 @@ +{% extends "manage.html" %} +{% load static %} + +{% block title %} My Quizzes {% endblock %} +{% block content %} +<div class="container"> + <div class="row"> + <div class="col-md-8"> + <ul class="nav nav-pills" id="course_tabs"> + <li class="nav-item"> + <a class="nav-link {% if created %}active{% endif %}" href="{% url 'yaksh:courses' %}"> + My Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add/Edit Course + </a> + </li> + <li class="nav-item dropdown hide"> + <a class="nav-link dropdown-toggle active" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">More</a> + <div class="dropdown-menu hide" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 37px, 0px); top: 0px; left: 0px; will-change: transform;"> + <a class="dropdown-item active" href="{% url 'yaksh:show_all_quizzes' %}"> + Add/View Quizzes + </a> + <a class="dropdown-item" href="{% url 'yaksh:show_all_lessons' %}"> + Add/View Lessons + </a> + <a class="dropdown-item" href="{% url 'yaksh:show_all_modules' %}"> + Add/View Modules + </a> + <a href="{% url 'grades:grading_systems'%}" class="dropdown-item" > + Add/View Grading Systems + </a> + </div> + </li> + </ul> + </div> + </div> +</div> +<div class="container"> + <hr> + <a href="{% url 'yaksh:add_quiz' %}" class="btn btn-primary btn-lg"> + <i class="fa fa-plus-circle"></i> Add New Quiz + </a> + <a href="{% url 'yaksh:add_exercise' %}" class="btn btn-info btn-lg"> + <i class="fa fa-plus-circle"></i> Add New Exercise + </a> + {% if not quizzes %} + <br><br> + <div class="alert alert-info"> + <center><h3> No quizzes found</h3></center> + </div> + {% else %} + <hr> + <form name=frm action="" method="post"> + {% csrf_token %} + <div class="card"> + <div class="card-header"> + <h3> Search/Filter Quizzes </h3> + </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + {{ form.search_tags }} + </div> + <div class="col-md-3"> + {{ form.search_status }} + </div> + </div> + <br> + <button class="btn btn-success" type="submit">Search</button> + <a class="btn btn-primary" href="{% url 'yaksh:show_all_quizzes' %}"> + Clear Search + </a> + </div> + </div> + </form> + <hr> + <center><h4 class="badge badge-success">{{ quizzes_found }} Quiz(zes) Available</h4></center> + + <table class="table table-bordered table-responsive-sm"> + <tr> + <th>Sr.No</th> + <th>Quiz/Exercise</th> + <th>QuestionPaper</th> + </tr> + {% for quiz in quizzes %} + <tr> + <td>{{forloop.counter}}</td> + <td width="30%"> + <div class="row"> + <div class="col-md-7"> + {% if quiz.is_exercise %} + <a href="{% url 'yaksh:edit_exercise' quiz.id %}"> + {{ quiz.description }} + </a> + {% else %} + <a href="{% url 'yaksh:edit_quiz' quiz.id %}"> + {{ quiz.description }} + </a> + {% endif %} + </div> + <div class="col-md-5"> + {% if quiz.active %} + <span class="badge badge-success badge-pill"> + Active + </span> + {% else %} + <span class="badge badge-danger badge-pill"> + Closed + </span> + {% endif %} + </div> + </div> + </td> + <td> + {% if quiz.questionpaper_set.get %} + <div class="row"> + <div class="col-md-7"> + <a href="{% url 'yaksh:designquestionpaper' quiz.id quiz.questionpaper_set.get.id %}"> + Question Paper for {{ quiz.description }}</a> + </div> + <div class="col-md-5"> + <a href="{% url 'yaksh:preview_questionpaper' quiz.questionpaper_set.get.id %}" class="btn btn-primary active btn-xs" target="_blank"> + <i class="fa fa-eye"></i> Preview + </a> + </div> + </div> + {% else %} + <div class="row"> + <div class="col-md-7"> + <p>No Question Paper</p> + </div> + <div class="col-md-5"> + <a href="{% url 'yaksh:designquestionpaper' quiz.id %}" class="btn btn-success"> + <i class="fa fa-plus-circle"></i> Add + </a> + </div> + </div> + {% endif %} + </td> + {% endfor %} <!-- end for quizzes --> + </tr> + </table> + {% endif %} +</div> +{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index 68044da..a9f5a43 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -1,114 +1,169 @@ {% extends "user.html" %} {% block title %} Student Dashboard {% endblock %} -{% block pagetitle %} {{ title }} {% endblock %} + +{% block script %} + +{% endblock %} + {% block main %} - {% if msg %} - <div class="alert alert-warning" role="alert"> - <center>{{ msg }}</center> - </div> - {% endif %} - {% if user.profile.is_moderator %} - <div class="row"> - <a href="{{URL_ROOT}}/exam/toggle_moderator/" class="btn btn-primary pull-right" style="margin-top: 20px; margin-bottom: 20px;"> - Switch To Moderator - </a> - </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"> +<div class="container"> + <center> + <h2>{{title}}</h2> + </center> + <hr> + <div class="row justify-content-center"> + <div class="col-md-8"> + <form action="{% url 'yaksh:quizlist_user' %}" method="post" id="custom-search-form" > {% csrf_token %} <div class="col-md-12"> <div class="input-group"> - <span class="input-group-addon" id="basic-addon1">Search Course</span> - <input type="text" name="course_code" class="form-control" placeholder="Course Code"> - <span class="input-group-btn"> - <button class="btn btn-default" type="submit">Search</button> - <button class="btn btn-default" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/quizzes/");'>Cancel</button> + <input type="text" name="course_code" class="form-control" type="search" placeholder="Enter course code to search" required=""> + <span class="input-group-append"> + <button class="btn btn-outline-info" type="submit"><i class="fa fa-search"></i> Search</button> </span> </div> </div> </form> </div> - {% endif %} -{% if not courses %} -No Courses to display -{% endif %} -{% for course in courses %} -<div class="row well"> - <div class="col-md-12"> - <div class="row"> - <div class="col-md-4"> - <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 user in course.requests.all %} <span class="label label-warning">Request Pending </span> - {% elif user in course.rejected.all %}<span class="label label-danger">Request Rejected</span> - {% elif user in course.students.all %}<span class="label label-info">Enrolled</span> - {% if course.has_lessons %} <a href="{{URL_ROOT}}/exam/download_course/{{course.id}}" data-toggle="tooltip" title="Download course content" class="btn btn-primary"> - Download Course - </a> - {% endif %} - {% else %} - {% if course.active %} - {% if course.is_active_enrollment %} - {% if course.is_self_enroll %} - <a class="btn btn-success" href="{{ URL_ROOT }}/exam/self_enroll/{{ course.id }}">Enroll</a> - {% else %} - <a class="btn btn-success" href="{{ URL_ROOT }}/exam/enroll_request/{{ course.id }}">Enroll</a> - {% endif %} - {% else %} - <span class="label label-danger" style="font-size: 15px"> - Enrollment Closed - </span> - {% endif %} - {% else %} - <span class="label label-danger" style="font-size: 15px"> - Course Closed - </span> - {% endif %} - {% endif %} - </div> - <div class="col-md-4"> - {% if course.days_before_start != 0 %} - <span class="label label-info" style="font-size: 15px"> - {{course.days_before_start}} day(s) to start - </span> - {% endif %} - </div> + {% if "Search" in title %} + <div class="col-md-4"> + <a href="{% url 'yaksh:quizlist_user' %}" class="btn btn-primary"> + <i class="fa fa-times"></i> Clear search + </a> </div> - {% if course.is_active_enrollment %} - <div class="alert alert-info"> - Start Date : {{course.start_enroll_time}} - <br> - End Date : {{course.end_enroll_time}} - </div> {% endif %} + </div> + <br> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + <br> + {% endfor %} + {% endif %} - {% if course.instructions %} - <div class="row"> - <div class="panel-group"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" href="#collapse{{ forloop.counter }}">Course Instructions</a> - </h4> - </div> - <div id="collapse{{ forloop.counter }}" class="panel-collapse collapse"> - <div class="panel-body"> {{ course.instructions|safe }}</div> + {% if not courses %} + <center><div class="col-md-8 alert alert-warning" role="alert"> + No Courses to display + </div></center> + {% endif %} + <div class="row justify-content-md-center align-items-center" > + <div class="col-md-12"> + <div id="accordian"> + {% for course in courses %} + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col-md-7">{{course.data.name}}</div> + <div class="col-md-2"> + <a class="card-link btn btn-info" data-toggle="collapse" href="#collapse{{course.data.id}}"> + Details <i class="fa fa-toggle-down" id="toggle_course_{{course.id}}"></i> + </a> + </div> + <div class="col-md-2"> + {% if user in course.data.requests.all %} + <span class="badge badge-warning badge-pill"> + Request Pending + </span> + {% elif user in course.data.rejected.all %} + <span class="badge badge-danger badge-pill"> + Request Rejected + </span> + {% elif user in course.data.students.all %} + {% if course.completion_percentage > 0 %} + <a class="btn btn-primary" href="{% url 'yaksh:course_modules' course.data.id %}" > + Continue + </a> + {% else %} + <a class="btn btn-success" href="{% url 'yaksh:course_modules' course.data.id %}"> + Start + </a> + {% endif %} + {% else %} + {% if course.data.active %} + {% if course.data.is_active_enrollment %} + {% if course.data.is_self_enroll %} + <a class="btn btn-primary" href="{% url 'yaksh:self_enroll' course.data.id %}">Enroll</a> + {% else %} + <a class="btn btn-primary" href="{% url 'yaksh:enroll_request' course.data.id %}">Enroll</a> + {% endif %} + {% else %} + <span class="badge badge-danger badge-pill"> + Enrollment Closed + </span> + {% endif %} + {% else %} + <span class="badge badge-danger"> + Inactive Course + </span> + {% endif %} + {% endif %} + </div> + </div> + </div> + <div id="collapse{{course.data.id}}" class="collapse hide" data-parent="#accordion"> + <div class="card-body"> + <div class="row"> + <div class="col-md-8"> + <p><b>Instructor:</b> {{course.data.creator.get_full_name|title}}</p> + {% with course.data.get_learning_modules as modules %} + {% if modules %} + <p> <span class="badge badge-pill badge-primary"> + Course Content</span> + <ul> + {% for module in modules %} + <li>{{module.name|title}}</li> + {% endfor %} + </ul> + </p> + {% endif %} + {% endwith %} + {% if course.data.instructions %} + <p> <span class="badge badge-pill badge-primary"> + Instructions</span><br> + {{ course.data.instructions|safe }} + </p> + {% endif %} + </div> + <div class="col-md-4"> + <p><b>Starts On:</b> {{course.data.start_enroll_time}}</p> + <p><b>Ends On:</b> {{course.data.end_enroll_time}}</p> + {% with course.completion_percentage as percent %} + <p><b>Course Progress:</b></p> + <div class="progress"> + {% if percent %} + {% if percent <= 50 %} + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="{{percent}}" + aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> + {% elif percent <= 75 %} + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="{{percent}}" + aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> + {% else %} + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{percent}}" + aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> + {% endif %} + <b style="color: white;">{{percent}}% completed</b> + </div> + {% else %} + <b style="color: black;">0% completed</b> + {% endif %} + </div> + {% endwith %} + </div> + </div> + </div> + </div> + </div> + <br> + {% endfor %} </div> - </div> - </div> </div> - {% endif %} </div> -</div><!--/row--> -</br> -{% endfor %} +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/register.html b/yaksh/templates/yaksh/register.html index 13cd248..454cd5b 100644 --- a/yaksh/templates/yaksh/register.html +++ b/yaksh/templates/yaksh/register.html @@ -1,19 +1,64 @@ {% extends "base.html" %} +{% load static %} +{% block title %} Register {% endblock %} +{% block pagetitle %} Registration {% endblock %} -{% block pagetitle %} Online Test Registration {% endblock %} +{% block nav %} +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> +</nav> +{% endblock %} {% block content %} - -<form action="" method="post"> - {% csrf_token %} - <h3> Please fill in the following details:</h3> - <center> - <table class="table"> - {{ form.as_table }} - </table></center> - <center><button class="btn btn-primary" type="submit">Register</button> - <a href="{{URL_ROOT}}/exam" class="btn btn-danger">Cancel</a></center> -</form> - +<div class="container-fluid"> + <div class="row justify-content-center form-group"> + <div class="col-md-4 col-md-offset-4"> + <form action="" method="post"> + <fieldset> + {% csrf_token %} + <h4> Please fill in the following details:</h4> + <center> + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + {% for field in form %} + <td>{{ field }} <small>{{ field.help_text }}</small></td> + <br> + {% endfor %} + <br> + <br> + </center> + <center> + <button class="btn btn-success btn-lg" type="submit"> + Register + </button> + <a href="{% url 'yaksh:index' %}" class="btn btn-primary btn-lg"> + Cancel + </a> + </center> + </fieldset> + </form> + </div> + </div> +</div> {% endblock content %} diff --git a/yaksh/templates/yaksh/regrade.html b/yaksh/templates/yaksh/regrade.html index 77e28df..c70e470 100644 --- a/yaksh/templates/yaksh/regrade.html +++ b/yaksh/templates/yaksh/regrade.html @@ -3,53 +3,58 @@ {% block pagetitle %} Grader {% endblock pagetitle %} {% block content %} - +<div class="yakshwell container"> <div class="row"> - <div class="col-md-3"> - <ul class="nav nav-pills nav-stacked"> - <li class="active"><a href="#intro" data-toggle="pill" > Intro </a></li> - <li><a href="#questions" data-toggle="pill" > Question-wise regrade </a></li> - <li><a href="#quizzes" data-toggle="pill" > Quiz-wise regrade </a></li> - <li><a href="#users" data-toggle="pill" > User-wise regrade </a></li> - </ul> - </div><!--span2--> - <div class="col-md-9"> - <div class="tab-content"> - <div id="intro" class="tab-pane fade in active"> - <h3> Regrade </h3> + <div class="col-md-3 yakshlabel collapse" id="sidebar"> + <div class="nav nav-pills flex-column" role="tablist" aria-orientation="vertical"> + <a href="#intro" data-toggle="pill" class="nav-link active" role="tab" aria-controls="intro" aria-selected="true" id="introtab"> Intro </a> + <a href="#questions" data-toggle="pill" class="nav-link" role="tab" aria-controls="questions" aria-selected="false" id="questionstab"> Question-wise regrade </a> + <a href="#quizzes" data-toggle="pill" class="nav-link" role="tab" aria-controls="quizzes" aria-selected="false" id="quizzestab"> Quiz-wise regrade </a> + <a href="#users" data-toggle="pill" class="nav-link" role="tab" aria-controls="users" aria-selected="false" id="userstab"> User-wise regrade </a> + </div> + </div><!--end of siddebar--> + <a href="#sidebar" data-toggle="collapse" id="sidebaricon"><i class="fa fa-navicon fa-lg"></i></a> + <main class="tab-content col" id="sidebarbody"> + + + <div id="intro" class="tab-pane fade show active" role="tabpanel" aria-labelledby="introtab"> + <h3 class="yakshred"> Regrade </h3> <dl> - <dt> Question wise regrade </dt> + <dt class="yakshgreen"> Question wise regrade </dt> <dd> You can regrade a question for all answerpapers for a given quiz. </dd> - <dt> Quiz wise regrade <dt> + <dt class="yakshgreen"> Quiz wise regrade <dt> <dd> You can regrade an answerpaper for a quiz or a question for the same. </dd> - <dt> User wise regrade </dt> + <dt class="yakshgreen"> User wise regrade </dt> <dd> You can regrade an answerpaper for an user or a question for the same. </dd> </dl> </div> - <div id="questions" class="tab-pane fade"> + <div id="questions" class="tab-pane fade" role="tabpanel" aria-labelledby="questionstab"> + <div class="card"> {% for course in courses %} - <div class="well"> - <h4><span class="label label-info"> - <a href="#questions_quizzes{{ course.id }}" data-toggle="collapse">Course: {{ course }}</a> + + <div class="card-body"> + <h4><span class=""> + <a href="#questions_quizzes{{ course.id }}" data-toggle="collapse" class="btn btn-outline-success">Course: {{ course }}</a> </span></h4> - <div id="questions_quizzes{{ course.id }}" class="collapse"> + <div id="questions_quizzes{{ course.id }}" class="collapse card"> + <div class="card-body"> {% 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"> + <p><a href="#questions_questions{{ course.id }}{{ quiz.id }}" data-toggle="collapse" class="btn btn-outline-info">Quiz: {{ quiz }}</a></p> + <div id="questions_questions{{ course.id }}{{ quiz.id }}" class="collapse card"> {% with questionpaper=quiz.questionpaper_set.get %} - <p class="bg-info"> Questions: </p> - <ol class="list-group"> + <p class="text-center yakshred h5 bg-light"> Questions: </p> + <ol class="list-group yakshwell"> {% for question in questionpaper.fixed_questions.all %} - <li class="list-group">{{ question.summary }} + <li class="list-group-item">{{ question.summary }} <a href="{{ URL_ROOT }}/exam/manage/regrade/questionpaper/{{ course.id }}/{{ question.id }}/{{ questionpaper.id }}/" - class="btn btn-default btn-sm pull-right"><span class="glyphicon glyphicon-repeat"></span> Regrade </a> + class="btn btn-success pull-right"><span class="fa fa-repeat"></span> Regrade </a> </li> {% endfor %} {% for random_set in questionpaper.random_questions.all %} {% for question in random_set.questions.all %} - <li class="list-group"> {{ question.summary }} + <li class="list-group-item"> {{ question.summary }} <a href="{{ URL_ROOT }}/exam/manage/regrade/questionpaper/{{ course.id}}/{{ question.id }}/{{ questionpaper.id }}/" - class="btn btn-default btn-sm pull-right"><span class="glyphicon glyphicon-repeat"></span> Regrade </a> + class="btn btn-success pull-right"><span class="fa fa-repeat"></span> Regrade </a> </li> {% endfor %} {% endfor %} @@ -58,32 +63,38 @@ </div> {% endfor %} </div> - </div><!--well--> + </div> + </div> + {% endfor %} + </div><!--card--> </div> - <div id="quizzes" class="tab-pane fade"> + <div id="quizzes" class="tab-pane fade" role="tabpanel" aria-labelledby="quizzestab"> + <div class="card"> {% for course in courses %} - <div class="well"> - <h4><span class="label label-info"> - <a href="#quizzes_quizzes{{ course.id }}" data-toggle="collapse">Course: {{ course }}</a> + + <div class="card-body"> + <h4><span class=""> + <span class=""><a href="#quizzes_quizzes{{ course.id }}" data-toggle="collapse" class="btn btn-outline-success">Course: {{ course }}</a></span> </span></h4> - <div id="quizzes_quizzes{{ course.id }}" class="collapse"> + <div id="quizzes_quizzes{{ course.id }}" class="collapse card"> + <div class="card-body"> {% for quiz in course.get_quizzes %} - <p><a href="#quizzes_papers{{ course.id }}{{ quiz.id }}" data-toggle="collapse">Quiz: {{ quiz }}</a></p> + <p><a href="#quizzes_papers{{ course.id }}{{ quiz.id }}" data-toggle="collapse" class="btn btn-outline-info">Quiz: {{ quiz }}</a></p> <div id="quizzes_papers{{ course.id }}{{ quiz.id }}" class="collapse"> - <ol class="list-group"> + <ol class="list-group yakshwell"> {% for answerpaper in quiz.questionpaper_set.get.answerpaper_set.all %} - <li class="list-group"> + <li class="list-group-item bg-light"> Username: {{ answerpaper.user.username }}; Name: {{ answerpaper.user.get_full_name }}; Attempt Number: {{ answerpaper.attempt_number}} <a href="{{ URL_ROOT }}/exam/manage/regrade/paper/{{ course.id }}/{{ answerpaper.id }}/" - class="btn btn-default btn-sm pull-right"><span class="glyphicon glyphicon-repeat"></span> Regrade whole paper </a> + class="btn btn-success btn-sm pull-right"><span class="fa fa-repeat"></span> Regrade whole paper </a> </li> - <ol class="list-group"> + <ol class="list-group yakshwell"> {% for question in answerpaper.questions.all %} - <li class="list-group"> {{ question.summary }} + <li class="list-group-item"> {{ question.summary }} <a href="{{ URL_ROOT }}/exam/manage/regrade/answerpaper/{{ course.id }}/{{ question.id }}/{{ answerpaper.id }}/" - class="btn btn-default btn-sm pull-right"><span class="glyphicon glyphicon-repeat"></span> Regrade </a> + class="btn btn-success btn-sm pull-right"><span class="fa fa-repeat"></span> Regrade </a> </li> {% endfor %} </ol> @@ -91,32 +102,38 @@ </ol> </div> {% endfor %} + </div> </div> - </div><!--well--> + </div> + {% endfor %} + </div><!--card--> </div> - <div id="users" class="tab-pane fade"> + <div id="users" class="tab-pane fade" role="tabpanel" aria-labelledby="userstab"> + <div class="card"> + <div class="card-body"> {% for course in courses %} - <div class="well"> - <h4><span class="label label-info"> - <a href="#users_users{{ course.id }}" data-toggle="collapse">Course: {{ course }}</a> + + <h4><span class=""> + <a href="#users_users{{ course.id }}" data-toggle="collapse" class="btn btn-outline-success">Course: {{ course }}</a> </span></h4> - <div id="users_users{{ course.id }}" class="collapse"> + <div id="users_users{{ course.id }}" class="collapse card"> + <div class="card-bodys"> {% for user in course.students.all %} - <p><a href="#users_papers{{ course.id }}{{ user.id }}" data-toggle="collapse"> Answer Papers for {{ user.get_full_name }}</a></p> - <div id="users_papers{{ course.id }}{{ user.id }}" class="collapse"> - <ol class="list-group"> + <p><a href="#users_papers{{ course.id }}{{ user.id }}" data-toggle="collapse" class="btn btn-outline-info"> Answer Papers for {{ user.get_full_name }}</a></p> + <div id="users_papers{{ course.id }}{{ user.id }}" class="collapse card"> + <ol class="list-group yakshwell"> {% for answerpaper in user.answerpaper_set.all %} - <li class="list-group"> Quiz: {{answerpaper.question_paper.quiz.description }}; Attempt Number: {{ answerpaper.attempt_number }} + <li class="list-group-item bg-light"> Quiz: {{answerpaper.question_paper.quiz.description }}; Attempt Number: {{ answerpaper.attempt_number }} <a href="{{ URL_ROOT }}/exam/manage/regrade/paper/{{ course.id }}/{{ answerpaper.id }}/" - class="btn btn-default btn-sm pull-right" ><span class="glyphicon glyphicon-repeat"></span> Regrade whole paper </a> + class="btn btn-success pull-right" ><span class="fa fa-repeat"></span> Regrade whole paper </a> </li> - <ol class="list-group"> + <ol class="list-group yakshwell"> {% for question in answerpaper.questions.all %} - <li class="list-group"> {{ question.summary }} + <li class="list-group-item"> {{ question.summary }} <a href="{{ URL_ROOT }}/exam/manage/regrade/answerpaper/{{ course.id }}/{{ question.id }}/{{ answerpaper.id }}/" - class="btn btn-default btn-sm pull-right"><span class="glyphicon glyphicon-repeat"></span> Regrade </a> + class="btn btn-success pull-right"><span class="fa fa-repeat"></span> Regrade </a> </li> {% endfor %} </ol> @@ -124,24 +141,27 @@ </ol> </div> {% endfor %} + </div> </div> - </div><!--well--> + {% endfor %} +</div> + </div><!--well--> </div> - </div> - </div><!--span10--> + + </main><!--span10--> </div><!--row--> {% if details %} <div> - <table class="table"> + <table class="table table-responsive-sm"> <tbody> {% for detail in details %} {% if detail.0 %} - <tr class="success"> + <tr class="table-success"> <td> Graded Successfully </td> {% else%} - <tr class="danger"> + <tr class="table-danger"> <td> Did not Grade </td> {% endif %} <td> {{ detail.1|linebreaks }} </td> @@ -151,5 +171,5 @@ </table> </div> {% endif %} - - {% endblock %} +</div> +{% endblock %} diff --git a/yaksh/templates/yaksh/results_user.html b/yaksh/templates/yaksh/results_user.html index 2704da8..b47b5c1 100644 --- a/yaksh/templates/yaksh/results_user.html +++ b/yaksh/templates/yaksh/results_user.html @@ -2,9 +2,10 @@ {% block pagetitle %} Results {% endblock pagetitle %} {% block content %} +<div class="yakshwell container"> <form> {% csrf_token %} - <center><table class="table well"> + <center><table class="table table-responsive-sm"> <th>Quiz Description <th>Obtained Marks <th>Maximum Marks @@ -19,5 +20,6 @@ {% endfor %} </table></center> </form> +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html index 045eb87..a2edbe0 100644 --- a/yaksh/templates/yaksh/show_video.html +++ b/yaksh/templates/yaksh/show_video.html @@ -3,146 +3,161 @@ {% block title %} {{ learning_module.name }} {% endblock %} -{% block pagetitle %} {{ learning_module.name }} -{% if state == "lesson" %} - : {{lesson.name}} -{% endif %} -{% endblock %} - {% block main %} -<div class="col-sm-3 col-md-2 sidebar"> - <center> - <a href="{{URL_ROOT}}/exam/course_modules/{{course.id}}"> - <h4>{{course.name}}</h4> - </a> - </center> - <br> - {% for module in all_modules %} - {% if module.id == learning_module.id %} - <span class="glyphicon glyphicon-edit" data-toggle="tooltip" title="Currently on"> - </span> - {% endif %} - <b><u><a href="{{URL_ROOT}}/exam/quizzes/view_module/{{module.id}}/{{course.id}}">{{module}}</u></b> - </a> - <ul class="list"> - {% for unit in module.get_learning_units %} - <span> - <li> - {% get_unit_status course 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}}/{{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 }} +<div class="wrapper"> + <!-- Sidebar --> + <nav id="sidebar"> + <div class="sidebar-header"> + <a class="text-light" href="{% url 'yaksh:course_modules' course.id %}"> + {{course.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> + </div> + {% for module in all_modules %} + <div id="accordian"> + <div class="card"> + <div class="card-header"> + <div class="row"> + <div class="col-md-10"> + <a href="{% url 'yaksh:view_module' module.id course.id %}"> + {{module.name}} + {% if learning_module.id == module.id %} + <i class="fa fa-edit"></i> + {% endif %} + </a> + </div> + <div class="col-md-2"> + <a class="card-link" data-toggle="collapse" href="#collapse{{module.id}}"> + <i class="fa fa-angle-down"></i> + </a> + </div> + </div> + </div> + {% if learning_module.id == module.id %} + <div id="collapse{{module.id}}" class="collapse show" data-parent="#accordion"> + {% else %} + <div id="collapse{{module.id}}" class="collapse hide" data-parent="#accordion"> + {% endif %} + <div class="card-body"> + {% for unit in module.get_learning_units %} + {% get_unit_status course module unit user as status %} + {% if unit.type == "quiz" %} + <a href="{% url 'yaksh:start_quiz' unit.quiz.questionpaper_set.get.id module.id course.id %}" class="list-group-item"> + {% if status == "completed" %} + <i class="fa fa-check-square"></i> + {% else %} + <i class="fa fa-square-o"></i> + {% endif %} + {{ unit.quiz.description }} + </a> + {% else %} + <a href="{% url 'yaksh:show_lesson' unit.lesson.id module.id course.id %}" class="list-group-item"> + {% if status == "completed" %} + <i class="fa fa-check-square"></i> + {% else %} + <i class="fa fa-square-o"></i> + {% endif %} + {{ unit.lesson.name }} + {% if unit.id == current_unit.id %} + <i class="fa fa-play-circle" data-toggle="tooltip" title="Currently on"> + </i> + {% endif %} + </a> + {% endif %} + {% endfor %} + </div> + </div> + </div> + </div> {% endfor %} - </ul> - {% endfor %} -</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}} - {% if learning_module.html_data%} - <hr> + </nav> + + <!-- Page Content --> + <div id="content"> + + <button type="button" id="sidebarCollapse" class="btn btn-outline-info"> + <i class="fa fa-navicon fa-lg"></i> + </button> + + <br><br> + <ol class="breadcrumb"> + <li class="breadcrumb-item"> + {{course.name}} + </li> + <li class="breadcrumb-item"> + {{ learning_module.name }} + </li> + {% if state == "lesson" %} + <li class="breadcrumb-item active">{{lesson.name}}</li> + {% endif %} + </ol> + <br> + + {% if msg %} + <center> + <div class="alert alert-dismissible alert-warning"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ msg }}</strong> + </div> + </center> {% endif %} - {% if learning_module.get_learning_units %} - <center><h4>Following are the units in this modules</h4></center> - <table class="table"> - <tr> - <th>Unit Name</th> - <th>Unit Type</th> - </tr> - {% for unit in learning_module.get_learning_units %} - <tr> - <ul class="inputs-list"> - <td> - {% if unit.type == "quiz" %} - {{unit.quiz.description}} + + + {% if state == "module" %} <!-- Module instructions body --> + {% if learning_module.html_data %} + {{learning_module.html_data|safe}} {% else %} - {{unit.lesson.name}} + No Module information {% endif %} - </td> - <td> - {% if unit.type == "quiz" %} - {% if unit.quiz.is_exercise %} - Exercise - {% else %} - Quiz - {% endif %} + <br> + {% if first_unit %} + <a href="{% url 'yaksh:next_unit' course.id learning_module.id first_unit.id '1' %}" class="btn btn-success btn-lg">Start + <i class="fa fa-play"> + </i> + </a> {% else %} - Lesson + <a href="{% url 'yaksh:next_unit' course.id learning_module.id %}" class="btn btn-success btn-lg">Next + <i class="fa fa-step-forward"> + </i> + </a> {% endif %} - </td> - </ul> - </tr> - {% endfor %} - </table> - {% else %} - <center><h3>No Lessons/Quizzes Found</h3></center> - {% endif %} - </div> -</div> -<div style="text-align: center;"> - {% if first_unit %} - <a href="{{ URL_ROOT }}/exam/next_unit/{{course.id}}/{{learning_module.id}}/{{first_unit.id}}/1" class="btn btn-info">Start - <span class="glyphicon glyphicon-chevron-right"> - </span> - </a> - {% else %} - <a href="{{ URL_ROOT }}/exam/next_unit/{{course.id}}/{{learning_module.id}}" class="btn btn-info">Next - <span class="glyphicon glyphicon-chevron-right"> - </span> - </a> - {% endif %} -</div> -{% else %} -<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-body" style="border-width: 10px;"> - <h4><strong>Lesson Files (Click on file to download) - </strong></h4> - <ul class="list-group"> - {% for f in lesson.get_files %} - <a class="list-group-item" href="{{f.file.url}}"> - {{ f.file.name|file_title }} + {% else %} <!-- Lesson body --> + <div class="col-md-6" style="width: 100%"> + {{lesson.html_data|safe}} + <br> + <a href="{% url 'yaksh:next_unit' course.id learning_module.id current_unit.id %}" class="btn btn-info btn-lg" > + Next <i class="fa fa-step-forward"></i> </a> - {% endfor %} - </ul> + </div> + <br> + <div class="col-md-7"> + {% with lesson.get_files as lesson_files %} + {% if lesson_files %} + <div class="card"> + <div class="card-header"> + Files for this lesson + </div> + <div class="card-body"> + {% for f in lesson_files %} + <a href="{{f.file.url}}" class="list-group-item"> + {{forloop.counter}}.{{ f.file.name|file_title }} + </a> + {% endfor %} + </div> + </div> + {% endif %} + {% endwith %} + </div> + {% endif %} </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 - <span class="glyphicon glyphicon-chevron-right"> - </span> - </a> </div> -{% endif %} -</div> -{% endblock %}
\ No newline at end of file +<script type="text/javascript"> + $(document).ready(function () { + $('#sidebarCollapse').on('click', function () { + $('#sidebar').toggleClass('active'); + }); + }); +</script> +{% endblock %} + diff --git a/yaksh/templates/yaksh/showquestionpapers.html b/yaksh/templates/yaksh/showquestionpapers.html index e705ce7..6a64262 100644 --- a/yaksh/templates/yaksh/showquestionpapers.html +++ b/yaksh/templates/yaksh/showquestionpapers.html @@ -8,6 +8,7 @@ {% endblock %} {% block manage %} +<div class="yakshwell container"> {% if papers %} <form name=frm action="" method="post"> {% csrf_token %} @@ -15,9 +16,10 @@ <input type="checkbox" name="papers" value="{{ i.id }}"> <a href="{{URL_ROOT}}/exam/manage/showquestionpapers/{{ i.id }}">{{ i.quiz.description }}</a><br> {% endfor %} <br> -<button class="btn" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button> +<button class="btn btn-success" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button> </form> {% else %} <center><h3>No Question Papers available</h3></center> {% endif %} +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html index ff7a627..fdfcc60 100644 --- a/yaksh/templates/yaksh/showquestions.html +++ b/yaksh/templates/yaksh/showquestions.html @@ -1,182 +1,213 @@ {% extends "manage.html" %} +{% load static %} {% block title %} Questions {% endblock %} {% block pagetitle %} Questions {% endblock pagetitle %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/show_question.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/question_filter.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.tablesorter.min.js"></script> +<script type="text/javascript" src="{% static 'yaksh/js/show_question.js' %}"></script> +<script type="text/javascript" src="{% static 'yaksh/js/question_filter.js' %}"></script> +<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"></script> {% endblock %} {% block content %} -<div class="row"> - <div class="col-sm-3 col-md-2 sidebar"> - <ul class="nav nav-sidebar nav-stacked"> - <li class="active"><a href="#show" data-toggle="pill" > Show all Questions</a></li> - <li><a href="#updown" data-toggle="pill" > Upload Questions</a></li> - </ul> - </div> -<div class="tab-content col-md-9 col-md-offset-2 main"> -<!-- Upload Questions --> - -<div id="updown" class="tab-pane fade"> -<div class="alert alert-info" role="alert"> +<div class="container"> + <!-- Side bar --> + <div class="nav nav-pills" role="tablist" aria-orientation="vertical"> + <a href="#show" id="showbar" class="nav-link active" data-toggle="pill" role="tab" aria-controls="show" aria-selected="true"> Show all Questions</a> + <a href="#updown" id="updownbar" class="nav-link" data-toggle="pill" role="tab" aria-controls="updown" aria-selected="false" > Upload Questions</a> + </div> + <!-- End of side bar --> + <div class="tab-content"> + <br> + <!-- Upload Questions --> + <div id="updown" class="card tab-pane fade" role="tabpanel" aria-labelledby="updownbar"> + <div class="col" role="alert"> <p>You can upload question files the following ways - <li><b><u>Yaml File</u></b> - <p>One can upload Yaml file with extensions .yaml or .yml. Please note - that you cannot upload files associated to a question. Yaml file can - have any name. - </p> + <p>One can upload Yaml file with extensions .yaml or .yml. Please note + that you cannot upload files associated to a question. Yaml file can + have any name. + </p> </li> <li><b><u>Zip File</u></b> - <p> One can also upload zip with the following zip structure - - <pre> - .zip - |-- .yaml or .yml - |-- .yaml or .yml - |-- folder1 - | |-- Files required by questions - |-- folder2 - | |-- Files required by questions - </pre> + <p> One can also upload zip with the following zip structure - </p> + <pre> + .zip + |-- .yaml or .yml + |-- .yaml or .yml + |-- folder1 + | |-- Files required by questions + |-- folder2 + | |-- Files required by questions + </pre> </li> </p> - - <p> - <b> Click <a class="btn btn-success" href="{{URL_ROOT}}/exam/manage/courses/download_yaml_template/" ->here</a> to download a sample YAML, edit and upload it</b> - </p> - </div> -<br/> -<h4> Or </h4> -<form action="" method="post" enctype="multipart/form-data"> -{% csrf_token %} - {{ upload_form.as_p }} -<br/> -<h4> And </h4> -<button class="btn btn-success" type="submit" name="upload" value="upload"> -Upload File <span class="glyphicon glyphicon-open"/></button> -</form> -</div> -<!-- End of upload questions --> - -<!-- Show questions --> -<div id="show" class= "tab-pane fade in active"> -<form name=frm action="" method="post"> -{% csrf_token %} -{% if message %} -{%if message == "Questions Uploaded Successfully"%} -<div class="alert alert-success alert-dismissable"> -<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> - {{ message }} -</div> -{%else %} -<div class="alert alert-danger alert-dismissable"> - <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> - {{ message }} -</div> -{% endif %} -{% endif %} -{% if msg %} -<div class="alert alert-danger alert-dismissable"> - <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> - {{ msg }} -</div> -{% endif %} -<br><br> -<form name=frm action="" method="post"> -<!-- Filtering Questions --> -<div class="row" id="selectors"> - <h4 style="padding-left: 20px;">Filters Questions: </h4> - <div class="col-md-3"> - {{ form.question_type }} + </div> + <div class="card-body"> + <form action="" method="post" enctype="multipart/form-data"> + {% csrf_token %} + <div class="form-group col-md-6"> + <a class="btn btn-info" href="{% url 'yaksh:download_yaml_template' %}"> + <i class="fa fa-download"></i> Download Template</a> + <br><br> + <h4> Or </h4> + <br> + <div class="input-group mb-3"> + <div class="custom-file"> + {{ upload_form }} + <label class="custom-file-label" for="id_file"> + Choose file + </label> + </div> + <div class="input-group-append"> + <button class="btn btn-outline-primary" type="submit" name="upload" value="upload"><i class="fa fa-upload"></i> Upload File</button> + </div> + </div> + </div> + <script> + $('#id_file').on('change',function(){ + //get the file name + var fileName = $(this).val(); + //replace the "Choose a file" label + $(this).next('.custom-file-label').html(fileName); + }) + </script> + </form> + </div> </div> - <div class="col-md-3"> - {{ form.language }} - </div> - <div class="col-md-3"> - {{ form.marks }} - </div> -<br> -<h4 style="padding-left: 20px;">Or</h4> + <!-- End of upload questions --> -<h4 style="padding-left: 20px;">Search using Tags: </h4> -</div> -<!-- Searching Tags --> -{% csrf_token %} - <div class="col-md-14"> - <div class="input-group"> - <span class="input-group-addon" id="basic-addon1">Search Questions </span> - <input type="text" id="question_tags" name="question_tags" class="form-control" - placeholder="Search using comma separated Tags"> - <span class="input-group-btn"> - <button class="btn btn-default" type="submit">Search</button> - </span> - <div class="col-md-6"> - <select class="form-control" id="sel1" onchange="append_tag(this);"> - {% if all_tags %} - <option value="" disabled selected>Available Tags</option> - {% for tag in all_tags %} - <option> - {{tag}} - </option> - {% endfor %} - {% else %} - <option value="" disabled selected>No Available Tags</option> + <!-- Show questions --> + <div id="show" class="tab-pane fade show active" role="tabpanel" aria-labelledby="showbar"> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-info"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} {% endif %} - </select> + <form name=frm action="" method="post"> + <div class="card"> + <div class="card-body"> + <!-- Filtering Questions --> + <div id="selectors"> + <h4>Filters Questions: </h4> + <div class="dropdown"> + <div class="col-md-4"> + {{ form.question_type }} + </div> + <div class="col-md-4"> + {{ form.language }} + </div> + <div class="col-md-4"> + {{ form.marks }} + </div> + </div> + </div> + <hr> + <h4 >Or Search using Tags: </h4> + <!-- Searching Tags --> + {% csrf_token %} + <div class="col-md-14"> + <div class="input-group"> + <div class="col-md-6"> + <div class="input-group"> + <div class="input-group-prepend"> + <span class="input-group-text" id="basic-addon1">Search Questions</span> + </div> + <input type="text" name="question_tags" id="question_tags" class="form-control" type="search" placeholder="Search using comma separated Tags"> + <span class="input-group-append"> + <a class="btn btn-outline-secondary" type="submit"><i class="fa fa-search yakshred"></i></a> + </span> + </div> + </div> + <div class="col-md-6"> + <select class="form-control" id="sel1" onchange="append_tag(this);"> + {% if all_tags %} + <option value="" disabled selected>Available Tags</option> + {% for tag in all_tags %} + <option> + {{tag}} + </option> + {% endfor %} + {% else %} + <option value="" disabled selected>No Available Tags</option> + {% endif %} + </select> + </div> + <br><br> + <div class="col-md-6"> + <a class="btn btn-primary" href="{% url 'yaksh:show_questions' %}"> + Clear Filters + </a> + </div> + </div> + </div> + </div> + </div> + <div id="filtered-questions"> + <br> + <a class="btn btn-lg btn-success" href="{% url 'yaksh:add_question' %}"> + <i class="fa fa-plus-circle"></i> Add Question</a> + {% if questions %} + <div> + <br> + {% include "yaksh/paginator.html" %} + <br> + <h5><input id="checkall" type="checkbox"> Select All </h5> + <div class="table-wrapper-2"> + <table id="questions-table" class="tablesorter table table-striped table-responsive-sm"> + <thead> + <tr class="yakshred"> + <th> Select </th> + <th> Summary <i class="fa fa-sort"></i> </th> + <th> Language <i class="fa fa-sort"></i> </th> + <th> Type <i class="fa fa-sort"></i> </th> + <th> Marks <i class="fa fa-sort"></i> </th> + </tr> + </thead> + <tbody> + {% for question in questions %} + <tr> + <td> + <input type="checkbox" name="question" value="{{ question.id }}"> + </td> + <td><a href="{% url 'yaksh:add_question' question.id %}">{{question.summary|capfirst}}</a></td> + <td>{{question.language|capfirst}}</td> + <td>{{question.type|capfirst}}</td> + <td>{{question.points}}</td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + </div> + {% include "yaksh/paginator.html" %} + {% else %} + <br><br> + <div class="alert alert-info"> + <center><h3>No Questions created</h3></center> + </div> + {% endif %} + </div> + <br> + <center> + {% if questions %} + <button class="btn btn-lg btn-primary" type="submit" name='download' value='download'><i class="fa fa-download"></i> Download Selected</button> + <button class="btn btn-lg btn-primary" type="submit" name="test" value="test">Test Selected</button> + <button class="btn btn-lg btn-danger" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'> + <i class="fa fa-trash"></i> Delete Selected</button> + {% endif %} + </center> + </form> </div> + <!-- End of Show questions --> </div> - </div> -<br><br> -<button class="btn btn-primary" type="button" onClick='location.replace("{{URL_ROOT}}");'> - Clear Filters</button> - -<div id="filtered-questions"> -{% if questions %} -<h5><input id="checkall" type="checkbox"> Select All </h5> - -<table id="questions-table" class="tablesorter table table table-striped"> - <thead> - <tr> - <th> Select </th> - <th> Summary </th> - <th> Language </th> - <th> Type </th> - <th> Marks </th> - </tr> - </thead> - <tbody> - -{% for question in questions %} -<tr> -<td> -<input type="checkbox" name="question" value="{{ question.id }}"> -</td> -<td><a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}">{{question.summary|capfirst}}</a></td> -<td>{{question.language|capfirst}}</td> -<td>{{question.type|capfirst}}</td> -<td>{{question.points}}</td> -</tr> -{% endfor %} -</tbody> -</table> -{% endif %} </div> -<br> -<center> -<button class="btn btn-primary" type="button" onclick='location.replace("{{URL_ROOT}}/exam/manage/addquestion/");'>Add Question <span class="glyphicon glyphicon-plus"></span></button> -{% if questions %} -<button class="btn btn-primary" type="submit" name='download' value='download'>Download Selected <span class="glyphicon glyphicon-save"></span></button> -<button class="btn btn-primary" type="submit" name="test" value="test">Test Selected</button> -{% endif %} -<button class="btn btn-danger" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'>Delete Selected <span class="glyphicon glyphicon-minus"></span></button> -</center> -</form> -</div> -</div> -</div> -<!-- End of Show questions --> -{% endblock %}
\ No newline at end of file +{% endblock %} + diff --git a/yaksh/templates/yaksh/showusers.html b/yaksh/templates/yaksh/showusers.html deleted file mode 100644 index ae91076..0000000 --- a/yaksh/templates/yaksh/showusers.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "manage.html" %} - - -{% block subtitle %} -List of Users -{% endblock %} - -{% block css %} -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/showusers.css" type="text/css" /> -{% endblock css %} - - -{% block manage %} -<center><table style="text-align:left;" class=table-class border=3> -<th>Username -<th>First Name -<th>Last Name -<th>Quiz Description -{% for papers in question %} -<tr><td><a href="{{URL_ROOT}}/exam/manage/gradeuser/{{ papers.user.username }}">{{ papers.user.username }}</a><br> - <td >{{ papers.user.first_name.title }} - <td>{{ papers.user.last_name.title }} - <td>{{ papers.question_paper.quiz.description }} -{% endfor %} -</table></center> -{% endblock %} diff --git a/yaksh/templates/yaksh/statistics_question.html b/yaksh/templates/yaksh/statistics_question.html index c6f4e57..58fd8db 100644 --- a/yaksh/templates/yaksh/statistics_question.html +++ b/yaksh/templates/yaksh/statistics_question.html @@ -3,22 +3,29 @@ {% block pagetitle %} Statistics for {{ quiz.description }}{% endblock pagetitle %} {% block content %} -<div class="row"> - <div class="col-md-2"> -{% for attempt in attempts %} - <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"> -{% if question_stats %} - <p><b>Total number of participants: {{ total }}</b></p> - <table class="table table-bordered"> - <tr><th>Question</th><th>Type</th><th>Total</th><th>Answered</th></tr> - {% for question, value in question_stats.items %} - <tr><td>{{ question.summary }}</td><td>{{ question.type }}</td><td>{{value.1}}</td><td>{{ value.0 }} ({% widthratio value.0 value.1 100 %}%)</td></tr> - {% endfor %} - </table> - {% endif %} +<div class="container"> + <div class="row"> + <div class="col-md-2"> + <ul class="list-group"> + {% for attempt in attempts %} + <li class="list-group-item"> + <a href="{% url 'yaksh:show_statistics' questionpaper_id attempt course_id %}">Attempt {{ attempt }} + </a> + </li> + {% endfor %} + </ul> + </div> + <div class="col-md-9"> + {% if question_stats %} + <p><b>Total number of participants: {{ total }}</b></p> + <table class="table table-bordered table-responsive-sm"> + <tr class="bg-light yakshred"><th>Question</th><th>Type</th><th>Total</th><th>Answered</th></tr> + {% for question, value in question_stats.items %} + <tr><td>{{ question.summary }}</td><td>{{ question.type }}</td><td>{{value.1}}</td><td>{{ value.0 }} ({% widthratio value.0 value.1 100 %}%)</td></tr> + {% endfor %} + </table> + {% endif %} + </div> </div> </div> {% endblock %} diff --git a/yaksh/templates/yaksh/unit.html b/yaksh/templates/yaksh/unit.html deleted file mode 100644 index bd34b32..0000000 --- a/yaksh/templates/yaksh/unit.html +++ /dev/null @@ -1,72 +0,0 @@ -{% load custom_filters %} -<html> -<link rel="stylesheet" href="../../static/css/bootstrap.css"> -<link rel="stylesheet" href="../../static/css/bootstrap.min.css"> -<link rel="stylesheet" href="../../static/css/offline.css"> -<link rel="stylesheet" href="../../static/css/video-js.css"> -<script src="../../static/js/jquery-1.9.1.min.js"></script> -<script src="../../static/js/bootstrap.min.js"></script> -<script src="../../static/js/video.js"></script> -<nav class="navbar navbar-inverse navbar-fixed-top"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" href="#"> - <img src="../../static/images/yaksh_banner.png" alt="YAKSH"> - </img> - </a> - </div> - </div> -</nav> -<div class="container" style="margin-top:50px"> - <center> - <h1> - {% block subtitle %} - {{course.name}} - {% endblock %} - </h1> - <hr> - </center> - {% block content %} - <center><h2>{{module.name}}</h2></center> - <hr> - <h3>{{lesson.name}}</h3> - {% if lesson.video_file %} - <video id="lesson_video" height="500" class="video-js" controls preload="auto" data-setup='{"playbackRates": [0.5, 1, 1.5, 2]}'> - <source src="{{lesson.video_file.name|file_title}}"> - </video> - {% endif %} - <br> - <table class="table"> - <tr> - <td> - {{lesson.html_data|safe}} - </td> - <td> - {% if lesson_files %} - <h4><strong>Lesson Files (Click on lesson file to download) - </strong></h4> - <ul class="list-group"> - {% for file in lesson_files %} - <a href="{{file.file.name|file_title}}" class="list-group-item"> - {{file.file.name|file_title}} - </a> - {% endfor %} - </ul> - {% else %} - <ul class="list-group"> - <li class="list-group-item"> - <h4>No files for {{lesson.name}}</h4> - </li> - </ul> - {% endif %} - </td> - </tr> - </table> - {% endblock %} -</div> -<footer class="footer" id="footer_div"> - <div class="container"> - <p align="center">Developed by FOSSEE group, IIT Bombay</p> - </div> -</footer> -</html>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 9449fcc..6547851 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -1,269 +1,354 @@ {% extends "manage.html" %} {% load custom_filters %} - +{% load static %} +{% block title %} User Data {% endblock %} {% block pagetitle %} Data for user {{ data.user.get_full_name.title }} {% endblock pagetitle %} -{% block content %} - {% block script %} -<script src= "{{ URL_ROOT }}/static/yaksh/js/edit_question.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script> - +<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"> +</script> +<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML"></script> {% endblock %} - -<form action="" method="post"> -<p> -Name: {{ data.user.get_full_name.title }} <br/> -Username: {{ data.user.username }} <br/> -{% if data.profile %} -Roll number: {{ data.profile.roll_number }} <br/> -Position: {{ data.profile.position }} <br/> -Department: {{ data.profile.department }} <br/> -Institute: {{ data.profile.institute }} <br/> -{% endif %} -Email: {{ data.user.email }} <br/> -Date joined: {{ data.user.date_joined }} <br/> -Last login: {{ data.user.last_login }} -</p> - -{% if data.papers %} -<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> - -{% for paper in data.papers %} -{% if forloop.counter == 2 and data.questionpaperid %} -<hr> -<U><h2> Previous attempts </h2></U> -{% endif %} -<h2> Quiz: {{ paper.question_paper.quiz.description }} </h2> - -<p> -Attempt Number: {{ paper.attempt_number }}<br/> -Questions correctly answered: {{ paper.get_answered_str }} <br/> -Total attempts at questions: {{ paper.answers.count }} <br/> -Marks obtained: {{ paper.marks_obtained }} <br/> -Start time: {{ paper.start_time }} <br/> -User IP address: {{ paper.user_ip }} -</p> - -{% if paper.answers.count %} -<h3> Answers </h3> -{% for question, answers in paper.get_question_answers.items %} -<div class="panel panel-info"> - <div class="panel-heading"> - - <strong> Details: {{forloop.counter}}. {{ question.summary }} - <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> +{% block content %} +<div class="container"> + {% if data.papers %} + <p class="text-center"> + {% with data.papers.0 as paper %} + <div class="card"> + <div class="card-header"> + Course Details </div> - <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" %} - <h5> <u>Choices:</u></h5> - {% for testcase in question.get_test_cases %} - {% if testcase.correct %} - <br/> - <strong>{{ forloop.counter }}. {{ testcase.options|safe }}</strong> - <span class="label label-success"> Correct </span> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + <p><b>Course:</b> {{ paper.course.name }}</p> + <p><b>Quiz:</b> {{ paper.question_paper.quiz.description }}</p> + </div> + <div class="col-md-6"> + <p><b>Start time:</b> {{ paper.start_time }}</p> + <p><b>End time:</b> {{ paper.end_time }}</p> + <p><b>User IP:</b> {{paper.user_ip}} </p> + </div> + </div> + </div> + </div> + {% endwith %} + <br> + <a href="{% url 'yaksh:grade_user' data.papers.0.question_paper.quiz.id data.user.id course_id %}" class="btn btn-info"> + Grade User + </a> + <br> + {% for paper in data.papers %} + <br> + <h3><b><u>Attempt Number:</u></b> <span class="badge badge-pill badge-info"> + {{paper.attempt_number}} + </span></h3> + <div class="card"> + <div class="card-header"> + Scorecard + </div> + <div class="card-body"> + <p><b>Status:</b> + {% if paper.passed %} + <span class="badge badge-pill badge-success"> Passed </span> + {% else %} + <span class="badge badge-pill badge-danger"> Failed </span> + {% endif %} + </p> + <p><b>Total Marks:</b> {{ paper.question_paper.total_marks }}</p> + <p><b>Marks obtained:</b> {{ paper.marks_obtained }}</p> + {% if paper.percent %} + <p><b>Percentage obtained:</b> {{paper.percent}}%</p> + {% endif %} + <p><b>Total attempts at questions:</b> {{ paper.answers.count }}</p> + </div> + </div> + <br> + {% if paper.answers.count %} + <div class="card"> + <div class="card-header"> + Submission Details + </div> + <div class="card-body"> + <table class="tablesorter table table-striped table-bordered table-responsive-sm" id='marks_table'> + <thead> + <tr> + <th>Questions</th> + <th>Type</th> + <th>Marks Obtained</th> + </tr> + </thead> + <tbody> + {% for question, answers in paper.get_question_answers.items %} + {% with answers|last as answer %} + <tr> + <td> + <a href="#question_{{question.id}}"> + {{ question.summary }} + </a> + </td> + <td>{{ question.type }}</td> + <td>{{ answer.answer.marks }}</td> + </tr> + {% endwith %} + {% endfor %} + </tbody> + </table> + {% for question, answers in paper.get_question_answers.items %} + <div class="card" id="question_{{question.id}}"> + <div class="card-header text-white bg-info"> + <strong> + Details: {{forloop.counter}}. {{ question.summary }} + <span class="marks pull-right"> Mark(s): {{ question.points }} </span> + </strong> + </div> + <div class="card-body"> + <h5> + <span class="badge badge-pill badge-primary">Question:</span> + </h5> + <strong>{{ question.description|safe }}</strong> + <br><br> + {% if question.type == "mcq" or question.type == "mcc" %} + <h5> + <span class="badge badge-pill badge-primary">Choices:</span> + </h5> + {% for testcase in question.get_test_cases %} + {% if testcase.correct %} + <strong> + <span class="badge badge-pill badge-success"> + {{ forloop.counter }}. + </span> + {{ testcase.options|safe }} + </strong> {% else %} - <br/><strong> - {{ forloop.counter }}. {{ testcase.options|safe }}</strong> - {% endif %} + <strong> + <span class="badge badge-pill badge-secondary"> + {{ forloop.counter }}. + </span> + {{ testcase.options|safe }} + </strong> + {% endif %} + <br> {% endfor %} - - {% elif question.type == "integer" or question.type == "string" or question.type == "float" %} - <h5> <u>Correct Answer:</u></h5> + {% elif question.type == "integer" or question.type == "string" or question.type == "float" %} + <h5> + <span class="badge badge-pill badge-primary"> + Correct Answer: + </span> + </h5> {% for testcase in question.get_test_cases %} - <strong>{{ testcase.correct|safe }}</strong> + <strong>{{ testcase.correct }}</strong> + {% if testcase.error_margin %} + <strong>{{ testcase.error_margin }}</strong> + {% endif %} {% endfor %} - - {% elif question.type == "arrange" %} - <h5> <u>Correct Order:</u></h5> - <div class="list-group" > - {% for testcase in question.get_test_cases %} - <li class="list-group-item"><strong>{{ testcase.options|safe }}</strong></li> - {% endfor %} - </div> - - {% else %} - <h5> <u>Test cases: </u></h5> + {% elif question.type == "arrange" %} + <h5> + <span class="badge badge-pill badge-primary"> + Correct Order:</span> + </h5> + <div class="list-group" > {% for testcase in question.get_test_cases %} - <br/><strong>{{ forloop.counter }}. {{ testcase.test_case }}</strong> + <li class="list-group-item"> + <strong>{{ testcase.options }}</strong> + </li> {% endfor %} - {%endif%} - </div> - </div> - {% if question.type != "code" %} - {% if "Correct answer" in answers.0.error_list %} - <div class="panel panel-success"> - <div class="panel-heading"><strong>Correct</strong></div> - {% else %} - <div class="panel panel-danger"> - <div class="panel-heading"><strong> Incorrect</strong></div> - {% endif %} - <div class="panel-body"> - <h5><u>Student answer:</u></h5> - - {% if question.type == "mcc"%} - <div class="well well-sm"> - {% for testcases in question.get_test_cases %} - {%if testcases.id|stringformat:"i" in answers.0.answer|safe %} - <li>{{ testcases.options.strip|safe }}</li> - {% endif %} - {% endfor %} - </div> - - {% elif question.type == "mcq"%} - <div class="well well-sm"> - {% for testcases in question.get_test_cases %} - {%if testcases.id|stringformat:"i" == answers.0.answer|safe %} - <li>{{ testcases.options.strip|safe }}</li> - {% endif %} - {% endfor %} - </div> - - {% elif question.type == "arrange"%} - <div class="well well-sm"> - {% get_answer_for_arrange_options answers.0.answer question as tc_list %} - {% for testcases in tc_list %} - <li>{{ testcases.options.strip|safe }}</li> - {% endfor %} - </div> - - {%else%} - <div class="well well-sm"> - {{ answers.0.answer|safe }} - </div> - {% endif %} - </div> + </div> + {% else %} + <h5> + <span class="badge badge-pill badge-primary">Test cases: + </span> + </h5> + {% for testcase in question.get_test_cases %} + <strong> + {{ forloop.counter }}. {{ testcase }} + </strong> + <br> + {% endfor %} + {% endif %} + <br> + <h5> + <span class="badge badge-pill badge-primary">Student answer(s): + </span> + </h5> + {% if question.type == "upload" %} + {% if has_user_assignments %} + <a href="{% url 'yaksh:download_user_assignment' question.id data.user.id paper.question_paper.quiz.id course_id %}"> + <div class="btn btn-outline-info text-center"> + Assignment File for {{ data.user.get_full_name.title }} + </div> + </a> + {% else %} + <center> + <div class="alert alert-warning"> + <h5> + Assignment not submitted by {{ data.user.get_full_name.title }} + </h5> + </div> + </center> + {% endif %} <!-- End has_user_assignments --> + {% else %} + {% for ans in answers %} + <strong> + Attempt Number: {{forloop.counter}} + </strong> + <div id="accordian"> + <div class="card"> + {% if ans.answer.correct %} + <div class="card-header"> + <span class="badge badge-success"> + Correct answer: + </span> + <a class="card-link" data-toggle="collapse" href="#submitted_{{ans.answer.id}}"> + <span class="pull-right"> + Details <i class="fa fa-toggle-down"></i> + </span> + </a> + </div> + {% else %} + <div class="card-header"> + <span class="badge badge-danger"> + Error: + </span> + <a class="card-link" data-toggle="collapse" href="#submitted_{{ans.answer.id}}"> + <span class="pull-right"> + Details <i class="fa fa-toggle-down"></i> + </span> + </a> + </div> + {% endif %} + <div class="collapse hide" id="submitted_{{ans.answer.id}}" data-parent="#accordion"> + <div class="card-body"> + {% with ans.error_list as err %} + {% for error in err %} + {% if error.type == 'stdio' %} + {% if error.given_input %} + <table class="table table-bordered table-responsive-sm"> + <tr class="table-active"> + <td> For given Input value(s):</td> + <td>{{error.given_input}}</td> + </tr> + </table> + {% endif %} + <table id="course-detail" class="table table-bordered table-responsive-sm" width="100%" id="output"> + <tr> + <th><center>Line No.</center></th> + <th><center>Expected Output</center></th> + <th><center>User output</center></th> + <th><center>Status</center></th> + </tr> + {% for expected,user in error.expected_output|zip:error.user_output %} + <td> {{forloop.counter}} </td> + <td>{{expected|default:""}} </td> + <td>{{user|default:""}}</td> + {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} + <td><span class ="fa fa-times text-warning"/></td> + {% else %} + <td><span class ="fa fa-check text-success"/></td> + {% endif %} + </tr> + {% endfor %} + </table> + <table width="100%" class="table table-bordered table-responsive-sm"> + <col width="10"> + <tr> + <td>Error:</td> + <td>{{error.error_msg}}</td> + </tr> + </table> + {% elif error.type == 'assertion' %} + {% if error.test_case %} + <strong> + We tried you code with the following test case: + </strong><br><br> + <pre><code> + <strong>{{error.test_case}}</strong> + </code></pre> + {% endif %} + <p><b>The following error took place: </b></p> + <table id="course-detail" class="table table-bordered table-responsive-sm" width="100%"> + <tr class = "active"> + <td><b>Exception Name: </b></td> + <td><span>{{error.exception}}</span></td> + </tr> + <tr> + <td><b>Exception Message: </b></td><td>{{error.message}}</td> + </tr> + <tr> + {% if error.traceback %} + <td><b>Full Traceback: </b></td> + <td><pre>{{error.traceback}}</pre></td> + {% endif %} + </tr> + </table> + {% else %} + <pre><code> {{error}} </code></pre> + {% endif %} + {% endfor %} + {% endwith %} + {% if question.type == "code" %} + {% pygmentise_user_answer question.language ans.answer.answer.strip as user_answer %} + <style type="text/css">{{user_answer.1}}</style> + <pre><code>{{user_answer.0|safe}}</code></pre> + {% elif question.type == "mcc" or question.type == "mcq" %} + {% for testcases in question.get_test_cases %} + {% if testcases.id|stringformat:"i" in ans.answer.answer.strip %} + <li>{{ testcases.options.strip|safe }}</li> + {% endif %} + {% endfor %} + {% elif question.type == "arrange"%} + {% get_answer_for_arrange_options ans.answer.answer question as tc_list %} + {% for testcases in tc_list %} + <li>{{ testcases.options.strip }}</li> + {% endfor %} + {% else %} + {{ ans.answer.answer.strip }} + {% endif %} + </div> + </div> + </div> + </div> + <br> + {% endfor %} <!-- End for ans in answers --> + </div> + </div> + {% endif %} + <br> + <div class="form-group"> + <div class="col-md-2"> + <label class="col-form-label" for="q{{ question.id }}">Marks:</label> + {% with answers|last as answer %} + <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answer.answer.marks }}" readonly=""><br><br> + {% endwith %} + </div> + </div> + <hr/> + {% endfor %} {# for question, answers ... #} + <div class="form-group"> + <h3>Teacher comments: </h3> + <textarea id="comments_{{paper.question_paper.id}}" class="form-control" + name="comments_{{ paper.question_paper.id }}" readonly="">{{ paper.comments }}</textarea> + </div> + </div> </div> - {% else %} - <h5>Student answer: </h5> - {% for answer in answers %} - - {% if answer.answer.correct %} - <div class="panel panel-success"> - <div class="panel-heading">Correct answer - {% else %} - <div class="panel panel-danger"> - <div class="panel-heading">Error<br/> - {% with answer.error_list as err %} - {% for error in err %} - {% if error.type == 'stdio' %} - <div class = "well well-sm"> - {% if error.given_input %} - <table class="table table-bordered"> - <col width="30%"> - <tr class = "active"> - <td> For given Input value(s):</td> - <td>{{error.given_input}}</td> - </tr> - </table> - {% endif %} - <table class="table table-bordered" width="100%" id="output" style="table-layout: fixed"> - <col width="10%"> - <col width="40%"> - <col width="40%"> - <col width="10%"> - <tr class="info"> - <th><center>Line No.</center></th> - <th><center>Expected Output</center></th> - <th><center>User output</center></th> - <th><center>Status</center></th> - </tr> - {% for expected,user in error.expected_output|zip:error.user_output %} - <td> {{forloop.counter}} </td> - <td>{{expected|default:""}} </td> - <td>{{user|default:""}}</td> - {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} - <td><span class ="glyphicon glyphicon-remove text-warning"/></td> - {% else %} - <td><span class ="glyphicon glyphicon-ok text-success"/></td> - {% endif %} - </tr> - {% endfor %} - </table> - <table width="100%" class='table table-bordered'> - <col width="10"> - <tr class = "danger"> - <td><b>Error:</b></td> - <td>{{error.error_msg}}</td> - </tr> - </table> + {% else %} + <div class="alert alert-warning"> + No submissions found </div> - {% elif error.type == 'assertion' %} - {% if error.test_case %} - <strong> We tried you code with the following test case:</strong><br/></br> - <pre><code><strong style="color:#d9534f">{{error.test_case}}</strong></code></pre> - {% endif %} - <p> <b>The following error took place: </b></p> - <div class="well well-sm"> - <table class="table table-bordered" width="100%" style="table-layout: fixed"> - <col width="30%"> - <tr class = "active"> - <td><b>Exception Name: </b></td> - <td><span style="color: #d9534f">{{error.exception}}</span></td> - </tr> - <tr> - <td><b>Exception Message: </b></td><td>{{error.message}}</td> - </tr> - <tr> - {% if error.traceback %} - <td><b>Full Traceback: </b></td> - <td><pre>{{error.traceback}}</pre></td> - {% endif %} - </tr> - </table> - </div> <!-- Closes well --> - {% else %} - <pre><code> {{error|safe}} </code></pre> - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - - </div> - <div class="panel-body"> - {% if question.type != "code" %} - <div class="well well-sg"> - {{question.type}} - {{ answer.answer.answer.strip|safe }} - </div> - {% else %} - <pre><code>{{ answer.answer.answer.strip|safe }}</code></pre> - {% endif %} - </div> - </div> - - {% endfor %} - {% endif %} - <hr> - {% endfor %} {# for question, answers ... #} - -<h3>Teacher comments: </h3> -{{ paper.comments|default:"None" }} -{% endif %} {# if paper.answers.count #} - -{% endfor %} {# for paper in data.papers #} - -{% endif %} {# if data.papers #} -<br /> -<hr /> - -{% with data.papers.0 as paper %} -<a href="{{URL_ROOT}}/exam/manage/gradeuser/{{paper.question_paper.quiz.id}}/{{ data.user.id }}/{{course_id}}/">Grade/correct paper</a> -{% endwith %} -<br /> - -{% if data.papers.count > 1 %} -<a href="{{URL_ROOT}}/exam/manage/monitor/">Monitor quiz</a> -{% else %} -{% with data.papers.0 as paper %} -<a href="{{URL_ROOT}}/exam/manage/monitor/{{paper.question_paper.id}}/">Monitor quiz</a> -{% endwith %} -{% endif %} - + {% endif %} {# if paper.answers.count #} + <hr> + {% endfor %} {# for paper in data.papers #} + {% else %} + <br> + <center> + <div class="alert alert-warning"> + {% if quiz.is_exercise %} + You have not attempted the Exercise {{ quiz.description }} + {% else %} + You have not attempted the quiz {{ quiz.description }} + {% endif %} + </div> + </center> + {% endif %} {# if data.papers #} +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html index 7cbec91..c1f13d1 100644 --- a/yaksh/templates/yaksh/view_answerpaper.html +++ b/yaksh/templates/yaksh/view_answerpaper.html @@ -1,251 +1,354 @@ {% extends "user.html" %} {% load custom_filters %} +{% load static %} +{% block title %} View Answer paper {% endblock %} {% block pagetitle %} Answer Paper for {{ quiz.description }}{% endblock pagetitle %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script> - -{% endblock script %} - -{% block main %} - -{% if not data.papers %} - {% if quiz.is_exercise %} - <p><b> You have not attempted the Exercise {{ quiz.description }} </b></p> - {% else %} - <p><b> You have not attempted the quiz {{ quiz.description }} </b></p> - {% endif %} -{% else %} +<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"> +</script> +<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML"></script> +{% endblock %} +{% block content %} +<div class="container"> + <a class="btn btn-primary" href="{% url 'yaksh:course_modules' course_id %}"> + <i class="fa fa-arrow-left"></i> + Back + </a> + <br><br> + {% if data.papers %} + <p class="text-center"> + {% with data.papers.0 as paper %} + <div class="card"> + <div class="card-header"> + Course Details + </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + <p><b>Course:</b> {{ paper.course.name }}</p> + <p><b>Quiz:</b> {{ paper.question_paper.quiz.description }}</p> + </div> + <div class="col-md-6"> + <p><b>Start time:</b> {{ paper.start_time }}</p> + <p><b>End time:</b> {{ paper.end_time }}</p> + </div> + </div> + </div> + </div> + {% endwith %} {% for paper in data.papers %} - {% if forloop.counter == 2 and data.questionpaperid %} - <U><h2> Previous attempts </h2></U> - {% endif %} - {% if quiz.is_exercise %} - <h2> Exercise: {{ paper.question_paper.quiz.description }} </h2> - {% else %} - <h2> Quiz: {{ paper.question_paper.quiz.description }} </h2> - {% endif %} - - <p> - Attempt Number: {{ paper.attempt_number }}<br/> - Questions correctly answered: {{ paper.get_answered_str }} <br/> - Marks obtained: {{ paper.marks_obtained }} <br/> - Start time: {{ paper.start_time }} <br/> - End time : {{ paper.end_time }} <br/> - Percentage obtained: {{ paper.percent }}% <br/> - {% if paper.passed %} - Status : <b style="color: green;"> Passed </b><br/> - {% else %} - Status : <b style="color: red;"> Failed </b><br/> - {% endif %} - </p> - - {% if paper.answers.count %} - <h3> Answerpaper: </h3> - {% for question, answers in paper.get_question_answers.items %} - - <div class="panel panel-info"> - <div class="panel-heading"> - <strong> Details: {{forloop.counter}}. {{ question.summary }} - <span class="marks pull-right"> Mark(s): {{ question.points }} </span> - </strong> + <br> + <h3><b><u>Attempt Number:</u></b> <span class="badge badge-pill badge-info"> + {{paper.attempt_number}} + </span></h3> + <div class="card"> + <div class="card-header"> + Scorecard + </div> + <div class="card-body"> + <p><b>Status:</b> + {% if paper.passed %} + <span class="badge badge-pill badge-success"> Passed </span> + {% else %} + <span class="badge badge-pill badge-danger"> Failed </span> + {% endif %} + </p> + <p><b>Total Marks:</b> {{ paper.question_paper.total_marks }}</p> + <p><b>Marks obtained:</b> {{ paper.marks_obtained }}</p> + {% if paper.percent %} + <p><b>Percentage obtained:</b> {{paper.percent}}%</p> + {% endif %} + <p><b>Total attempts at questions:</b> {{ paper.answers.count }}</p> </div> - <div class="panel-body"> - <h5><u>Question:</u></h5> <strong>{{ question.description|safe }}</strong> - {% if question.type == "mcq" or question.type == "mcc" %} - <h5> <u>Choices:</u></h5> - {% get_ordered_testcases question paper as testcases %} - {% for testcase in testcases %} - {% if testcase.correct %} - <br/> - <strong>{{ forloop.counter }}. {{ testcase.options|safe }}</strong> - <span class="label label-success"> Correct</span> - {% else %} - <br/><strong> - {{ forloop.counter }}. {{ testcase.options|safe }}</strong> - {% endif %} + </div> + <br> + {% if paper.answers.count %} + <div class="card"> + <div class="card-header"> + Submission Details + </div> + <div class="card-body"> + <table class="tablesorter table table-striped table-bordered table-responsive-sm" id='marks_table'> + <thead> + <tr> + <th>Questions</th> + <th>Type</th> + <th>Marks Obtained</th> + </tr> + </thead> + <tbody> + {% for question, answers in paper.get_question_answers.items %} + {% with answers|last as answer %} + <tr> + <td> + <a href="#question_{{question.id}}"> + {{ question.summary }} + </a> + </td> + <td>{{ question.type }}</td> + <td>{{ answer.answer.marks }}</td> + </tr> + {% endwith %} {% endfor %} - - {% elif question.type == "integer" or question.type == "string" or question.type == "float" %} - <h5> <u>Correct Answer:</u></h5> + </tbody> + </table> + {% for question, answers in paper.get_question_answers.items %} + <div class="card" id="question_{{question.id}}"> + <div class="card-header text-white bg-info"> + <strong> + Details: {{forloop.counter}}. {{ question.summary }} + <span class="marks pull-right"> Mark(s): {{ question.points }} </span> + </strong> + </div> + <div class="card-body"> + <h5> + <span class="badge badge-pill badge-primary">Question:</span> + </h5> + <strong>{{ question.description|safe }}</strong> + <br><br> + {% if question.type == "mcq" or question.type == "mcc" %} + <h5> + <span class="badge badge-pill badge-primary">Choices:</span> + </h5> {% for testcase in question.get_test_cases %} - <strong>{{ testcase.correct|safe }}</strong> + {% if testcase.correct %} + <strong> + <span class="badge badge-pill badge-success"> + {{ forloop.counter }}. + </span> + {{ testcase.options|safe }} + </strong> + {% else %} + <strong> + <span class="badge badge-pill badge-secondary"> + {{ forloop.counter }}. + </span> + {{ testcase.options|safe }} + </strong> + {% endif %} + <br> {% endfor %} - - {% elif question.type == "arrange" %} - <h5> <u>Correct Order:</u></h5> - <div class="list-group"> - {% for testcase in question.get_test_cases %} - <li class="list-group-item"><strong>{{ testcase.options|safe }}</strong></li> - {% endfor %} - </div> - - {% else %} - <h5> <u>Test cases: </u></h5> + {% elif question.type == "integer" or question.type == "string" or question.type == "float" %} + <h5> + <span class="badge badge-pill badge-primary"> + Correct Answer: + </span> + </h5> {% for testcase in question.get_test_cases %} - <br/><strong>{{ forloop.counter }}. {{ testcase }}</strong> + <strong>{{ testcase.correct }}</strong> + {% if testcase.error_margin %} + <strong>{{ testcase.error_margin }}</strong> + {% endif %} {% endfor %} - {% endif %} - - </div> - </div> - {% if question.type != "code" %} - {% if "Correct answer" in answers.0.error_list %} - <div class="panel panel-success"> - {% else %} - <div class="panel panel-danger"> - {% endif %} - <div class="panel-heading"> - <strong>{{ answers.0.error_list.0 }}</strong> - </div> - <div class="panel-body"> - {% if question.type == "mcc"%} - <div class="well well-sm"> - {% for testcases in question.get_test_cases %} - {%if testcases.id|stringformat:"i" in answers.0.answer|safe %} - <li>{{ testcases.options.strip|safe }}</li> - {% endif %} - {% endfor %} - </div> - {% elif question.type == "mcq"%} - <div class="well well-sm"> - {% for testcases in question.get_test_cases %} - {%if testcases.id|stringformat:"i" == answers.0.answer|safe %} - <li>{{ testcases.options.strip|safe }}</li> - {% endif %} - {% endfor %} - </div> - {% elif question.type == "arrange"%} - <div class="well well-sm"> - {% get_answer_for_arrange_options answers.0.answer question as tc_list %} - {% for testcases in tc_list %} - <li>{{ testcases.options.strip|safe }}</li> - {% endfor %} - </div> - {% elif question.type == "upload" and has_user_assignment %} - <a href="{{URL_ROOT}}/exam/download/user_assignment/{{question.id}}/{{data.user.id}}/{{paper.question_paper.quiz.id}}"> - <div class="well well-sm"> - <div class="panel"> - Assignment File for {{ data.user.get_full_name.title }} - </div></a> + {% elif question.type == "arrange" %} + <h5> + <span class="badge badge-pill badge-primary"> + Correct Order:</span> + </h5> + <div class="list-group" > + {% for testcase in question.get_test_cases %} + <li class="list-group-item"> + <strong>{{ testcase.options }}</strong> + </li> + {% endfor %} + </div> + {% else %} + <h5> + <span class="badge badge-pill badge-primary">Test cases: + </span> + </h5> + {% for testcase in question.get_test_cases %} + <strong> + {{ forloop.counter }}. {{ testcase }} + </strong> + <br> + {% endfor %} + {% endif %} + <br> + <h5> + <span class="badge badge-pill badge-primary">Student answer(s): + </span> + </h5> + {% if question.type == "upload" %} + {% if has_user_assignments %} + <a href="{% url 'yaksh:download_user_assignment' question.id data.user.id paper.question_paper.quiz.id course_id %}"> + <div class="btn btn-outline-info text-center"> + Assignment File for {{ data.user.get_full_name.title }} + </div> + </a> + {% else %} + <center> + <div class="alert alert-warning"> + <h5> + Assignment not submitted by {{ data.user.get_full_name.title }} + </h5> + </div> + </center> + {% endif %} <!-- End has_user_assignments --> + {% else %} + {% for ans in answers %} + <strong> + Attempt Number: {{forloop.counter}} + </strong> + <div id="accordian"> + <div class="card"> + {% if ans.answer.correct %} + <div class="card-header"> + <span class="badge badge-success"> + Correct answer: + </span> + <a class="card-link" data-toggle="collapse" href="#submitted_{{ans.answer.id}}"> + <span class="pull-right"> + Details <i class="fa fa-toggle-down"></i> + </span> + </a> + </div> + {% else %} + <div class="card-header"> + <span class="badge badge-danger"> + Error: + </span> + <a class="card-link" data-toggle="collapse" href="#submitted_{{ans.answer.id}}"> + <span class="pull-right"> + Details <i class="fa fa-toggle-down"></i> + </span> + </a> + </div> + {% endif %} + <div class="collapse hide" id="submitted_{{ans.answer.id}}" data-parent="#accordion"> + <div class="card-body"> + {% with ans.error_list as err %} + {% for error in err %} + {% if error.type == 'stdio' %} + {% if error.given_input %} + <table class="table table-bordered table-responsive-sm"> + <tr class="table-active"> + <td> For given Input value(s):</td> + <td>{{error.given_input}}</td> + </tr> + </table> + {% endif %} + <table id="course-detail" class="table table-bordered table-responsive-sm" width="100%" id="output"> + <tr> + <th><center>Line No.</center></th> + <th><center>Expected Output</center></th> + <th><center>User output</center></th> + <th><center>Status</center></th> + </tr> + {% for expected,user in error.expected_output|zip:error.user_output %} + <td> {{forloop.counter}} </td> + <td>{{expected|default:""}} </td> + <td>{{user|default:""}}</td> + {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} + <td><span class ="fa fa-times text-warning"/></td> + {% else %} + <td><span class ="fa fa-check text-success"/></td> + {% endif %} + </tr> + {% endfor %} + </table> + <table width="100%" class="table table-bordered table-responsive-sm"> + <col width="10"> + <tr> + <td>Error:</td> + <td>{{error.error_msg}}</td> + </tr> + </table> + {% elif error.type == 'assertion' %} + {% if error.test_case %} + <strong> + We tried you code with the following test case: + </strong><br><br> + <pre><code> + <strong>{{error.test_case}}</strong> + </code></pre> + {% endif %} + <p><b>The following error took place: </b></p> + <table id="course-detail" class="table table-bordered table-responsive-sm" width="100%"> + <tr class = "active"> + <td><b>Exception Name: </b></td> + <td><span>{{error.exception}}</span></td> + </tr> + <tr> + <td><b>Exception Message: </b></td><td>{{error.message}}</td> + </tr> + <tr> + {% if error.traceback %} + <td><b>Full Traceback: </b></td> + <td><pre>{{error.traceback}}</pre></td> + {% endif %} + </tr> + </table> + {% else %} + <pre><code> {{error}} </code></pre> + {% endif %} + {% endfor %} + {% endwith %} + {% if question.type == "code" %} + {% pygmentise_user_answer question.language ans.answer.answer.strip as user_answer %} + <style type="text/css">{{user_answer.1}}</style> + <pre><code>{{user_answer.0|safe}}</code></pre> + {% elif question.type == "mcc" or question.type == "mcq" %} + {% for testcases in question.get_test_cases %} + {% if testcases.id|stringformat:"i" in ans.answer.answer.strip %} + <li>{{ testcases.options.strip|safe }}</li> + {% endif %} + {% endfor %} + {% elif question.type == "arrange"%} + {% get_answer_for_arrange_options ans.answer.answer question as tc_list %} + {% for testcases in tc_list %} + <li>{{ testcases.options.strip }}</li> + {% endfor %} + {% else %} + {{ ans.answer.answer.strip }} + {% endif %} + </div> + </div> + </div> + </div> + <br> + {% endfor %} <!-- End for ans in answers --> </div> - {% else %} - <h5><u>Student answer:</u></h5> - <div class="well well-sm"> - {{ answers.0.answer|safe }} - </div> - {% endif %} - </div> - </div> - {% else %} - <h5>Student answer: </h5> - {% for answer in answers %} - {% if not answer.skipped %} - {% if answer.answer.correct %} - <div class="panel panel-success"> - <div class="panel-heading"> - <strong>Correct Answer</strong> - </div> - {% else %} - <div class="panel panel-danger"> - <div class="panel-heading"> - <strong>Incorrect Answer</strong> - </div> - {% endif %} - - {% with answer.error_list as err %} - {% for error in err %} - - {% if error.type == 'stdio' %} - <div class = "well well-sm"> - {% if error.given_input %} - <table class="table table-bordered"> - <col width="30%"> - <tr class = "active"> - <td> For given Input value(s):</td> - <td>{{error.given_input}}</td> - </tr> - </table> - {% endif %} - <table class="table table-bordered" width="100%" id="output" style="table-layout: fixed"> - <col width="10%"> - <col width="40%"> - <col width="40%"> - <col width="10%"> - <tr class="info"> - <th><center>Line No.</center></th> - <th><center>Expected Output</center></th> - <th><center>User output</center></th> - <th><center>Status</center></th> - </tr> - {% for expected,user in error.expected_output|zip:error.user_output %} - <td> {{forloop.counter}} </td> - <td>{{expected|default:""}} </td> - <td>{{user|default:""}}</td> - {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} - <td><span class ="glyphicon glyphicon-remove text-warning"/></td> - {% else %} - <td><span class ="glyphicon glyphicon-ok text-success"/></td> - {% endif %} - </tr> - {% endfor %} - </table> - <table width="100%" class='table table-bordered'> - <col width="10"> - <tr class = "danger"> - <td><b>Error:</b></td> - <td>{{error.error_msg}}</td> - </tr> - </table> + </div> + {% endif %} + <br> + <div class="form-group"> + <div class="col-md-2"> + <label class="col-form-label" for="q{{ question.id }}">Marks:</label> + {% with answers|last as answer %} + <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answer.answer.marks }}" readonly=""><br><br> + {% endwith %} + </div> + </div> + <hr/> + {% endfor %} {# for question, answers ... #} + <div class="form-group"> + <h3>Teacher comments: </h3> + <textarea id="comments_{{paper.question_paper.id}}" class="form-control" + name="comments_{{ paper.question_paper.id }}" readonly="">{{ paper.comments }}</textarea> + </div> + </div> </div> - {% elif error.type == 'assertion' %} - {% if error.test_case %} - <strong> We tried you code with the following test case:</strong><br/></br> - <pre><code><strong style="color:#d9534f">{{error.test_case}}</strong></code></pre> - {% endif %} - <p> <b>The following error took place: </b></p> - <div class="well well-sm"> - <table class="table table-bordered" width="100%" style="table-layout: fixed"> - <col width="30%"> - <tr class = "active"> - <td><b>Exception Name: </b></td> - <td><span style="color: #d9534f">{{error.exception}}</span></td> - </tr> - <tr> - <td><b>Exception Message: </b></td><td>{{error.message}}</td> - </tr> - <tr> - {% if error.traceback %} - <td><b>Full Traceback: </b></td> - <td><pre>{{error.traceback}}</pre></td> - {% endif %} - </tr> - </table> - </div> <!-- Closes well --> - {% else %} - <pre><code> {{error|safe}} </code></pre> - {% endif %} - {% endfor %} - {% endwith %} - <div class="panel-body"> - <pre><code>{{ answer.answer.answer.strip }}</code></pre> - </div> - </div> - {% endif %} - {% endfor %} - {% endif %} - {% with answers|last as answer %} - <p><em><mark>Obtained Marks: {{answer.answer.marks}}</mark></em> </p> - {% endwith %} - <hr> - {% endfor %} {# for question, answers ... #} - <h3>Teacher comments: </h3> - {{ paper.comments|default:"None" }} - <hr><hr> - {% endif %} {# if paper.answers.count #} - + {% else %} + <div class="alert alert-warning"> + No submissions found + </div> + {% endif %} {# if paper.answers.count #} + <hr> {% endfor %} {# for paper in data.papers #} - -{% endif %} {# if not data.papers #} + {% else %} + <br> + <center> + <div class="alert alert-warning"> + {% if quiz.is_exercise %} + You have not attempted the Exercise {{ quiz.description }} + {% else %} + You have not attempted the quiz {{ quiz.description }} + {% endif %} + </div> + </center> + {% endif %} {# if data.papers #} +</div> {% endblock %} diff --git a/yaksh/templates/yaksh/view_profile.html b/yaksh/templates/yaksh/view_profile.html index ce95226..d04c972 100644 --- a/yaksh/templates/yaksh/view_profile.html +++ b/yaksh/templates/yaksh/view_profile.html @@ -2,7 +2,9 @@ {% block pagetitle %} Profile {% endblock %} {% block main %} - <table class="table table-bordered"> +<div class=" row justify-content-center"> +<div class="yakshwell col-md-8 "> + <table class="table table-bordered table-responsive-sm"> <tr> <th><label for="id_first_name"><h5>First name:</h5></label></th> <th><label for="id_first_name"><h5>{{ user.first_name }}</h5></label></th> @@ -37,4 +39,6 @@ </tr> </table> <a class="btn btn-primary pull-right" href="{{ URL_ROOT }}/exam/editprofile/">Edit Profile</a> +</div> +</div> {% endblock %} |