]> git.parisson.com Git - teleforma.git/commitdiff
add script list to professor
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 14 Jul 2015 10:01:08 +0000 (12:01 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 14 Jul 2015 10:01:08 +0000 (12:01 +0200)
teleforma/exam/templates/exam/inc/script_list.html
teleforma/exam/templates/exam/scores.html
teleforma/exam/views.py
teleforma/templatetags/teleforma_tags.py
teleforma/views/crfpa.py

index 622533c370a1798cf123a66e2d84ee3493264207..d38928774abf23c70df15ff82f763e4e9a88961f 100644 (file)
@@ -3,7 +3,7 @@
 {% load teleforma_tags %}
 {% load pagination_tags %}
 
-{% autopaginate object_list 8 %}
+{% autopaginate object_list 15 %}
 {% paginate %}
 
 <div id="users">
index d90fb0e189cb61c2210f3fdcd460b7e415ea1e01..8040a3b079b457743fe3970ae8fb73a00b674c02 100644 (file)
@@ -42,6 +42,6 @@
 </div>
 <br />
 
-{% include_container data.chartcontainer 600 '100%' %}
+{% include_container data.chartcontainer 500 '100%' %}
 
 {% endblock answers %}
index ffe322a99a3307d1ee16a51d46015ab83ef55979..2d81687c047cef75e5183d51de6818dca92b7acb 100644 (file)
@@ -40,7 +40,7 @@ class ScriptView(CourseAccessMixin, UpdateView):
         access = self.request.user == script.author or \
                     self.request.user == script.corrector or \
                     self.request.user.is_superuser or \
-                     self.request.user.is_staff
+                     self.request.user.is_staff or self.request.user.professor.all()
 
         if not access:
             context['access_error'] = access_error
@@ -99,11 +99,20 @@ class ScriptsTreatedView(ScriptsView):
 
     def get_queryset(self):
         user = self.request.user
+        professor = user.professor.all()
         period = Period.objects.get(id=self.kwargs['period_id'])
-        if user.professor.all():
-            Q1 = Q(status=4, period=period)
-            Q2 = Q(status=5, period=period)
-            scripts = Script.objects.filter(Q1 | Q2)
+        if professor:
+            professor = professor[0]
+            i = 0
+            for course in professor.courses.all():
+                Q1 = Q(status=4, period=period, course=course)
+                Q2 = Q(status=5, period=period, course=course)
+                if i == 0:
+                    QT = Q1 | Q2
+                else:
+                    QT = QT | Q1 | Q2
+                i += 1
+            scripts = Script.objects.filter(QT)
         else:
             Q1 = Q(status=4, author=user, period=period)
             Q2 = Q(status=5, author=user, period=period)
index 24f0253a0a0c9f39db3c1a93c2349d7468e74b4c..b73c020c95fe938165ab2b942f6daf0210143180 100644 (file)
@@ -237,7 +237,7 @@ def get_training_profile(user):
     if student:
         student = student[0]
         if student.platform_only:
-            text += '(I)'
+            text += 'Internaute - '
         for training in student.trainings.all():
-            text += ' - ' + unicode(training)
+            text += unicode(training) + ' '
     return text
index bb6824cdf32a6678481bcb048e42ba5f72e205ba..ac8b952784960a057f69fdde6f3d2807a76d58c6 100644 (file)
@@ -237,13 +237,15 @@ class UserXLSBook(object):
             row.write(8, get_course_code(student.oral_2))
 
             profile = Profile.objects.filter(user=user)
+            student = Student.objects.get(user=user)
             if profile:
                 profile = Profile.objects.get(user=user)
                 row.write(10, profile.address)
                 row.write(11, profile.postal_code)
                 row.write(12, profile.city)
                 row.write(13, profile.telephone)
-                row.write(14, user.date_joined.strftime("%d/%m/%Y"))
+                if student.date_subscribed:
+                    row.write(14, student.date_subscribed.strftime("%d/%m/%Y"))
 
             row.write(15, student.total_payments)
             row.write(16, student.total_fees)