diff options
Diffstat (limited to 'yaksh/templates')
40 files changed, 3489 insertions, 2779 deletions
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index 5fd53a1..0cfe8a3 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/yakshcustom.css" type="text/css" /> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/animate.min.css" type="text/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/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 %} @@ -33,17 +33,16 @@ - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/popper.min.js"></script> - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/jquery-3.3.1.min.js"></script> - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/bootstrap.min.js"></script> - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/wow.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 %} - </script> </head> <body {% block onload %} {% endblock %} class="yaksh"> @@ -58,7 +57,7 @@ {% block nav %} {% endblock %} - <div class="content"> + <div class="base-content"> <div class="header"> <h3><center>{% block pagetitle %}{% endblock pagetitle %}</center></h3> </div> diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html index 1dee595..9557582 100644 --- a/yaksh/templates/manage.html +++ b/yaksh/templates/manage.html @@ -1,44 +1,50 @@ {% extends "base.html" %} +{% load static %} + {% block nav %} -<div class="container-fluid yakshnav"> -<nav class="navbar fixed-top navbar-expand-lg yakshheading yakshnav"> - <div class="container"> - <button class="navbar-toggler navbar-dark" type="button" data-toggle="collapse" data-target="#myNavbar" aria-controls="myNavbar" aria-expanded="false" aria-label="Toggle navigation"> - <span class="navbar-toggler-icon" style="color: white"></span> +<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> - <a class="navbar-brand" 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="collapse navbar-collapse" id="myNavbar"> - <ul class="nav nav-pills ml-auto"> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/questions">Questions</a></li> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/courses">Courses</a></li> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/monitor">Monitor</a></li> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/gradeuser">Grade User</a></li> - <li class="nav-item"><a class="nav-link" href="{{ url_root }}/exam/manage/grader"> Regrade </a></li> - <li class="nav-item dropdown"> - <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#"> {{user.get_full_name|title}}</a> - <div class="dropdown-menu"> - <a class="dropdown-item" href="{{ URL_ROOT }}/exam/viewprofile/"><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_ROOT}}/exam/toggle_moderator/"><i class="fa fa-exchange"></i> - Switch To Student + + <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_ROOT }}/exam/reset/changepassword/"><i class="fa fa-key"></i> Change Password</a> - <div class="dropdown-divider"></div> - <a class="dropdown-item" id="user_logout" href="{{URL_ROOT}}/exam/logout/"><i class="fa fa-sign-out"></i> Logout</a> - </div> - </li> - </ul> + {% 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> </nav> -</div> - @@ -82,23 +88,4 @@ {% endblock %} {% block footer %} - <!--footer--> - <footer class="container-fluid yakshfooter text-center "> - <div class="row justify-content-center"> - <div class="col-sm-5 "> - {% if user %} - {% block info %} - <b>{{user.get_full_name|title}}</b> with Roll no. <b>{{user.profile.roll_number}}</b> is logged in as <b>{{user.username}}</b> - {% endblock %} - {% endif %} - </div> - <div class="col-sm-2"> - | - </div> - <div class="col-sm-4 text-left"> - <b>Any Queries?</b> Email : info@fossee.in - </div> - </div> - </footer> - <!--footer end--> {% endblock %} diff --git a/yaksh/templates/registration/password_change_done.html b/yaksh/templates/registration/password_change_done.html index bac19fa..34045d4 100644 --- a/yaksh/templates/registration/password_change_done.html +++ b/yaksh/templates/registration/password_change_done.html @@ -1,27 +1,31 @@ {% extends "base.html" %} +{% load static %} {% 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> +<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 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 %} -<div class="row align-items-center"> - <div class="col"> - <h3>Your password has been changed successfully.</h3> - <h4>Redirecting ...</h4> - </div> - - <div class="col"><img src="{{ URL_ROOT }}/static/yaksh/images/profile_change.gif/"></div> -</div> +<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..f286741 100644 --- a/yaksh/templates/registration/password_change_form.html +++ b/yaksh/templates/registration/password_change_form.html @@ -1,16 +1,33 @@ {% extends "base.html" %} +{% load static %} + <!DOCTYPE html> -{% block pagetitle %} Change Password {% endblock %} +{% 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> +Change Password +{% endblock %} +{% block title %} Change Password {% 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> + <table class="span1"> + {{ form }} + </table> + </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 bc9245f..ddf94a6 100644 --- a/yaksh/templates/registration/password_reset_complete.html +++ b/yaksh/templates/registration/password_reset_complete.html @@ -1,15 +1,21 @@ {% 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> +{% 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> <div class="container"> -<p>Your password has been reset. </p> -<p><a href="{{ login_url }}" class="btn btn-success">Log in</a></p> -</div> + <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 49563ac..ef2d1f2 100644 --- a/yaksh/templates/registration/password_reset_confirm.html +++ b/yaksh/templates/registration/password_reset_confirm.html @@ -1,21 +1,25 @@ {% 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> +{% 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 %} +{% block content %} +<br><br> <center><h4>Reset Password</h4> {% if validlink %} <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 btn-success" type="submit">Submit</button> + <button class= "btn btn-success btn-lg" type="submit">Submit</button> </form> {% else %} <p>This reset link is no longer valid!</p> diff --git a/yaksh/templates/registration/password_reset_done.html b/yaksh/templates/registration/password_reset_done.html index 8f259c7..94138dd 100644 --- a/yaksh/templates/registration/password_reset_done.html +++ b/yaksh/templates/registration/password_reset_done.html @@ -1,18 +1,22 @@ {% 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> +{% 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> -<h4>Password reset successful</h4> -<div class="alert alert-success animated flash col-md-8"> +<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 de05df9..acee288 100644 --- a/yaksh/templates/registration/password_reset_form.html +++ b/yaksh/templates/registration/password_reset_form.html @@ -1,21 +1,43 @@ {% 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> +{% 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> -<h4>Email will be send to the registered email address</h4> -<form action="" method="post"> - {% csrf_token %} - {{ form }} - <button class="btn btn-success" type="submit">Request</button> - <a class="btn btn-danger" href="{{URL_ROOT}}/exam/login/">Cancel</a> -</form> +<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/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html index 64cc9ff..11a6497 100644 --- a/yaksh/templates/yaksh/add_course.html +++ b/yaksh/templates/yaksh/add_course.html @@ -1,32 +1,79 @@ {% extends "manage.html" %} - -{% block subtitle %}Add Course{% endblock %} +{% load static %} {% block 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 %} -<div class="yakshwell container"> -<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> +<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" href="{% url 'yaksh:allotted_courses' %}"> + Allotted Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link active" href="{% url 'yaksh:add_course' %}"> + Add New 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 btn-success" type="submit" id="submit" name="questionpaper">Save</button> - <button class="btn btn-danger" 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 21ef6cc..c1813bf 100644 --- a/yaksh/templates/yaksh/add_exercise.html +++ b/yaksh/templates/yaksh/add_exercise.html @@ -1,54 +1,99 @@ {% extends "manage.html" %} - +{% load static %} {% block subtitle %}Add Exercise{% endblock %} {% block css %} {% endblock %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-3.3.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 %} window.onload="javascript:test();" {% endblock %} {% block content %} -<div class="yakshwell container"> -<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" type="submit" id="submit" name="save_exercise"> Save - </button> - - <button class="btn btn-danger" 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> +<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> + {% 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> - <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 87fb8d0..cbef893 100644 --- a/yaksh/templates/yaksh/add_lesson.html +++ b/yaksh/templates/yaksh/add_lesson.html @@ -1,85 +1,161 @@ {% 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="{{ URL_ROOT }}/static/yaksh/js/jquery-ui-1.12.1.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/jquery-ui-1.12.1.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="yakshwell container"> +<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 table-responsive-sm"> - {{ lesson_form.as_table }} - {{ lesson_file_form.as_table }} - </table> - </center> - <br><br> - {% if lesson_files %} - <center> - <div class="alert alert-success col-md-8 animated flash"> - <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 %} - {% else %} - - <center> - <div class="alert alert-warning col-md-8 animated flash"> - <h4 class="alert-warning">No Files added to this lesson</h4> - </div> - </center> - {% endif %} - <br><br> - <center> - <button class="btn btn-success" type="submit" id="submit" name="Save"> Save - </button> - {% if lesson_files %} - <button class="btn btn-danger" type="submit" id="submit" name="Delete"> Delete Files - </button> - {% endif %} - {% if course_id %} - <button class="btn btn-danger" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> - {% else %} - <button class="btn btn-danger" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/all_lessons/");'>Cancel</button> - {% endif %} - </form> - <button class="btn btn-outline-primary" type="button" name="button" id="preview">Preview Lesson Description - </button> - <button class="btn btn-outline-primary" type="button" name="button" id="embed"> - Embed Video link - </button> - </center> - <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 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 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> diff --git a/yaksh/templates/yaksh/add_module.html b/yaksh/templates/yaksh/add_module.html index 6b2214b..edbfaa2 100644 --- a/yaksh/templates/yaksh/add_module.html +++ b/yaksh/templates/yaksh/add_module.html @@ -1,70 +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-3.3.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="yaskhwell container"> +<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 table-responsive-sm"> - {{ module_form.as_table }} - </table> - </center> - <br><br> - <center> - <button class="btn btn-success" type="submit" id="submit" name="Save"> - Save - </button> - <button class="btn btn-outline-primary" type="button" name="button" id="preview"> - Preview Module Description - </button> - <button class="btn btn-outline-primary" type="button" name="button" id="embed"> - 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 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"> @@ -87,13 +142,13 @@ </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>Chosen Lessons and quizzes:</b></u> </p> @@ -152,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> diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html index 48d64ce..57b4d77 100644 --- a/yaksh/templates/yaksh/add_quiz.html +++ b/yaksh/templates/yaksh/add_quiz.html @@ -1,73 +1,109 @@ {% 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/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-3.3.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> + +<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> + {% endblock %} {% block onload %} onload="javascript:test();" {% endblock %} {% block content %} -<div class="yakshwell container"> -<form name=frm id=frm action="" method="post" > - {% csrf_token %} - <center> - <table class="span1 table table-responsive-sm"> - {{ form.as_table }} - </table> - <script type="text/javascript"> - $("#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 btn-success" type="submit" id="submit" name="questionpaper"> Save - </button> - - <button class="btn btn-danger" 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 %} - <center> - <a href="{{URL_ROOT}}/exam/manage/designquestionpaper/{{ quiz.id }}/{{quiz.questionpaper_set.get.id}}/{{course_id}}" class="btn btn-primary">Edit Question Paper</a> - <a href="{{URL_ROOT}}/exam/manage/preview_questionpaper/{{quiz.questionpaper_set.get.id}}" class="btn btn-primary" target="_blank"> - Preview Question Paper +<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> - <br> - <br> - <h4>You can check the quiz by attempting it in the following modes:</h4> - <button class="btn btn-outline-info" type="button" name="button" onClick='usermode("{{URL_ROOT}}/exam/manage/usermode/{{quiz.id}}/{{course_id}}/");'>User Mode</button> + {% endif %} + <br><br> + <form name=frm id=frm action="" method="post" > + {% csrf_token %} + <center> + <table class="table"> + {{ form.as_table }} + </table> + <script type="text/javascript"> + $("#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/> + <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 btn-outline-info" 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=" text-info"><i class="fa fa-info-circle"></i> 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 fa322f3..58f48d9 100644 --- a/yaksh/templates/yaksh/addteacher.html +++ b/yaksh/templates/yaksh/addteacher.html @@ -1,76 +1,86 @@ -{% extends "manage.html" %} - -{% block title %} Add teacher {% endblock title %} -{% block subtitle %} {{ course.name }} {% endblock %} - -{% block content %} -<div class="yakshwell container"> -<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 btn-info" type="submit">Search</button> - <button class="btn btn-danger" 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 table-responsive-sm"> +{% 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 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" 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 %} </div> -{% endblock %} 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 a3324a6..8c8073e 100644 --- a/yaksh/templates/yaksh/complete.html +++ b/yaksh/templates/yaksh/complete.html @@ -1,19 +1,15 @@ {% extends "base.html" %} {% block nav %} -<div class="container-fluid yakshnav"> - <nav class="navbar fixed-top navbar-expand-lg yakshheading yakshnav"> - <div class="container"> - <a class="navbar-brand"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </img> - </a> - </div><!-- /.container --> - </nav><!-- /.navbar --> -</div> +<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> + <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> + <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> + </a> +</nav> {% endblock %} {% block content %} +<br> {% if module_id and not paper.question_paper.quiz.is_trial %} <center> <div class="alert alert-info col-md-8 animated flash"> @@ -52,7 +48,12 @@ </div> </center> {% endif %} - <center class="yakshwell container-fluid"><h5 class="yakshwell"><span class="alert alert-success animated flash">{{message}}</span></h5></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 %} @@ -68,7 +69,7 @@ </a> {% endif %} {% else %} - <a href="{{URL_ROOT}}/exam/" id="home" class="btn btn-success"> Home </a> + <a href="{{URL_ROOT}}/exam/" 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 f75e362..654f373 100644 --- a/yaksh/templates/yaksh/course_detail.html +++ b/yaksh/templates/yaksh/course_detail.html @@ -1,383 +1,94 @@ {% extends "manage.html" %} +{% load static %} {% load custom_filters %} {% block title %} Course Details {% endblock title %} -<div class="text-center col-md-offset-2"> -{% 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 %} -<div class="row"> - <!-- Side bar --> - <div class="col-md-3 yakshlabel collapse" id="sidebar"> - <div class="list-group"> - {% if state == 'mail' or state == 'course_status' %} - <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/" class="list-group-item" data-parent="#sidebar"><i class="fa fa-caret-left"></i> Go to Course Details </a> - {% else %} - <a href="#student-requests" id="request" class="list-group-item" data-parent="#sidebar"> Requested Students </a> - <a href="#enrolled-students" id="enroll-students" class="list-group-item" data-parent="#sidebar"> Enrolled Students</a> - <a href="#rejected-students" id="reject-students" class="list-group-item" data-parent="#sidebar"> Rejected Students </a> - {% endif %} - <a href="{{URL_ROOT}}/exam/manage/send_mail/{{ course.id }}/" class="list-group-item" data-parent="#sidebar"> Send Mail </a> - <a href="{{URL_ROOT}}/exam/manage/course_status/{{ course.id }}/" class="list-group-item" data-parent="#sidebar"> View Course Status </a> +<hr> +<div id="dialog" title="Alert"> + <p id="error_msg"></p> +</div> +<div class="container-fluid"> + <div class="row"> + <div class="col-sm-3"> + {% include "yaksh/course_detail_options.html" %} </div> - </div> - <a href="#sidebar" data-toggle="collapse" id="sidebaricon"><i class="fa fa-navicon fa-lg"></i></a> - <!-- End of sidebar --> - <main class="col" id="sidebarbody"> - <div class="container-fluid yakshwell"> - - <form id="upload_users" action="{{ URL_ROOT }}/exam/manage/upload_users/{{course.id}}/" - method="POST" enctype="multipart/form-data" class="yakshwell"> - {% csrf_token %} - <input type="file" name="csv_file" /> - <button class="btn btn-outline-primary" type=submit> Upload Users <span class="glyphicon glyphicon-open"/></button> - </form> - <div class="card" role="alert"> - <div class="card-body"> - <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> - <div class="yakshwell"> - {% if message %} - <center> - <div class="alert alert-warning animated flash col-md-8" role="alert"> - <strong> {{ message }} </strong> - </div> - </center> - {% endif %} - {% if upload_details %} - <div class="alert alert-info" role="info"> - {% for detail in upload_details %} - <strong> {{ detail }} </strong><br> - {% endfor %} + <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 %} {% endif %} - - {% if state == 'mail' %} - <div id="enrolled-students" > - <center ><div class="yakshlabel"><h5>Send Mails to Students</h5></div></center><br> - {% if course.get_enrolled %} - <input type="checkbox" class="reject"/> <font class="text-info">Select all</font> - <div id="reject" class="yakshwell"> - <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 table-responsive-sm" 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> - {% endfor %} - </tbody> - </table> - <br> - <div class="card"> - <textarea name="subject" id="subject" placeholder="Email Subject" cols="50"></textarea> - <br><br> - <textarea name="body" id="email_body"></textarea><br> - <span class="yakshwell"> Attachments: <input type="file" name="email_attach" multiple=""></span> - <br> - </div> - <div class="text-center yakshwell"> - <button class="btn btn-success" type="submit" name='send_mail' value='send_mail' id="send_mail"> - Send Mail to Selected Students</button> - </div> - </form> - </div> - {% endif %} - </div> - {% elif state == "course_status" %} - <div class="course_data"> - - <center> - <div class="row"> - <div class="col"> - <h5>Course Status</h5> - </div> - <div class="col-md-8"> - Number Of Students: {{ student_details | length }} - </div> - <div class="col"> - <input type="hidden" id="course_name" value="{{course.name}}"> - <a href="#" class="btn btn-outline-success" id="export">Export to CSV</a> - </div> - </div> - </center> - <div class="yakshwell"> - <table class="tablesorter table table-bordered table-responsive-sm" id="course_table" data-sortlist="[0,0]"> - <thead> - <tr class="yakshlight"> - <th>Roll No.</th> - <th>Name</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> - {{ student.profile.roll_number}} - </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"> - {{ 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> - </div> - </div> + {% 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 id="students_enrollment"> - <div id="student-requests" class="card"> - <center><div class="yakshlabel card-heading">Requests</div></center><br> - <div class="card-body"> - {% 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 table-responsive-sm" 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 pull-right" type="submit" name='enroll' value='enroll'>Enroll Selected</button> <br> - </form> - </div> - {% else %} - <center> - <span class="badge badge-warning"><big> No requests yet</big></span> - </center> - {% endif %} - </div> - </div> - <br> - <div id="enrolled-students" class="card"> - <center><div class="yakshlabel card-heading">Enrolled</div></center><br> - <div class="card-body"> - {% 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 table-responsive-sm" 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 pull-right" type="submit" name='reject' value='reject'> - Reject Selected</button> <br> - </form> - </div> - {% else %} - <center> - <span class="badge badge-warning"><big> No enrolled students yet</big></span> - </center> - {% endif %} - </div> - </div> - <br> - <div id="rejected-students" class="card"> - <center><div class="yakshlabel card-heading">Rejected</div></center><br> - <div class="card-body"> - {% 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 table-responsive-sm" 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 pull-right" type="submit" name='enroll' value='enroll'> - Enroll Selected</button> <br> - </form> - </div> - {% else %} - <center> - <span class="badge badge-warning"><big> No rejected students yet</big></span> - </center> - {% endif %} - </div> - </div> + <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> - <!-- Dialog to display error message --> - <div id="dialog" title="Alert"> - <p id="error_msg"></p> - </div> </div> - </main> + </div> </div> {% endblock %} -{% block footer %} - <!--footer--> - <footer class="container-fluid yakshsidebarfooter text-center"> - <div class="row justify-content-center"> - <div class="col-sm-5 "> - {% if user %} - {% block info %} - <b>{{user.get_full_name|title}}</b> with Roll no. <b>{{user.profile.roll_number}}</b> is logged in as <b>{{user.username}}</b> - {% endblock %} - {% endif %} - </div> - <div class="col-sm-2"> - | - </div> - <div class="col-sm-4 text-left"> - <b>Any Queries?</b> Email : info@fossee.in - </div> - </div> - </footer> - <!--footer end--> -{% 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..43422ed --- /dev/null +++ b/yaksh/templates/yaksh/course_detail_options.html @@ -0,0 +1,47 @@ +<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" href="{% url 'yaksh:duplicate_course' course.id %}" data-toggle="tooltip" title="Creates copy of this course and all its contents" data-placement="top"> + Clone Course + </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_progress.html b/yaksh/templates/yaksh/course_progress.html new file mode 100644 index 0000000..800a975 --- /dev/null +++ b/yaksh/templates/yaksh/course_progress.html @@ -0,0 +1,69 @@ +<!-- Course Status --> +{% if is_progress %} +<div class="course_data"> + {% if student_details %} + <div class="text-center"> + <h3>Course Progress</h3> + <div class="col"> + Number Of Students: {{ students_no }} + </div> + </div> + {% 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%"> + <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..ae35251 --- /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> +<!-- 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> +<!-- 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 hide" 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> +<!-- 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 4e7a153..de8684f 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -1,29 +1,7 @@ {% extends "manage.html" %} {% block title %} Courses {% endblock %} {% block pagetitle %} Courses {% endblock pagetitle %} -{% block script %} -<script> - $(document).ready(function(){ - $('[data-toggle="tooltip"]').tooltip(); - $("#link_created_courses").click(function() { - if ($("#allotted_courses").is(":visible")){ - $("#allotted_courses").toggle(); - } - if (!$("#created_courses").is(":visible")){ - $("#created_courses").toggle(); - } - }); - $("#link_allotted_courses").click(function() { - if ($("#created_courses").is(":visible")){ - $("#created_courses").toggle(); - } - if (!$("#allotted_courses").is(":visible")){ - $("#allotted_courses").toggle(); - } - }); - }); -</script> -{% endblock %} + {% block css %} <style> .test + .tooltip.top > .tooltip-inner { @@ -33,482 +11,139 @@ </style> {% endblock %} {% block content %} -<div class="row"> - <!-- Side bar --> - <div class="col-md-3 yakshlabel collapse" id="sidebar"> - <div class="nav flex-column nav-pills" role="tablist" aria-orientation="vertical"> - {% if type == "courses" %} - <a href="#sidebarbody" id="link_created_courses" data-toggle="pill" class="nav-link active" role="tab" aria-controls="sidebarbody" aria-selected="true" >My Courses</a> - <a href="#sidebarbody" id="link_allotted_courses" class="nav-link" data-toggle="pill" role="tab" aria-controls="sidebarbody" aria-selected="flase" > Allotted Courses</a> - {% else %} - <a href="{{URL_ROOT}}/exam/manage/courses" class="nav-link" >View all Courses</a> - {% endif %} - <a href="{{URL_ROOT}}/exam/manage/add_course" class="nav-link" >Add New Course</a> - <a href="{{URL_ROOT}}/exam/manage/courses/all_quizzes/" class="nav-link" >Add/View Quizzes</a> - <a href="{{URL_ROOT}}/exam/manage/courses/all_lessons/" class="nav-link" >Add/View Lessons</a> - <a href="{{URL_ROOT}}/exam/manage/courses/all_learning_module" class="nav-link" >Add/View Modules</a> - <a href="{% url 'grades:grading_systems'%}" class="nav-link" > Add/View Grading Systems </a> - </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 {% if allotted %}active{% endif %}" href="{% url 'yaksh:allotted_courses' %}"> + Allotted Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add New 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> </div> - <a href="#sidebar" data-toggle="collapse" id="sidebaricon"><i class="fa fa-navicon fa-lg"></i></a> - <!-- End of side bar --> - <main class="tab-content col" id="sidebarbody"> - - <div class="tab-pane fade show active container-fluid yakshwell" role="tabpanel" aria-labelledby="sidebar-tab"> - - {% if type == "courses" %} - <div id="created_courses"> - {% if not courses %} - <center><h4> No new Courses created </h4></center> - {% else %} - <div class="col-md-offset-2 main"> - <center><h3 class="yakshlabel"> Course(s) Created</h3></center> - <div class="table-wrapper-2"> - <table id="course-details" class="table table-bordered table-responsive-sm"> - <tr class="text-center yakshred bg-light"> - <th>Courses</th> - <th>Modules</th> - </tr> - + {% if not objects %} + <center> + <h2> No Courses Found </h2> + <br> + </center> + {% else %} + <div class="container"> + <hr> + {% 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 %} + {% include "yaksh/paginator.html" %} + <div class="row"> + <br> {% 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="badge badge-success">Active</span> - {% else %} - <span class="badge badge-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 class="col-md-6"> + <div class="card border-primary"> + <div class="card-header" style="height: 150px"> + {{course.name}} </div> - </div> - </div> - {% endfor %} <!-- end for teachers --> - <button class="btn btn-danger" type="submit" data-toggle="tooltip" title="Remove Selected Teachers from this course">Remove Teachers</button> - </div> - {% else %} - <center><b>No Teacher(s) added</b></center> - {% endif %} - </form> - <br><br> - <ul> - <li> - <a href="{{URL_ROOT}}/exam/manage/courses/designcourse/{{course.id}}/" 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> - </ul> - </td> - <td> - <table id="course-details" class="table table-bordered table-responsive-sm"> - {% if course.get_learning_modules %} - <tr class="yakshlight"> - <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> + <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-6"> + {% if course.active %} + <span class="badge badge-pill badge-success"> + Active + </span> {% else %} - <a href="{{URL_ROOT}}/exam/manage/addquiz/{{unit.quiz.id}}/{{course.id}}"> - {{unit.quiz.description}}</a> + <span class="badge badge-pill badge-danger"> + Inactive + </span> {% 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 --> - {% else %} - No learning modules - {% endif %} - </table> - </td> - </tr> - {% endfor %} <!-- end for courses --> - </table> - </div> - </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> - <div class="table-wrapper-2"> - <table id="course-details" class="table table-bordered table-responsive-sm"> - <tr class="text-center yakshred bg-light"> - <th>Courses</th> - <th>Modules</th> - </tr> - - {% 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="badge badge-success">Active</span> - {% else %} - <span class="badge badge-danger">Closed</span> - {% endif %} - <br><br> - <center><b><u> Course Creator</u></b><br> - <h4>{{course.creator.get_full_name.title}}</h4> - </center><br> - <center><b><u>Teacher(s) added to {{ course }}</u></b></center> - <br> - <form action="{{URL_ROOT}}/exam/manage/remove_teachers/{{ course.id }}/" method="post"> - {% if course.get_teachers %} - <div align="left"> - {% csrf_token %} - {% for teacher in course.get_teachers %} - <div class="well"> - <div class="row"> - <div class="col-md-333" style="width: auto;"> - <input type="checkbox" name="remove" value="{{ teacher.id }}"> - {{ teacher.get_full_name }} + </div> + <div class="col-md-6"> + <a href="{{URL_ROOT}}/exam/manage/toggle_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-4"> + <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-4"> + <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-4"> + <a href="{% url 'yaksh:download_course_csv' course.id %}" class="btn btn-secondary"> + <i class="fa fa-download"></i> + Download CSV + </a> + </div> + </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> - </ul> - </td> - <td> - <table id="course-details" class="table table-bordered table-responsive-sm"> - {% if course.get_learning_modules %} - <tr class="yakshlight"> - <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 --> - {% else %} - No learning modules - {% endif %} - </table> - </td> - {% endfor %} <!-- end for courses --> - </tr> - </table> - </div> - </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> - <div class="table-wrapper-2"> - <table id="course-details" class="table table-bordered table-responsive-sm"> - <tr> - <th>Sr.No</th> - <th>Quiz</th> - <th>QuestionPaper</th> - </tr> - - {% for quiz in quizzes %} - <tr> - <td>{{forloop.counter}}</td> - <td width="30%"> - - {% 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="badge badge-success">Active</span> - {% else %} - <span class="badge badge-danger">Closed</span> - {% endif %} - - </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> - </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> - <div class="table-wrapper-2"> - <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%"> - - <a href="{{URL_ROOT}}/exam/manage/courses/edit_lesson/{{lesson.id}}/"> - {{ lesson.name }}</a> - {% if lesson.active %} - <span class="badge badge-success">Active</span> - {% else %} - <span class="badge badge-danger">Closed</span> - {% endif %} - - </td> - {% endfor %} <!-- end for lessons --> - </tr> - </table> - </div> - </div> - {% endif %} - {% endif %} - </div> - - <!-- Show all learning modules --> - <div class="col-md-offset-2 main"> - <div id="all_modules"> - {% 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 table-responsive-sm"> - <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="badge badge-success">Active</span> - {% else %} - <span class="badge badge-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> + {% endfor %} + <br> </div> + {% include "yaksh/paginator.html" %} + {% endwith %} </div> - </main> + {% endif %} </div> -{% endblock %} -{% block footer %} - <!--footer--> - <footer class="container-fluid yakshsidebarfooter text-center"> - <div class="row justify-content-center"> - <div class="col-sm-5 "> - {% if user %} - {% block info %} - <b>{{user.get_full_name|title}}</b> with Roll no. <b>{{user.profile.roll_number}}</b> is logged in as <b>{{user.username}}</b> - {% endblock %} - {% endif %} - </div> - <div class="col-sm-2"> - | - </div> - <div class="col-sm-4 text-left"> - <b>Any Queries?</b> Email : info@fossee.in - </div> - </div> - </footer> - <!--footer end--> -{% endblock %} +{% endblock %}
\ 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 a2d9b08..a15f4b1 100644 --- a/yaksh/templates/yaksh/design_course_session.html +++ b/yaksh/templates/yaksh/design_course_session.html @@ -1,30 +1,20 @@ -{% 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-3.3.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 %} -<div class="yakshwell container"> -<a href="{{URL_ROOT}}/exam/manage/courses/" class="btn btn-primary"> - Back to Courses -</a> -<br/> -<br/> -<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"> @@ -61,11 +51,12 @@ </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>Chosen Modules:</b></u></p> <div id="fixed-added"> @@ -136,8 +127,8 @@ </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="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> @@ -145,6 +136,4 @@ </div> </div> <!-- /.row --> </div> -</form> -</div> -{% 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 0ab7cc0..6e916a3 100644 --- a/yaksh/templates/yaksh/design_questionpaper.html +++ b/yaksh/templates/yaksh/design_questionpaper.html @@ -1,39 +1,36 @@ {% 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-3.3.1.min.js"></script> - <script src="{{ URL_ROOT }}/static/yaksh/js/jquery-ui.js"></script> - <script src="{{ URL_ROOT }}/static/yaksh/js/bootstrap.min.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="yakshwell container"> +<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> + <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"> @@ -55,86 +52,105 @@ select </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"> - <div class = "col-md-8"> - <h5>Please select Question type and Marks</h5> + <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.question_type }} - </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>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-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> - {% if user == question.user %} - <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}" target="_blank">{{ question.summary }}</a> - {% else %} - {{question.summary}} - {% endif %} - </span> - <span> {{ question.points }}</span> - </label> - </li> - {% endfor %} - </ul> - {% endif %} - </div> - <br /><br /> - <button id="add-fixed" name="add-fixed" class="btn small btn-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> @@ -143,7 +159,7 @@ select data-qid="{{question.id}}" value={{question.id}}> <span> {% if user == question.user %} - <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}" target="_blank">{{ question.summary }}</a> + <a href="{% url 'yaksh:add_question' question.id %}" target="_blank">{{ question.summary }}</a> {% else %} {{question.summary}} {% endif %} @@ -153,119 +169,125 @@ select </li> {% endfor %} </ul> + </div> </div> - <br /> - <button id="remove-fixed" name="remove-fixed" class="btn btn-danger 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-info" 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> - {% if user == question.user %} - <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}" target="_blank">{{ question.summary }}</a> - {% else %} - {{question.summary}} - {% endif %}</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 btn-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> - {% if user == question.user %} - <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}" target="_blank">{{ question.summary }}</a> - {% else %} - {{question.summary}} - {% endif %}</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 btn-danger 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-info" id="random-prev">< Previous</a> - </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" type="submit" name="save" id="save" value="Save question paper"> + </div> <!-- /.row --> <br> <div class="pull-left"> - <a class="btn btn-info" 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> diff --git a/yaksh/templates/yaksh/editprofile.html b/yaksh/templates/yaksh/editprofile.html index d654359..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 table-responsive-sm"> - {{ 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/grade_user.html b/yaksh/templates/yaksh/grade_user.html index b1edba5..a8472c7 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 %} -<div class="yakshwell container"> {% 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,373 +19,465 @@ $(document).ready(function() </script> {% endblock script %} -{% if course_details %} -<div class="table-wrapper-2"> - <table id="course-details" class="table table-bordered table-responsive-sm"> - <tr class="yakshlabel yakshred text-center"> - <th><i class="fa fa-book"></i> Courses</th> - <th><i class="fa fa-puzzle-piece"></i> 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> - </div> -{% 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}}/" class="btn btn-primary"> - {{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 %} -<center> - <div class="alert-warning alert animated flash"> -<h4>No Users Found for {{ quiz.description }}</h4> -</center> -{% endif %} -{% endif %} - -{% if has_quiz_assignments %} - -<a href="{{URL_ROOT}}/exam/manage/download/quiz_assignments/{{quiz_id}}/{{course_id}}" class="btn btn-outline-info"> - 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" %} {% 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 table-responsive-sm" id ='marks_table'> - <thead> - <tr class="yakshlabel text-center yakshred"> - <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> - -<div class="table-wrapper-2"> -<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 = "yakshlabel"> -<div class="card"> - <div class="card-heading alert-info" id="question_{{question.id}}"> - <strong> Details: {{forloop.counter}}. {{ question.summary }} - <span class="marks pull-right"> Mark(s): {{ question.points }} </span> - </strong> - </div> - <div class="card-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 }}</strong> - <span class="alert alert-success"> Correct </span> - {% else %} - <br/><strong> - {{ forloop.counter }}. {{ testcase.options }}</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 }}</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 }}</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 not objects %} + {% 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}}/{{course_id}}"> - <div class="btn btn-outline-info text-center"> - 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="card "> - <div class="card-heading alert-success">Correct answer</div></div> - {% else %} - <div class="card "> - <div class="card-heading alert-danger">Incorrect Answer</div></div> - {% endif %} - {% endwith %} - {% else %} - <center> - <div class="alert alert-warning animated flash"> - <h5>No Assignment submitted by {{ data.user.get_full_name.title }}</h5> - </div> - </center> + {% endif %} {% endif %} - {% else %} - {% for ans in answers %} - {% if ans.answer.correct %} - <div class="card "> - <div class="card-heading alert-success">Correct answer: - {% else %} - <div class="card "> - <div class="card-heading-heading alert-danger">Error: - {% endif %} - {% with ans.error_list as err %} - {% for error in err %} - {% if error.type == 'stdio' %} - <div class = "card"> - <div class="card-body"> - {% if error.given_input %} - <table class="table table-bordered table-responsive-sm"> - <col width="30%"> - <tr class = "table-active"> - <td> For given Input value(s):</td> - <td>{{error.given_input}}</td> - </tr> - </table> - {% endif %} - <table class="table table-bordered table-responsive-sm" 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 ="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><b>Error:</b></td> - <td>{{error.error_msg}}</td> - </tr> - </table> - </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="card"> - <div class="card-body"> - <table class="table table-bordered table-responsive-sm" 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> - </div> <!-- Closes card --> - {% else %} - <pre><code> {{error}} </code></pre> - {% endif %} - {% endfor %} - {% endwith %} - </div> - - <div class="card-body"> - {% 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"%} - <div class="card"> - <div class="card-body"> - {% for testcases in question.get_test_cases %} - {%if testcases.id|stringformat:"i" in ans.answer.answer.strip %} - <li>{{ testcases.options.strip }}</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> - </div> - {% elif question.type == "mcq"%} - <div class="card"> - <div class="card-body"> - {% for testcases in question.get_test_cases %} - {%if testcases.id|stringformat:"i" == ans.answer.answer.strip %} - <li>{{ testcases.options.strip }}</li> - {% endif %} {% endfor %} - </div> - </div> + {% endif %} - {% elif question.type == "arrange"%} + {% if data %} <div class="card"> + <div class="card-header"> + Student Details + </div> <div class="card-body"> - {% get_answer_for_arrange_options ans.answer.answer question as tc_list %} - {% for testcases in tc_list %} - <li>{{ testcases.options.strip }}</li> - {% endfor %} - </div> - </div> - - {% else %} - <div class="card"> - <div class="card-body"> - {{ ans.answer.answer.strip|safe }} + <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> - {% 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> -<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 %} + {% for paper in data.papers %} + <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> + <p><b>Start time:</b> {{ paper.start_time }}</p> + <p><b>End time:</b> {{ paper.end_time }}</p> + <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> + </div> + <div class="col-md-6"> + <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> + <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 }}</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> </div> {% endblock%} diff --git a/yaksh/templates/yaksh/lessons.html b/yaksh/templates/yaksh/lessons.html new file mode 100644 index 0000000..6bdc762 --- /dev/null +++ b/yaksh/templates/yaksh/lessons.html @@ -0,0 +1,90 @@ +{% 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 {% if allotted %}active{% endif %}" href="{% url 'yaksh:allotted_courses' %}"> + Allotted Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add New 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> +<br> +<div class="container"> + <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> + <center><h4> No new Lessons added</h4></center> + <br><br> + {% else %} + <center><h3> Lessons </h3></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 4b3b222..63a2ef2 100644 --- a/yaksh/templates/yaksh/login.html +++ b/yaksh/templates/yaksh/login.html @@ -1,138 +1,82 @@ {% extends "base.html" %} +{% load static %} - +{% block title %} Login {% endblock %} {% block nav %} -<div class="container-fluid yakshnav"> -<nav class="navbar fixed-top navbar-expand-lg yakshheading yakshnav"> - <div class="container"> - <button class="navbar-toggler navbar-dark" type="button" data-toggle="collapse" data-target="#myNavbar" aria-controls="myNavbar" aria-expanded="false" aria-label="Toggle navigation"> - <span class="navbar-toggler-icon" style="color: white"></span> - </button> - <a class="navbar-brand" 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="collapse navbar-collapse" id="myNavbar"> - <ul class="nav nav-pills ml-auto"> - <li><a href="#aboutus" class="nav-link">ABOUT US</a></li> - <li><a href="#contact" class="nav-link">CONTACT</a></li> - </ul> - </div> - </div> +<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> -</div> {% endblock %} {% block content %} - -<div class="container yakshheading yakshwell text-center wow animated fadeIn"> - - <span class="yakshred h3">2500+</span> Students in <span class="yakshred h3">350+</span> Institutions across <span class="yakshred h3">16+</span> states in India are using YAKSH - </br> -</div> <div class="container"> - <div class="row yakshlabel text-center"> - <p class="yakshred h4">Online Test Interface for conducting online programming quiz.</p> - <div class="col-md-7 text-left"> - <ul class="h5"> - </br> - <li class="wow animated fadeInRight">Define fairly complicated programming problems and have users - solve the problem. </li> - </br> - <li class="wow animated fadeInRight" data-wow-delay="0.5s">Immediate verification of code solution. </li> - </br> - <li class="wow animated fadeInRight" data-wow-delay="1s">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> - </br> - <li class="wow animated fadeInRight" data-wow-delay="1.5s">Supports simple multiple choice questions and File uploads.</li> - </br> - <li class="wow animated fadeInRight" data-wow-delay="2s">Since it runs on your Python, you could technically test any Python based library.</li> - </br> - <li class="wow animated fadeInRight" data-wow-delay="2.5s">Scales to over 500+ simultaneous users.</li> - </br> - </ul> - - </div> + <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 %} - <div class="col-md-5"> - <div class="yakshwell"> - <div class="yakshwell"> - <a href="{{URL_ROOT}}/exam/register/" class="btn btn-outline-primary col-md-11 " >New User? SIGN UP</a> + <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> - <hr> - <form action="" method="post"> - {% csrf_token %} - - <center><table class="table table-borderless yakshheading yakshgreen table-responsive-sm"> - {{ form.as_table }} - </table></center> - <div class="row justify-content-center"> - <button class="col-4 btn btn-success" type="submit">Login</button><span class="col-1"></span> - <a class="btn btn-primary col-4" href="{{URL_ROOT}}/exam/reset/forgotpassword/">Forgot Password?</a> + </div> </div> - <hr> - 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> - </div> - </br> - <div class="yakshred h4"> - Best platform you can find to learn</br> and to test your skills - </div> - </div> - - </div> - - <div> - </br></br> - <h2 class="h4 yakshred" id="aboutus">About Us</h2> - <div class="yakshwell"> - <h5><b>History</b></h5> - - <p>At FOSSEE, Nishanth had implemented a nice django based app to test for multiple-choice questions. Prabhu Ramachandran was inspired by a programming contest that he saw at PyCon APAC 2011. Chris Boesch, who administered the contest, used a nice web application Singpath that he had built on top of GAE that basically checked your Python code, live. This made it fun and interesting.</p> - <p>Prabhu wanted an implementation that was not tied to GAE and hence wrote the initial cut of what is now 'Yaksh'. The idea being that anyone can use this to test students programming skills and not have to worry about grading their answers manually and instead do so on their machines.</p> - <p>The application has since been refactored and maintained by FOSSEE Developers.</p> - - <h5><b>Contact</b></h5> - <p>For further information and support you can contact - Python Team at FOSSEE: pythonsupport@fossee.in</p> - - <h5><b>License</b></h5> - <p>This is distributed under the terms of the BSD license. Copyright information is at the bottom of this file.</p> - - <h5><b>Authors</b></h5> - <p><a href="https://github.com/FOSSEE/online_test/graphs/contributors">FOSSEE Developers</a><br> - Copyright (c) 2011-{% now "Y" %} FOSSEE</p> - </div> </div> - </div> {% endblock content %} - - -{% block footer %} - <!--footer--> - <footer class="container-fluid yakshfooter text-center" id="contact"> - {% block info %} - {% endblock %} - Developed by FOSSEE team, IIT Bombay - <hr style="background-color: white"> - <nav class="nav nav-pills nav-fill col-lg-12"> - - <li class="nav-item"> - <a class = "btn btn-social-icon btn-github nav-link" href ="https://github.com/fossee/online_test"">Fork us at: - <span class="fa fa-github" style="font-size:20px;"></span> - </a> - </li> - <li class="nav-item"><span class="nav-link"> Email : info@fossee.in</span></li> - <li class="nav-item"><a href="#" class="nav-link">FOSSEE website</a></li> - </nav> - </footer> - <!--footer end--> -{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html index 59dd123..5d0de7b 100644 --- a/yaksh/templates/yaksh/moderator_dashboard.html +++ b/yaksh/templates/yaksh/moderator_dashboard.html @@ -1,116 +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="yakshgreen">List of quizzes! Click on the given links to have a look at answer papers for a quiz.</h4></center> -<div class="row justify-content-center"> -<div class="col-md-10 "> - <div class="table-wrapper-2"> -<table class="table table-bordered table-responsive-sm"> - <tr class="yakshlabel"> - <th class="yakshred text-center"><i class="fa fa-book"></i> Courses</th> - <th class="yakshred text-center"><i class="fa fa-puzzle-piece"></i> Quizzes</th> - </tr> - {% for course in courses %} - <tr> - <td> - <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}" class="btn btn-outline-success"> - <i class="fa fa-caret-right"></i> {{ course }} - </a> - </td> - <td> - {% get_course_details course as course_details %} - {% if course_details %} - <table class="table table-bordered table-responsive-sm"> - <tr class="yakshlight"> - <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_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> -</div> - -<hr> -<center> - <a href="{{URL_ROOT}}/exam/manage/add_course" class="btn btn-primary"> - Add New Course - </a> - <a href="{{URL_ROOT}}/exam/manage/create_demo_course" class="btn btn-primary"> - Create Demo Course - </a> - <a data-toggle="collapse" data-target="#help" class="btn"> - <span class="fa fa-question-circle yakshred"></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> +<div class="container"> <center> - {% if msg %} - <h4 class="alert alert-info col-md-10 animated flash">{{ msg }}</h4> - {% endif %} + <h4> + List of quizzes! Click on the given links to have a look at answer papers for a quiz + </h4> </center> -</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 table-responsive-sm"> - <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 btn-danger" type="submit"> - Delete Selected - <span class="glyphicon glyphicon-trash"></span> -</button></center> - </form> - </div> - {% endif %} -</div> + <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-secondary"> + 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 %} + {% endwith %} </div> {% endblock %} diff --git a/yaksh/templates/yaksh/modules.html b/yaksh/templates/yaksh/modules.html new file mode 100644 index 0000000..4edbf7d --- /dev/null +++ b/yaksh/templates/yaksh/modules.html @@ -0,0 +1,117 @@ +{% 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 {% if allotted %}active{% endif %}" href="{% url 'yaksh:allotted_courses' %}"> + Allotted Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add New 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> +<br> +<div class="container"> + <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 %} + <center><h4> No new learning modules added</h4></center> + <br><br> + {% else %} + <center><h3> Learning Modules </h3></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 a9f8328..51ca73e 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 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() { @@ -29,166 +30,195 @@ $(document).ready(function() {% block content %} <div class="container"> - <div class="yakshwell"> - {# ############################################################### #} - {# This is rendered when we are just viewing exam/monitor #} - - {% if course_details %} - <div class="table-wrapper-2"> - <table id="course-details" class="table table-bordered table-responsive-sm"> - <tr class="table-info"> - <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> - </div> - {% endif %} + {# ############################################################### #} + {# 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 %} + </div> + {% include "yaksh/paginator.html" %} + {% endif %} - {# ############################################################### #} - {# This is rendered when we are just viewing exam/monitor/quiz_num #} - {% if msg != "Monitor" %} - {% if quiz %} + {# ############################################################### #} + {# This is rendered when we are just viewing exam/monitor/quiz_num #} + {% if msg != "Monitor" %} + {% if quiz %} {% if papers %} - <div class="row"> - <div class="card col-md-10"> - <div class = "table-responsive""> - <table 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 class = "yakshgreen">{{completed_papers}}</b> - </td> - </tr> - <tr> - <td><b>Papers in progress:  </b></td> - <td> - {% inprogress papers as inprogress_papers %} - <b class="yakshred"> {{ inprogress_papers }} </b> - </td> - </tr> - </table> + <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> - <div class = "row"> - <div class="col-md-2"> - <p><a href="{{URL_ROOT}}/exam/manage/statistics/question/{{papers.0.question_paper.id}}/{{course.id}}" class="btn btn-primary">Question Statisitics</a></p> - <p> - <button type="button" class="btn btn-info" data-toggle="modal" data-target="#csvModal"> - Download CSV <span class="fa fa-download"></span> - </button> - </p> + <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> - <div class="table-wrapper-2"> - <table id="result-table" class="tablesorter table table-striped table-responsive-sm"> - <thead> - <tr class="table-info"> - <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}}"><i class="fa fa-circle fa-sm"></i> {{ 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> - </tr> - {% endfor %} - </tbody> - </table> - </div> - {% else %} - <p> No answer papers found for {{ quiz.description }}</p> - {% endif %} {# if papers #} - {% else %} - <h4>No Quiz Found</h4> - {% endif %} - {% endif %} - </div> - <!-- CSV Modal --> - <div class="modal fade" id="csvModal" role="dialog"> - <div class="modal-dialog"> + </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"> - <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> - {% 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> - </div> + <!-- Modal content--> + <div class="modal-content"> + <div class="modal-header"> + <h3 class="modal-title">Uncheck unwanted columns</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"> + {% 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> + <br> + </div> + {% 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-secondary" data-dismiss="modal"> + Close + </button> + </div> + </form> + </div> + </div> + </div> + {% else %} + <p> No answer papers found for {{ quiz.description }}</p> + {% 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..5438b77 --- /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:'-3' and n < objects.number|add:'3' %} + <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/profile_updated.html b/yaksh/templates/yaksh/profile_updated.html index 2247004..557719c 100644 --- a/yaksh/templates/yaksh/profile_updated.html +++ b/yaksh/templates/yaksh/profile_updated.html @@ -1,29 +1,31 @@ {% 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> +{% 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 title %} Profile {% endblock %} {% 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 %} -<div class="yakshwell container"> - <div class="row align-items-center"> - <div class="col"> - <h3>Your Profile is changed {{ user.first_name }}</h3> - <h3>Redirecting...</h3> - </div> - - <div class="col"><img src="{{ URL_ROOT }}/static/yaksh/images/profile_change.gif/"></div> - </div> -</div> +<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/quizzes.html b/yaksh/templates/yaksh/quizzes.html new file mode 100644 index 0000000..d42716c --- /dev/null +++ b/yaksh/templates/yaksh/quizzes.html @@ -0,0 +1,126 @@ +{% 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 {% if allotted %}active{% endif %}" href="{% url 'yaksh:allotted_courses' %}"> + Allotted Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add New 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> +<br> +<div class="container"> + <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> + <center><h4> No new Quiz added</h4></center> + <br><br> + {% else %} + <center><h3> Quizzes </h3></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/register.html b/yaksh/templates/yaksh/register.html index 71fe1de..454cd5b 100644 --- a/yaksh/templates/yaksh/register.html +++ b/yaksh/templates/yaksh/register.html @@ -1,63 +1,64 @@ {% extends "base.html" %} +{% load static %} + +{% block title %} Register {% endblock %} +{% block pagetitle %} Registration {% endblock %} {% block nav %} -<div class="container-fluid yakshnav"> -<nav class="navbar fixed-top navbar-expand-lg yakshheading yakshnav"> - <div class="container"> - <button class="navbar-toggler navbar-dark" type="button" data-toggle="collapse" data-target="#myNavbar" aria-controls="myNavbar" aria-expanded="false" aria-label="Toggle navigation"> - <span class="navbar-toggler-icon" style="color: white"></span> - </button> - <a class="navbar-brand" 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="collapse navbar-collapse" id="myNavbar"> - <ul class="nav nav-pills ml-auto"> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/">LOGIN INSTEAD?</a></li> - </ul> - </div> - </div> +<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> -</div> {% endblock %} -{% block pagetitle %}<p class="yakshred"> Online Test Registration </p>{% endblock %} - {% block content %} -<div class="container-fluid row justify-content-center"> -<div class="col-md-10"> -<form action="" method="post"> - {% csrf_token %} - <h5> Please fill in the following details:</h5> - <center> - <table class="table table-responsive-sm"> - {{ form.as_table }} - </table></center> - <center class="yakshwell"><button class="btn btn-success" type="submit">Register</button> - <a href="{{URL_ROOT}}/exam" class="btn btn-danger">Cancel</a></center> -</form> -</div> +<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> -<br><br><br> {% endblock content %} - -{% block footer %} - <!--footer--> - <footer class="container-fluid yakshfooter text-center" id="contact"> - {% block info %} - {% endblock %} - Developed by FOSSEE team, IIT Bombay - <hr style="background-color: white"> - <nav class="nav nav-pills nav-fill col-lg-12"> - - <li class="nav-item"> - <a class = "btn btn-social-icon btn-github nav-link" href ="https://github.com/fossee/online_test"">Fork us at: - <span class="fa fa-github" style="font-size:20px;"></span> - </a> - </li> - <li class="nav-item"><span class="nav-link"> Email : info@fossee.in</span></li> - <li class="nav-item"><a href="#" class="nav-link">FOSSEE website</a></li> - </nav> - </footer> - <!--footer end--> -{% endblock %} diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html index e146878..afd2ad9 100644 --- a/yaksh/templates/yaksh/showquestions.html +++ b/yaksh/templates/yaksh/showquestions.html @@ -1,39 +1,38 @@ {% extends "manage.html" %} +{% load staticfiles %} {% 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"> - <!-- Side bar --> - <div class="col-md-3 yakshlabel collapse nav flex-column nav-pills" id="sidebar" 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 and Download Questions</a> - </div> - <a href="#sidebar" data-toggle="collapse" id="sidebaricon"><i class="fa fa-navicon fa-lg"></i></a> - <!-- End of side bar --> - <main class="col main" id="sidebarbody"> - - <div class="yakshwell tab-content"> - <!-- Upload Questions --> - <div id="updown" class="card col-md-12 tab-pane fade" role="tabpanel" aria-labelledby="updownbar"> - <div class="alert alert-info" role="alert"> - <p>You can upload question files the following ways - - <li><b><u>Yaml File</u></b> +<div class="container"> + <!-- Side bar --> + <div class="nav nav-pills" id="sidebar" 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 and Download 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> - </li> - <li><b><u>Zip File</u></b> - <p> One can also upload zip with the following zip structure - + </li> + <li><b><u>Zip File</u></b> + <p> One can also upload zip with the following zip structure - </p> <pre> .zip |-- .yaml or .yml @@ -43,87 +42,90 @@ |-- folder2 | |-- Files required by questions </pre> - </li> - </p> - </div> - <div class="card-body"> - <div><a class="btn btn-primary" href="{{URL_ROOT}}/exam/manage/courses/download_yaml_template/"> Download Template</a> </div> - <br/> - <h4> Or </h4> + </li> + </p> + </div> + <div class="card-body"> <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> + {% csrf_token %} + <div class="form-group col-md-6"> + <a class="btn btn-lg btn-primary" 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> + <button class="btn btn-lg btn-success" type="submit" name="upload" value="upload"><i class="fa fa-upload"></i> Upload File</button> + </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> - <!-- End of upload questions --> + </div> + <!-- End of upload questions --> - <!-- Show questions --> - <div id="show" class="yakshwell tab-pane fade show active" role="tabpanel" aria-labelledby="showbar"> - <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 animated flash"> - <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> - {{ msg }} - </div> - {% endif %} - <br><br> - <form name=frm action="" method="post"> - <div class="card"> - <div class="card-body"> + <!-- 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 %} + <form name=frm action="" method="post"> + <div class="card"> + <div class="card-body"> <!-- Filtering Questions --> - <div class="row" id="selectors"> - <h4 style="padding-left: 20px;">Filters Questions: </h4> - <div class="col-md-3"> + <div id="selectors"> + <h4>Filters Questions: </h4> + <div class="dropdown"> + <div class="col-md-4"> {{ form.question_type }} - </div> - <div class="col-md-3"> + </div> + <div class="col-md-4"> {{ form.language }} - </div> - <div class="col-md-3"> + </div> + <div class="col-md-4"> {{ form.marks }} - </div> - <br><br> - + </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"> - <button class="btn btn-outline-secondary" type="submit"><i class="fa fa-search yakshred"></i></button> - </span> - </div> + <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 class="col-md-6"> - <select class="form-control" id="sel1" onchange="append_tag(this);"> + </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 %} @@ -134,84 +136,68 @@ {% else %} <option value="" disabled selected>No Available Tags</option> {% endif %} - </select> - </div> + </select> </div> - </div> - <br><br> - <button class="btn btn-primary" type="button" onClick='location.replace("{{URL_ROOT}}");'> - Clear Filters</button> - </div> - </div> - - <div id="filtered-questions"> + </div> + </div> + <br/> + <a class="btn btn-lg btn-primary" href="{% url 'yaksh:show_questions' %}"> + Clear Filters</a> + </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 class="yakshwell"> - <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"> + <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 </th> - <th> Language </th> - <th> Type </th> - <th> Marks </th> + <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> + <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> + <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> + </table> + </div> + </div> + {% include "yaksh/paginator.html" %} {% 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> - <!-- End of Show questions --> + </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> + {% endif %} + <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> + </center> + </form> + </div> + <!-- End of Show questions --> </div> - </main> </div> {% endblock %} -{% block footer %} - <!--footer--> - <footer class="container-fluid yakshsidebarfooter text-center"> - <div class="row justify-content-center"> - <div class="col-sm-5 "> - {% if user %} - {% block info %} - <b>{{user.get_full_name|title}}</b> with Roll no. <b>{{user.profile.roll_number}}</b> is logged in as <b>{{user.username}}</b> - {% endblock %} - {% endif %} - </div> - <div class="col-sm-2"> - | - </div> - <div class="col-sm-4 text-left"> - <b>Any Queries?</b> Email : info@fossee.in - </div> - </div> - </footer> - <!--footer end--> -{% endblock %}
\ No newline at end of file diff --git a/yaksh/templates/yaksh/statistics_question.html b/yaksh/templates/yaksh/statistics_question.html index 4d737eb..58fd8db 100644 --- a/yaksh/templates/yaksh/statistics_question.html +++ b/yaksh/templates/yaksh/statistics_question.html @@ -3,24 +3,29 @@ {% block pagetitle %} Statistics for {{ quiz.description }}{% endblock pagetitle %} {% block content %} -<div class="yakshwell container"> -<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 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 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> -</div> {% endblock %} diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 687dc48..ff600c3 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -1,301 +1,361 @@ {% 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 %} -<div class="yakshwell container"> - <div class="card col-md-4"> - <p class="card-body"> - 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> - </div> - {% if data.papers %} - <p class="text-center"><a href="{{URL_ROOT}}/exam/manage/gradeuser/{{data.papers.0.question_paper.quiz.id}}/{{ data.user.id }}/{{course_id}}/" class="btn btn-info "> +{% block content %} +<div class="container"> + <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> + <p><b>Department: </b>{{ profile.department }}</p> + <p><b>Institute: </b>{{ profile.institute }}</p> + </div> + <div class="col-md-7"> + <p><b>Username:</b> {{ data.user.username }}</p> + <p><b>Email:</b> {{ data.user.email }}</p> + <p><b>Date joined:</b> {{ data.user.date_joined }}</p> + <p><b>Last login:</b> {{ data.user.last_login }}</p> + </div> + </div> + {% endif %} + {% endwith %} + </div> + </div> + <hr> + {% if data.papers %} + <p class="text-center"><a href="{% url 'yaksh:grade_user' data.papers.0.question_paper.quiz.id data.user.id course_id %}" class="btn btn-info "> 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 %} - <div class="table-wrapper-2"> - <h3> Answers </h3> - <br> - {% for question, answers in paper.get_question_answers.items %} - <div class = "yakshlabel"> - <div class="card"> - <div class="card-heading alert-info" id="question_{{question.id}}"> - <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> + </p> + {% for paper in data.papers %} + {% if forloop.counter == 2 and data.questionpaperid %} + <hr> + <u> + <h2> Previous attempts </h2> + </u> + {% endif %} + <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> + <p><b>Start time:</b> {{ paper.start_time }}</p> + <p><b>End time:</b> {{ paper.end_time }}</p> + <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> + </div> + <div class="col-md-6"> + <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> + <p> + <b>Attempt Number:</b> + <span class="badge badge-pill badge-info"> + {{paper.attempt_number}} + </span> + </p> + <p><b>User IP address:</b> {{ paper.user_ip }}</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> + {% 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" id="show_question{{question.id}}{{paper.attempt_number}}" style="display: none;"> - <h5><u>Question:</u></h5> + </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> <u>Choices:</u></h5> - {% for testcase in question.get_test_cases %} - {% if testcase.correct %} - <br/> - <strong>{{ forloop.counter }}. {{ testcase.options|safe }}</strong> - <span class="badge badge-success">Correct </span> - {% else %} - <br/><strong> - {{ forloop.counter }}. {{ testcase.options|safe }}</strong> - {% endif %} - {% endfor %} + <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> <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 %} + <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> <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> + <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> <u>Test cases: </u></h5> - {% for testcase in question.get_test_cases %} - <br/><strong>{{ forloop.counter }}. {{ testcase }}</strong> - {% endfor %} - {%endif%} - </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}}/{{course_id}}"> - <div class="btn btn-outline-info text-center"> - Assignment File for {{ data.user.get_full_name.title }} - </div> - </a> - {% with answers|last as answer%} - {% if answer.answer.correct %} - <div class="card "> - <div class="card-heading alert-success">Correct answer</div> - </div> - {% else %} - <div class="card "> - <div class="card-heading alert-danger">Incorrect Answer</div> - </div> - {% endif %} - {% endwith %} - {% else %} - <center> - <div class="alert alert-warning animated flash"> - <h5>No Assignment submitted by {{ data.user.get_full_name.title }}</h5> - </div> - </center> - {% endif %} - {% else %} - {% for ans in answers %} - {% if ans.answer.correct %} - <div class="card "> - <div class="card-heading alert-success"> - Correct answer: + <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 %} - <div class="card "> - <div class="card-heading-heading alert-danger"> - Error: + {% 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 %} - {% with ans.error_list as err %} - {% for error in err %} - {% if error.type == 'stdio' %} - <div class = "card"> - <div class="card-body"> - {% if error.given_input %} - <table class="table table-bordered table-responsive-sm"> - <col width="30%"> - <tr class = "table-active"> - <td> For given Input value(s):</td> - <td>{{error.given_input}}</td> - </tr> - </table> - {% endif %} - <table class="table table-bordered table-responsive-sm" 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 %} - <tr> + <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"></span></td> + <td><span class ="fa fa-times text-warning"/></td> {% else %} - <td><span class ="fa fa-check text-success"></span></td> + <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><b>Error:</b></td> - <td>{{error.error_msg}}</td> - </tr> - </table> - </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="card"> - <div class="card-body"> - <table class="table table-bordered table-responsive-sm" 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> - </div> - <!-- Closes card --> - {% else %} - <pre><code> {{error|safe}} </code></pre> - {% endif %} - {% endfor %} - {% endwith %} - </div> - <div class="card-body"> - {% if question.type == "code" %} - {% pygmentise_user_answer question.language answer.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"%} - <div class="card"> - <div class="card-body"> - {% 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 %} + </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 %} - </div> - </div> - {% elif question.type == "mcq"%} - <div class="card"> - <div class="card-body"> + {% 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" == ans.answer.answer.strip|safe %} - <li>{{ testcases.options.strip|safe }}</li> - {% endif %} + {% if testcases.id|stringformat:"i" in ans.answer.answer.strip %} + <li>{{ testcases.options.strip|safe }}</li> + {% endif %} {% endfor %} - </div> - </div> - {% elif question.type == "arrange"%} - <div class="card"> - <div class="card-body"> + {% 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|safe }}</li> + <li>{{ testcases.options.strip }}</li> {% endfor %} - </div> + {% else %} + {{ ans.answer.answer.strip }} + {% endif %} + </div> </div> - {% else %} - <div class="card"> - <div class="card-body"> - {{ ans.answer.answer.strip|safe }} - </div> - </div> - {% endif %} - </div> - </div> - {% endfor %} - {% endif %} + </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 %} - Marks: <input id="q{{ question.id }}" type="text" - name="q{{ question.id }}_marks" size="4" - value="{{ answer.answer.marks }}"><br><br> + <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 %} - <hr/> - </div> - - {% endfor %} {# for question, answers ... #} - </div> - - -<h3>Teacher comments: </h3> -{{ paper.comments|default:"None" }} -{% endif %} {# if paper.answers.count #} -{% endfor %} {# for paper in data.papers #} -{% endif %} {# if data.papers #} + </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> + {% endif %} {# if paper.answers.count #} + {% endfor %} {# for paper in data.papers #} + {% endif %} {# if data.papers #} </div> - -<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 %} {% endblock %}
\ No newline at end of file |