diff options
author | Palaparthy Adityachandra | 2021-02-08 09:37:18 +0530 |
---|---|---|
committer | GitHub | 2021-02-08 09:37:18 +0530 |
commit | 1206e886588b3d7e8dfe5fb88a6891e85c5b73ee (patch) | |
tree | da2620ee519b68cfad42b2169b2a79cbccd3734d /yaksh/templates | |
parent | 7448e1fa32f4e5af14a3af6b9196d6e1983edf55 (diff) | |
parent | fca319fefcd2a0e476415968b18873b0c791a5fe (diff) | |
download | online_test-1206e886588b3d7e8dfe5fb88a6891e85c5b73ee.tar.gz online_test-1206e886588b3d7e8dfe5fb88a6891e85c5b73ee.tar.bz2 online_test-1206e886588b3d7e8dfe5fb88a6891e85c5b73ee.zip |
Merge pull request #814 from adityacp/code_refactors
Code Refactor
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/add_course.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/courses.html | 460 | ||||
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/monitor.html | 104 | ||||
-rw-r--r-- | yaksh/templates/yaksh/post_comments.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 32 | ||||
-rw-r--r-- | yaksh/templates/yaksh/quizzes_user.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_lesson_quiz.html | 28 | ||||
-rw-r--r-- | yaksh/templates/yaksh/showquestions.html | 133 | ||||
-rw-r--r-- | yaksh/templates/yaksh/statistics_question.html | 123 |
10 files changed, 431 insertions, 465 deletions
diff --git a/yaksh/templates/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html index b264c5e..1afa34b 100644 --- a/yaksh/templates/yaksh/add_course.html +++ b/yaksh/templates/yaksh/add_course.html @@ -14,7 +14,7 @@ {% block title %} Add Course {% endblock %} {% block pagetitle %} Add Course {% endblock %} {% block content %} -<div class="container"> +<div class="container-fluid"> <div class="row"> <div class="col-md-8"> <ul class="nav nav-pills" id="course_tabs"> @@ -37,6 +37,7 @@ </div> </div> <hr> + <div class="container"> <form name=frm id=frm action="" method="post" > {% csrf_token %} <center> @@ -60,5 +61,6 @@ </center> <br> </form> + </div> </div> {% endblock %} diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html index 38c106c..02cbad9 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -10,127 +10,218 @@ {% block content %} <div class="container-fluid"> - <div class="container"> - <div class="row"> - <div class="col-md-8"> - <ul class="nav nav-pills" id="course_tabs"> - <li class="nav-item"> - <a class="nav-link {% if created %}active{% endif %}" href="{% url 'yaksh:courses' %}"> - My Courses - </a> - </li> - <li class="nav-item"> - <a class="nav-link" href="{% url 'yaksh:add_course' %}"> - Add/Edit Course - </a> - </li> - <li class="nav-item"> - <a href="{% url 'grades:grading_systems'%}" class="nav-link" > - Add/View Grading Systems - </a> - </li> - </ul> - </div> + <div class="row"> + <div class="col-md-8"> + <ul class="nav nav-pills" id="course_tabs"> + <li class="nav-item"> + <a class="nav-link {% if created %}active{% endif %}" href="{% url 'yaksh:courses' %}"> + My Courses + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{% url 'yaksh:add_course' %}"> + Add/Edit Course + </a> + </li> + <li class="nav-item"> + <a href="{% url 'grades:grading_systems'%}" class="nav-link" > + Add/View Grading Systems + </a> + </li> + </ul> </div> </div> - <div class="container"> + <br> + <div> {% if not objects %} <br><br> <div class="alert alert-info"> <center> <h3> No Courses Found </h3> </center> </div> {% else %} - <hr> - <form name=frm action="" method="get"> - <div class="card"> - <div class="card-header"> - <h3>Search/Filter Courses</h3> - </div> - <div class="card-body"> - <div class="row"> - <div class="col-md-6"> - {{ form.search_tags }} + <div class="row"> + <div class="col"> + <form name=frm action="" method="get"> + <div class="card"> + <div class="card-header"> + <h3>Search/Filter Courses</h3> </div> - <div class="col-md-3"> - {{ form.search_status }} + <div class="card-body"> + <div> + {{form.search_tags}} + <br> + {{form.search_status}} + </div> + <br> + <button class="btn btn-outline-success" type="submit"> + <i class="fa fa-search"></i> Search + </button> + <a class="btn btn-outline-danger" href="{% url 'yaksh:courses' %}"> + <i class="fa fa-times"></i> Clear + </a> </div> </div> - <br> - <button class="btn btn-outline-success" type="submit"> - <i class="fa fa-search"></i> Search - </button> - <a class="btn btn-outline-danger" href="{% url 'yaksh:courses' %}"> - <i class="fa fa-times"></i> Clear - </a> - </div> + </form> </div> - </form> - <hr> - <center><h4 class="badge badge-success">{{ courses_found }} Course(s) Available</h4></center> + <div id="course-list"> + <center><h4 class="badge badge-success">{{ courses_found }} Course(s) Available</h4></center> - {% if messages %} - {% for message in messages %} - <div class="alert alert-dismissible alert-{{ message.tags }}"> - <button type="button" class="close" data-dismiss="alert"> - <i class="fa fa-close"></i> - </button> - <strong>{{ message }}</strong> - </div> - {% endfor %} - {% endif %} - {% with objects as courses %} - <div class="row"> - <div class="col-md-4"> - {% include "yaksh/paginator.html" %} - </div> - <div class="ml-auto"> - <div class="nav nav-pills" role="tablist" aria-orientation="vertical"> - <a id="listbtn" class="nav-link" data-toggle="pill" role="tab" aria-controls="show" aria-selected="true"> - <i class="fa fa-list"></i> - </a> - <a id="gridbtn" class="nav-link" data-toggle="pill" role="tab" aria-controls="updown" aria-selected="false"> - <i class="fa fa-columns"></i> - </a> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} + {% endif %} + {% with objects as courses %} + <div class="row"> + <div class="col-md-4"> + {% include "yaksh/paginator.html" %} + </div> + <div class="ml-auto"> + <div class="nav nav-pills" role="tablist" aria-orientation="vertical"> + <a id="listbtn" class="nav-link" data-toggle="pill" role="tab" aria-controls="show" aria-selected="true"> + <i class="fa fa-list"></i> + </a> + <a id="gridbtn" class="nav-link" data-toggle="pill" role="tab" aria-controls="updown" aria-selected="false"> + <i class="fa fa-columns"></i> + </a> + </div> + </div> </div> - </div> - </div> - <div class="tab-content"> - <div class="tab-pane active" id="gridview" role="tabpanel" aria-labelledby="gridbtn"> - <!-- GridView --> - <br> - <div class="row"> - <br> - {% for course in courses %} - <div class="col-md-6"> - <div class="card border-primary"> - <div class="card-header" style="height: 150px"> - {{course.name}} - <div> - {% if user.id != course.creator.id %} - <span class="badge badge-pill badge-warning"> - Allotted Course - </span> - {% else %} - <span class="badge badge-pill badge-primary"> - Created Course - </span> - {% endif %} - </div> - </div> - <div class="card-body"> - <div class="row"> - <div class="col"> - <strong>Starts On:</strong> - {{course.start_enroll_time}} + <div class="tab-content"> + <div class="tab-pane active" id="gridview" role="tabpanel" aria-labelledby="gridbtn"> + <!-- GridView --> + <br> + <div class="row"> + <br> + {% for course in courses %} + <div class="col-md-6"> + <div class="card border-primary"> + <div class="card-header" style="height: 150px"> + {{course.name}} + <div> + {% if user.id != course.creator.id %} + <span class="badge badge-pill badge-warning"> + Allotted Course + </span> + {% else %} + <span class="badge badge-pill badge-primary"> + Created Course + </span> + {% endif %} + </div> + </div> + <div class="card-body"> + <div class="row"> + <div class="col"> + <strong>Starts On:</strong> + {{course.start_enroll_time}} + <br> + <strong>Ends On:</strong> + {{course.end_enroll_time}} + </div> + </div> + <hr> + <div class="row"> + <div class="col-md-3"> + {% if course.active %} + <span class="badge badge-pill badge-success"> + Active + </span> + {% else %} + <span class="badge badge-pill badge-danger"> + Inactive + </span> + {% endif %} + </div> + <div class="col-md-4"> + <a href="{% url 'yaksh:toggle_course_status' course.id %}"> + {% if course.active %} + <i class="fa fa-toggle-on fa-2x"></i> + {% else %} + <i class="fa fa-toggle-off fa-2x"></i> + {% endif %} + </a> + </div> + </div> + <hr> + <div class="row"> + <div class="col-md-5"> + <a href="{% url 'yaksh:edit_course' course.id %}" class="btn btn-info"> + <i class="fa fa-edit"></i> + Edit + </a> + </div> + <div class="col-md-5"> + <a href="{% url 'yaksh:course_detail' course.id %}" class="btn btn-primary"> + <i class="fa fa-tasks"></i> + Manage + </a> + </div> + </div> <br> - <strong>Ends On:</strong> - {{course.end_enroll_time}} + <div class="row"> + <div class="col-md-5"> + <a href="{% url 'yaksh:duplicate_course' course.id %}" class="btn btn-secondary"> + <i class="fa fa-clone"></i> + Clone + </a> + </div> + <div class="col-md-5"> + <div class="btn-group" role="group" aria-label="Button group with nested dropdown"> + <button type="button" class="btn btn-secondary"> + <i class="fa fa-download"></i> + Download + </button> + <div class="btn-group" role="group"> + <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button> + <div class="dropdown-menu" aria-labelledby="btnGroupDrop1" style=""> + <a class="dropdown-item" href="{% url 'yaksh:download_course_csv' course.id %}"> + CSV + </a> + <a class="dropdown-item" href="{% url 'yaksh:download_course' course.id %}"> + Course + </a> + </div> + </div> + </div> + </div> + </div> </div> </div> - <hr> + <br> + </div> + {% endfor %} + <br> + </div> + </div> + <div class="tab-pane" id="listview" role="tabpanel" aria-labelledby="gridbtn"> + <!-- ListView --> + <br> + {% for course in courses %} + <div class="card"> + <div class="card-header bg-secondary"> <div class="row"> + <div class="col-md-5"> + {{course.name}} + </div> <div class="col-md-3"> + {% if user.id != course.creator.id %} + <span class="badge badge-pill badge-warning"> + Allotted Course + </span> + {% else %} + <span class="badge badge-pill badge-primary"> + Created Course + </span> + {% endif %} + </div> + <div class="col-md-2"> {% if course.active %} <span class="badge badge-pill badge-success"> Active @@ -141,7 +232,7 @@ </span> {% endif %} </div> - <div class="col-md-4"> + <div class="col-md-2"> <a href="{% url 'yaksh:toggle_course_status' course.id %}"> {% if course.active %} <i class="fa fa-toggle-on fa-2x"></i> @@ -151,157 +242,68 @@ </a> </div> </div> + </div> + <div class="card-body"> + <div class="row"> + <div class="col"> + <strong>Starts On:</strong> + {{course.start_enroll_time}} + <br> + <strong>Ends On:</strong> + {{course.end_enroll_time}} + </div> + </div> <hr> <div class="row"> - <div class="col-md-5"> + <div class="col-md-3"> <a href="{% url 'yaksh:edit_course' course.id %}" class="btn btn-info"> <i class="fa fa-edit"></i> - Edit Course + Edit </a> </div> - <div class="col-md-5"> + <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 + Manage </a> </div> - </div> - <br> - <div class="row"> - <div class="col-md-5"> + <div class="col-md-3"> <a href="{% url 'yaksh:duplicate_course' course.id %}" class="btn btn-secondary"> <i class="fa fa-clone"></i> - Clone Course + Clone </a> </div> - <div class="col-md-5"> + <div class="col-md-3"> <div class="btn-group" role="group" aria-label="Button group with nested dropdown"> - <button type="button" class="btn btn-secondary"> - <i class="fa fa-download"></i> - Download - </button> - <div class="btn-group" role="group"> - <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button> - <div class="dropdown-menu" aria-labelledby="btnGroupDrop1" style=""> - <a class="dropdown-item" href="{% url 'yaksh:download_course_csv' course.id %}"> - CSV - </a> - <a class="dropdown-item" href="{% url 'yaksh:download_course' course.id %}"> - Course - </a> - </div> - </div> + <button type="button" class="btn btn-secondary"> + <i class="fa fa-download"></i> + Download + </button> + <div class="btn-group" role="group"> + <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button> + <div class="dropdown-menu" aria-labelledby="btnGroupDrop1" style=""> + <a class="dropdown-item" href="{% url 'yaksh:download_course_csv' course.id %}"> + CSV + </a> + <a class="dropdown-item" href="{% url 'yaksh:download_course' course.id %}"> + Course + </a> + </div> + </div> </div> </div> </div> </div> </div> <br> - </div> - {% endfor %} - <br> - </div> - </div> - <div class="tab-pane" id="listview" role="tabpanel" aria-labelledby="gridbtn"> - <!-- ListView --> - <br> - {% for course in courses %} - <div class="card"> - <div class="card-header bg-secondary"> - <div class="row"> - <div class="col-md-5"> - {{course.name}} - </div> - <div class="col-md-3"> - <span class="badge badge-pill badge-info"> - {% if user.id != course.creator.id %} - Allotted Course - {% else %} - Created Course - {% endif %} - </span> - </div> - <div class="col-md-2"> - {% if course.active %} - <span class="badge badge-pill badge-success"> - Active - </span> - {% else %} - <span class="badge badge-pill badge-danger"> - Inactive - </span> - {% endif %} - </div> - <div class="col-md-2"> - <a href="{% url 'yaksh:toggle_course_status' course.id %}"> - {% if course.active %} - <i class="fa fa-toggle-on fa-2x"></i> - {% else %} - <i class="fa fa-toggle-off fa-2x"></i> - {% endif %} - </a> - </div> - </div> - </div> - <div class="card-body"> - <div class="row"> - <div class="col"> - <strong>Starts On:</strong> - {{course.start_enroll_time}} - <br> - <strong>Ends On:</strong> - {{course.end_enroll_time}} - </div> - </div> - <hr> - <div class="row"> - <div class="col-md-3"> - <a href="{% url 'yaksh:edit_course' course.id %}" class="btn btn-info"> - <i class="fa fa-edit"></i> - Edit Course - </a> - </div> - <div class="col-md-3"> - <a href="{% url 'yaksh:course_detail' course.id %}" class="btn btn-primary"> - <i class="fa fa-tasks"></i> - Manage Course - </a> - </div> - <div class="col-md-3"> - <div class="btn-group" role="group" aria-label="Button group with nested dropdown"> - <button type="button" class="btn btn-secondary"> - <i class="fa fa-download"></i> - Download - </button> - <div class="btn-group" role="group"> - <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button> - <div class="dropdown-menu" aria-labelledby="btnGroupDrop1" style=""> - <a class="dropdown-item" href="{% url 'yaksh:download_course_csv' course.id %}"> - CSV - </a> - <a class="dropdown-item" href="{% url 'yaksh:download_course' course.id %}"> - Course - </a> - </div> - </div> - </div> - </div> - <div class="col-md-3"> - <a href="{% url 'yaksh:duplicate_course' course.id %}" class="btn btn-secondary"> - <i class="fa fa-clone"></i> - Clone Course - </a> - </div> - </div> - </div> + {% endfor %} + <br> </div> - <br> - {% endfor %} - <br> + </div> + {% include "yaksh/paginator.html" %} + {% endwith %} </div> </div> - {% include "yaksh/paginator.html" %} - {% endwith %} {% endif %} </div> </div> diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 86b7c47..4e1db2b 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -2,9 +2,9 @@ {% load custom_filters %} {% load static %} -{% block title %} Grader {% endblock %} +{% block title %} Quizzes {% endblock %} -{% block pagetitle %} Grader {% endblock pagetitle %} +{% block pagetitle %} Quizzes {% endblock pagetitle %} {% block script %} <script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"> diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html index fccf201..ca5a7fc 100644 --- a/yaksh/templates/yaksh/monitor.html +++ b/yaksh/templates/yaksh/monitor.html @@ -39,9 +39,20 @@ $(document).ready(function() {% block content %} <div class="container-fluid"> + {% 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 quiz %} {% if papers %} - <div class="card"> + <div class="row"> + <div class="card col"> <div class="table-responsive"> <table id="course-detail" class="table"> <tr> @@ -52,40 +63,32 @@ $(document).ready(function() <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> - <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 %} - <br> + <div class="card col"> + <div class="table-responsive"> + <table id="course-detail" class="table"> + <tr> + <td><b>Number of papers:  </b></td> + <td>{{total_papers}}</td> + </tr> + <tr> + <td><b>Papers Completed:  </b></td> + <td> + <b>{{completed_papers}}</b> + </td> + </tr> + <tr> + <td><b>Papers in progress:  </b></td> + <td> + <b>{{ inprogress_papers }}</b> + </td> + </tr> + </table> + </div> + </div> + </div> <div class="row"> <div class="col-md-4"> <button type="button" class="btn btn-info" data-toggle="modal" data-target="#csvModal"> @@ -133,7 +136,7 @@ $(document).ready(function() </div> <br> <div class="card"> - {% if latest_attempts|length > 10 %} + {% if total_papers > 10 %} <div class="table-responsive" style="height: 800px"> {% else %} <div class="table-responsive"> @@ -145,7 +148,7 @@ $(document).ready(function() <th> Name <i class="fa fa-sort"></i> </th> <th> Roll No <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> Questions Attempted <i class="fa fa-sort"></i> </th> <th> Time Left <i class="fa fa-sort"></i> </th> <th> Status <i class="fa fa-sort"></i> </th> <th> Extend time <i class="fa fa-sort"></i> </th> @@ -153,14 +156,19 @@ $(document).ready(function() </tr> </thead> <tbody class="list"> - {% for paper in latest_attempts %} + {% for paper in papers %} <tr> <td>{{forloop.counter}}</td> - <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.profile.roll_number }} </td> + {% with paper.user as student %} + <td> <a href="{% url 'yaksh:user_data' paper.user_id paper.question_paper_id course.id %}"> + {{ student.get_full_name.title }}</a> </td> + <td> {{ student.profile.roll_number }} </td> + {% endwith %} <td> {{ paper.marks_obtained }} </td> - <td> {{ paper.answers.count }} </td> + <td> + {% get_dict_value questions_attempted paper.id as que_attempt %} + {{que_attempt}} out of {{questions_count}} + </td> <td id="time_left{{forloop.counter0}}"> {{ paper.time_left }} </td> <td> {% if paper.is_attempt_inprogress %} <span class="badge badge-warning"> Inprogress </span> @@ -202,23 +210,9 @@ $(document).ready(function() <form action="{% url 'yaksh:download_quiz_csv' course.id quiz.id %}" method="post"> {% csrf_token %} <div class="modal-body"> - <b>Uncheck unwanted columns</b> - <br> - {% for field in csv_fields %} - <div class="form-check form-check-inline"> - <label class="form-check-label"> - {% if field == 'username' or field == 'questions' %} - <input class="form-check-input" name="csv_fields" type="checkbox" value="{{ field }}" checked onclick="return false"> {{ field }} - {% else %} - <input class="form-check-input" name="csv_fields" type="checkbox" value="{{ field }}" checked> {{ field }} - {% endif %} - </label> - </div> - <br> - {% endfor %} <b>Select Attempt Number: Default latest attempt</b> <select class="form-control" name = "attempt_number"> - {%for attempt_number in attempt_numbers %} + {% for attempt_number in attempt_numbers %} {% if forloop.last %} <option value="{{ attempt_number }}" selected>{{ attempt_number }} (Latest)</option> {% else %} @@ -243,7 +237,7 @@ $(document).ready(function() <div class="col-md-12"> <div class="alert alert-warning"> <center> - <h4>No Users Found for {{ quiz.description }}</h4> + <p>No Users Found for {{ quiz.description }}</p> </center> </div> </div> diff --git a/yaksh/templates/yaksh/post_comments.html b/yaksh/templates/yaksh/post_comments.html index aadc48b..17576b8 100644 --- a/yaksh/templates/yaksh/post_comments.html +++ b/yaksh/templates/yaksh/post_comments.html @@ -25,8 +25,8 @@ </center> </div> {% endif %} - <div class="card mb-2 border-dark"> - <div class="card-header text-white bg-dark py-2 px-3"> + <div class="card mb-2"> + <div class="card-header py-2 px-3"> {{post.title}} <br> <small> diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 67bbf3f..56edcf3 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -158,28 +158,18 @@ question_type = "{{ question.type }}"; {% else %} <small class="textx text-muted"><strong>Language:</strong> <span class="badge badge-primary">{{question.language}}</span></small> {% endif %} - {% if question.type == "mcq" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">SINGLE CORRECT CHOICE</span></small> - {% elif question.type == "mcc" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">MULTIPLE CORRECT CHOICES</span></small> - {% elif question.type == "code" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">PROGRAMMING</span></small> - {% elif question.type == "upload" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">ASSIGNMENT UPLOAD</span></small> - {% elif question.type == "integer" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH INTEGER ANSWER</span></small> - {% elif question.type == "string" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH STRING ANSWER</span></small> - {% if testcase.string_check == "lower" %} - <br>(CASE INSENSITIVE) - {% else %} - <br>(CASE SENSITIVE) + <small class="text text-muted"><strong>Type:</strong> + <span class="badge badge-primary"> + {{question.get_type_display}} + {% if question.type == "string" %} + {% if testcase.string_check == "lower" %} + (CASE INSENSITIVE) + {% else %} + (CASE SENSITIVE) + {% endif %} {% endif %} - {% elif question.type == "float" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH FLOAT ANSWER</span></small> - {% elif question.type == "arrange" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">ARRANGE THE OPTIONS IN CORRECT ORDER</span></small> - {% endif %} + </span> + </small> <span class="badge badge-info pull-right"> <small><strong>Marks: {{ question.points }}</strong></small> </span> diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index b1c5e3c..3dfcbac 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -67,7 +67,7 @@ </div> <div class="col-md-2"> {% if user in course.data.requests.all %} - <span class="badge badge-warning badge-pill"> + <span class="badge badge-primary badge-pill"> Request Pending </span> {% elif user in course.data.rejected.all %} @@ -94,7 +94,7 @@ {% endif %} {% else %} <span class="badge badge-danger badge-pill"> - Enrollment Closed + No Enrollments allowed </span> {% endif %} {% else %} diff --git a/yaksh/templates/yaksh/show_lesson_quiz.html b/yaksh/templates/yaksh/show_lesson_quiz.html index 71c997d..48765bd 100644 --- a/yaksh/templates/yaksh/show_lesson_quiz.html +++ b/yaksh/templates/yaksh/show_lesson_quiz.html @@ -35,24 +35,18 @@ {% else %} <small class="textx text-muted"><strong>Language:</strong> <span class="badge badge-primary">{{question.language}}</span></small> {% endif %} - {% if question.type == "mcq" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">SINGLE CORRECT CHOICE</span></small> - {% elif question.type == "mcc" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">MULTIPLE CORRECT CHOICES</span></small> - {% elif question.type == "integer" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH INTEGER ANSWER</span></small> - {% elif question.type == "string" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH STRING ANSWER</span></small> - {% if testcase.string_check == "lower" %} - <br>(CASE INSENSITIVE) - {% else %} - <br>(CASE SENSITIVE) + <small class="text text-muted"><strong>Type:</strong> + <span class="badge badge-primary"> + {{question.get_type_display}} + {% if question.type == "string" %} + {% if testcase.string_check == "lower" %} + (CASE INSENSITIVE) + {% else %} + (CASE SENSITIVE) + {% endif %} {% endif %} - {% elif question.type == "float" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH FLOAT ANSWER</span></small> - {% elif question.type == "arrange" %} - <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">ARRANGE THE OPTIONS IN CORRECT ORDER</span></small> - {% endif %} + </span> + </small> <span class="badge badge-info pull-right"> <small><strong>Points: {{ question.points }}</strong></small> </span> diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html index 81bf01a..aefb3a6 100644 --- a/yaksh/templates/yaksh/showquestions.html +++ b/yaksh/templates/yaksh/showquestions.html @@ -78,74 +78,73 @@ </div> {% endfor %} {% endif %} - <div class="card"> - <div class="card-body"> - <!-- Filter Questions --> - <h4>Filters Questions: </h4> - <form method="GET" action="{% url 'yaksh:questions_filter' %}"> - - <div class="row"> - <div class="col-md-4">{{ form.question_type }}</div> - <div class="col-md-4">{{ form.language }}</div> - <div class="col-md-4">{{ form.marks }}</div> - <br><br> - <div class="col"> - <button class="btn btn-outline-success"> - <i class="fa fa-filter"></i> Filter + <div class="row"> + <div class="col"> + <div class="card"> + <div class="card-body"> + <!-- Filter Questions --> + <h4>Filters Questions: </h4> + <form method="GET" action="{% url 'yaksh:questions_filter' %}"> + {{form.as_table}} + <br><br> + <button class="btn btn-outline-success"> + <i class="fa fa-filter"></i> Filter + </button> + </form> + <!-- End Filter Questions --> + <hr> + <h4>OR</h4> + <!-- Search by Tags --> + <h4>Search using Tags: </h4> + <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> + <br> + <form method="GET" action="{% url 'yaksh:search_questions_by_tags' %}"> + <div class="input-group"> + <input type="text" name="question_tags" id="question_tags" class="form-control" type="search" placeholder="Search questions using comma separated Tags"> + <span class="input-group-append"> + <button class="btn btn-outline-success" type="submit"> + <i class="fa fa-search"></i> </button> - </div> - </div> - </form> - <!-- End Filter Questions --> - <hr> - <!-- Search by Tags --> - <h4 >Search using Tags: </h4> - <div class="row"> - <div class="col"> - <form method="GET" action="{% url 'yaksh:search_questions_by_tags' %}"> - <div class="input-group"> - <input type="text" name="question_tags" id="question_tags" class="form-control" type="search" placeholder="Search questions using comma separated Tags"> - <span class="input-group-append"> - <button class="btn btn-outline-success" type="submit"> - <i class="fa fa-search"></i> Search - </button> - </span> - </div> - </form> - </div> - <div class="col"> - <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> + </span> + </div> + </form> + <br> + <!-- End Search by Tags --> + <a class="btn btn-outline-danger" href="{% url 'yaksh:show_questions' %}"> + <i class="fa fa-times"></i> Clear + </a> </div> - <br> - <!-- End Search by Tags --> - <a class="btn btn-outline-danger" href="{% url 'yaksh:show_questions' %}"> - <i class="fa fa-times"></i> Clear - </a> + <!-- End Card body --> </div> - <!-- End Card body --> </div> + <div id="question-list"> <!-- End card filters and search --> <form name=frm action="{% url 'yaksh:show_questions' %}" method="post"> {% csrf_token %} <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 objects %} - <br><br> - {% include "yaksh/paginator.html" %} + <div class="row"> + <div class="col"> + {% include "yaksh/paginator.html" %} + </div> + <div class="col"> + <a class="btn btn-lg btn-success" href="{% url 'yaksh:add_question' %}"> + <i class="fa fa-plus-circle"></i> Add Question + </a> + </div> + </div> <br> <h5><input id="checkall" type="checkbox"> Select All </h5> <div class="card"> @@ -158,7 +157,7 @@ <thead class="thead-dark"> <tr> <th> Select </th> - <th> Sr No. </th> + <th> Sr No.</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> @@ -174,8 +173,14 @@ <td> <input type="checkbox" name="question" value="{{ question.id }}"> </td> - <td>{{forloop.counter}}</td> - <td><a href="{% url 'yaksh:add_question' question.id %}">{{question.summary|capfirst}}</a></td> + <td> + {{forloop.counter}} + </td> + <td> + <a href="{% url 'yaksh:add_question' question.id %}" class="text-white"> + {{question.summary|capfirst}} + </a> + </td> <td>{{question.language|capfirst}}</td> <td>{{question.type|capfirst}}</td> <td>{{question.points}}</td> @@ -185,9 +190,9 @@ </a> </td> <td><a href="{% url 'yaksh:download_question' question.id %}" class="btn btn-primary"> - <i class="fa fa-download"></i> Download</a></td> + <i class="fa fa-download"></i></a></td> <td><a href="{% url 'yaksh:delete_question' question.id %}" class="btn btn-danger" onclick="return confirm('Are you sure you want to delete {{question.summary|capfirst}}?')"> - <i class="fa fa-trash"></i> Delete</a></td> + <i class="fa fa-trash"></i></a></td> </tr> {% endfor %} </tbody> @@ -212,6 +217,8 @@ {% endif %} </center> </form> + </div> + </div> </div> </div> </div> diff --git a/yaksh/templates/yaksh/statistics_question.html b/yaksh/templates/yaksh/statistics_question.html index d70256b..588e131 100644 --- a/yaksh/templates/yaksh/statistics_question.html +++ b/yaksh/templates/yaksh/statistics_question.html @@ -18,10 +18,25 @@ </ul> </div> <div class="col-md-9"> + {% 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 question_stats %} <p><b>Total number of participants: {{ total }}</b></p> <table class="table table-responsive-sm"> - <tr class="bg-light yakshred"><th>Question</th><th></th><th>Type</th><th>Total</th><th>Answered Correctly</th></tr> + <tr class="bg-light"> + <th>Question</th> + <th>Type</th> + <th>Total attempts</th> + <th>Answered Correctly</th> + </tr> {% for question, data in question_stats.items %} <tr> <td style="width: 45%"> @@ -40,7 +55,7 @@ <strong> Description: </strong> - <p> + <p width="100%"> {{ question.description|safe }} </p> <strong> @@ -55,87 +70,49 @@ <p> {{ question.get_type_display }} </p> - {% if question.type in 'mcq mcc' %} - <strong> - Options: - </strong> - <p> - <ol> - {% for tc in question.testcase_set.all %} - <li> - {{ tc.mcqtestcase.options }} - {% if tc.mcqtestcase.correct %} - <span class="badge badge-primary">Correct</span> - {% endif %} - {% get_dict_value data.per_answer tc.id|stringformat:"i" as num %} - <span class="badge badge-info">Answered: {{ num }}</span> - </li> + {% if question.type in "mcq mcc" %} + {% for tc in question.get_test_cases %} + {% if tc.correct %} + <span class="badge badge-pill badge-success"> + {{forloop.counter}}. + </span> + {% else %} + <span class="badge badge-pill badge-dark"> + {{ forloop.counter }}. + </span> + {% endif %} + {{tc.options}} + {% get_percent_value data.3 tc.id total as percent %} + <div class="progress-wrapper col-md-4"> + <div class="progress-info"> + <div class="progress-percentage"> + <span> + {% if percent %} {{percent|floatformat}} {% else %} 0 {% endif %}% + </span> + </div> + </div> + <div class="progress"> + {% if percent %} + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{percent}}" + aria-valuemin="0" aria-valuemax="100" style="width:{{percent|floatformat}}%"> + </div> + {% endif %} + </div> + </div> + <br> {% endfor %} - </ol> - </p> {% endif %} </div> </div> </div> </td> - <td>{{ question.type }}</td> - <td>{{data.answered.1}}</td><td>{{ data.answered.0 }} ({% widthratio data.answered.0 data.answered.1 100 %}%)</td> - - + <td>{{ question.get_type_display }}</td> + <td>{{data.0}} out of {{total}}</td> + <td>{{ data.1 }} out of {{data.0}} ({{data.2}}%)</td> </tr> {% endfor %} </table> {% endif %} - - <!-- The Modal --> - <div class="modal" id="question_detail_modal"> - <div class="modal-dialog"> - <div class="modal-content"> - - <!-- Modal Header --> - <div class="modal-header"> - <h4 class="modal-title">Question Details</h4> - <button type="button" class="close" data-dismiss="modal">×</button> - </div> - - <!-- Modal body --> - <div class="modal-body"> - <table> - <tr> - <td>Summary</td> - <td>{{ question.summary }}</td> - </tr> - <tr> - <td>Description</td> - <td>{{ question.description }}</td> - </tr> <tr> - <td>Type</td> - <td>{{ question.type }}</td> - </tr> <tr> - <td>Points</td> - <td>{{ question.points }}</td> - </tr> - <tr> - {% for tc in question.testcase_set.all %} - tc - {% endfor %} - <br><br> - </tr> - </table> - </div> - - <!-- Modal footer --> - <div class="modal-footer"> - <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> - </div> - - </div> - </div> - </div> - - </div> - </div> - <!-- end Modal outer --> </div> </div> </div> |