From ebbb1b4d3dcec668b901200de7b31253162da80c Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 24 Jan 2020 09:40:17 +0530 Subject: Change in views, forms and templates - Add django messages for showing success, warning messages - Add pagination in monitor and grade user - Remove unnecessary template blocks - Show add and view options for quizzes, lessons, modules - Add form-control bootstrap class for multiple forms - Fix the UI in grade user and monitor pages - Add font awesome icons in the login page --- yaksh/forms.py | 7 + yaksh/static/yaksh/css/custom.css | 8 +- yaksh/static/yaksh/js/course.js | 2 +- yaksh/templates/yaksh/add_exercise.html | 125 ++-- yaksh/templates/yaksh/add_module.html | 2 +- yaksh/templates/yaksh/add_quiz.html | 26 +- yaksh/templates/yaksh/course_detail.html | 6 - yaksh/templates/yaksh/courses.html | 10 +- yaksh/templates/yaksh/design_questionpaper.html | 2 +- yaksh/templates/yaksh/grade_user.html | 804 +++++++++++++----------- yaksh/templates/yaksh/lessons.html | 90 +++ yaksh/templates/yaksh/login.html | 6 +- yaksh/templates/yaksh/moderator_dashboard.html | 5 - yaksh/templates/yaksh/modules.html | 117 ++++ yaksh/templates/yaksh/monitor.html | 346 +++++----- yaksh/templates/yaksh/quizzes.html | 126 ++++ yaksh/templates/yaksh/statistics_question.html | 41 +- yaksh/templates/yaksh/user_data.html | 596 ++++++++++-------- yaksh/urls.py | 2 +- yaksh/views.py | 65 +- 20 files changed, 1484 insertions(+), 902 deletions(-) create mode 100644 yaksh/templates/yaksh/lessons.html create mode 100644 yaksh/templates/yaksh/modules.html create mode 100644 yaksh/templates/yaksh/quizzes.html (limited to 'yaksh') diff --git a/yaksh/forms.py b/yaksh/forms.py index 5a3925e..414bff5 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -216,6 +216,13 @@ class UserLoginForm(forms.Form): class ExerciseForm(forms.ModelForm): + + def __init__(self, *args, **kwargs): + super(ExerciseForm, self).__init__(*args, **kwargs) + self.fields['description'].widget.attrs.update( + {'class': form_input_class, 'placeholder':"Exercise Description"} + ) + class Meta: model = Quiz fields = ['description', 'view_answerpaper', 'active'] diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css index 2f62a26..8623bfb 100644 --- a/yaksh/static/yaksh/css/custom.css +++ b/yaksh/static/yaksh/css/custom.css @@ -15,11 +15,15 @@ body, .dropdown-menu { display: flex; } -.course-detail { +.course-detail, #result-table { table-layout: fixed; width: 100%; } -.course-detail > th, td { +.course-detail, #result-table > th, td { word-wrap: break-word; +} + +#rendered_text{ + width: 550px; } \ No newline at end of file diff --git a/yaksh/static/yaksh/js/course.js b/yaksh/static/yaksh/js/course.js index 29d2d9a..7b3c5d9 100644 --- a/yaksh/static/yaksh/js/course.js +++ b/yaksh/static/yaksh/js/course.js @@ -125,7 +125,7 @@ $(document).ready(function(){ $('[data-toggle="tab"]').tooltip({ trigger: 'hover', placement: 'top', - animate: true, + animate: false, container: 'body' }); }); // end document ready 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 %} - - + + {% endblock %} {% block onload %} window.onload="javascript:test();" {% endblock %} {% block content %} -