]> git.parisson.com Git - teleforma.git/commitdiff
Fix missing quota view
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 15 Jan 2024 15:41:17 +0000 (16:41 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 15 Jan 2024 15:41:17 +0000 (16:41 +0100)
teleforma/exam/templates/exam/quotas.html
teleforma/exam/urls.py
teleforma/forms.py

index dedc3e163a67f2f9cf17ff0109b381a268b6d81f..46f740e7137e6ab95ae6cd0af86dbb63367b4c1b 100644 (file)
 </div>
 <br />
 
+<form method="GET">
+  <label for="corrector_select">{% trans "Corrector"%}</label>
+  <select name="corrector" id="corrector_select">
+      <option value="">---</option>
+      {% for corrector in correctors_list %}
+      <option value="{{corrector.0}}" {% if corrector.0 == corrector_selected %}selected="selected"{% endif %}>{{corrector.1}}</option>
+      {% endfor %}
+  </select>
+  <label for="course_select">{% trans "Course"%}</label>
+  <select name="course" id="course_select">
+      <option value="">---</option>
+      {% for course in courses_list %}
+      <option value="{{course.0}}" {% if course.0 == course_selected %}selected="selected"{% endif %}>{{course.1}}</option>
+      {% endfor %}
+  </select>
+  <label for="session_select">{% trans "Session"%}</label>
+  <select name="session" id="session_select">
+      <option value="">---</option>
+      {% for session in sessions_list %}
+      <option value="{{session.0}}" {% if session.0 == session_selected %}selected="selected"{% endif %}>{{session.1}}</option>
+      {% endfor %}
+  </select>
+  <input type="submit" value="Filtrer"/>
+</form>
+
 <div id="users">
   <table class="listing" width="100%">
    <thead>
    <tr>
     <th>{% trans "Corrector"%}</th>
+    <th>{% trans "Period"%}</th>
     <th>{% trans "Course"%}</th>
+    <th>{% trans "Session"%}</th>
     <th>{% trans "date start"%}</th>
     <th>{% trans "date end"%}</th>
     <th>{% trans "Pending"%}</th>
     <th>{% trans "Marked"%}</th>
     <th>{% trans "Value"%}</th>
-    <th>{% trans "Level"%} (%)</th>
+    <th>{% trans "Level"%}</th>
     </tr>
     </thead>
     <tbody id="spacing" class="script-list">
     {% for quota in object_list %}
     <tr>
      <td><a href="{% url 'teleforma-profile-detail' quota.corrector.username %}">{{ quota.corrector.username }}</a></td>
+     <td>{{ quota.period.name   }}</td>
      <td>{{ quota.course.title }}</td>
+     <td>{{ quota.session }}</td>
      <td>{{ quota.date_start }}</td>
      <td>{{ quota.date_end }}</td>
      <td>{{ quota.pending_script_count }}</td>
      <td>{{ quota.marked_script_count }}</td>
      <td>{{ quota.value }}</td>
-     <td>{{ quota.level|floatformat }}</td>
+     <td {% if quota.level > 100 %}style="color:#FF5050"{% endif %}>{{ quota.level|floatformat }}%</td>
     </tr>
     {% endfor %}
     </tbody>
index d8977f19cf639c0a5fb27a56eeddf9908b448161..64015b4f9561195acfaa0f9dd8c62d54319643f0 100644 (file)
@@ -32,7 +32,7 @@
 #
 # Authors: Guillaume Pellerin <yomguy@parisson.com>
 
-from teleforma.exam.views import MassScoreCreateView, ScoreCreateView, ScriptCreateView, ScriptView, ScriptsPendingView, ScriptsRejectedView, ScriptsScoreAllView, ScriptsScoreCourseView, ScriptsTreatedView, ScriptsView, get_correctors, get_mass_students
+from teleforma.exam.views import MassScoreCreateView, ScoreCreateView, ScriptCreateView, ScriptView, ScriptsPendingView, ScriptsRejectedView, ScriptsScoreAllView, ScriptsScoreCourseView, ScriptsTreatedView, ScriptsView, QuotasView, get_correctors, get_mass_students
 from django.conf.urls import url
 
 
@@ -51,4 +51,10 @@ urlpatterns = [
 
     url(r'^scripts/get-correctors/$', get_correctors, name="teleforma-exam-get-correctors"),
     url(r'^scripts/get-mass-students/$', get_mass_students, name="teleforma-exam-get-mass-students"),
+
+    
+    url(r'^quotas/periods/(?P<period_id>.*)/list/$',
+        QuotasView.as_view(),
+        name="teleforma-exam-quotas"),
+
 ]
index 7cb8535ff32b26b7c6047025f7ba3b67f525a712..7923269fa3770a58094baacec7c809fd5ecbc8ae 100644 (file)
@@ -286,7 +286,6 @@ else:
                             payment_schedule=data.get('payment_schedule'),
                             subscription_fees=subscription_fees
                             )
-            import pdb;pdb.set_trace()
             student.save()
             student.courses.add(data.get('courses'))
             for course in Course.objects.filter(id__in=settings.TELEFORMA_REGISTER_COURSE_AUTOREGISTER):