Commit 209713f88c93a45a22c1ae64fd344119fd69abe4
1 parent
f2811c41
Exists in
master
and in
5 other branches
show only the students who are registed on topic
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
courses/templates/topic/index.html
@@ -119,7 +119,10 @@ | @@ -119,7 +119,10 @@ | ||
119 | </div> | 119 | </div> |
120 | </div> | 120 | </div> |
121 | </div> | 121 | </div> |
122 | - <h3>{% trans 'Exercises' %}</h3> | 122 | + <div class="col-md-6"> |
123 | + <h3>{% trans 'Students - Especific Exercises' %}</h3> | ||
124 | + <br/> | ||
125 | + </div> | ||
123 | {# mostra a lista de usuários caso seja um professor ou admin #} | 126 | {# mostra a lista de usuários caso seja um professor ou admin #} |
124 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} | 127 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} |
125 | {% for user in users %} | 128 | {% for user in users %} |
courses/views.py
@@ -623,7 +623,7 @@ class TopicsView(LoginRequiredMixin, LogMixin, generic.ListView): | @@ -623,7 +623,7 @@ class TopicsView(LoginRequiredMixin, LogMixin, generic.ListView): | ||
623 | students_activit = User.objects.filter(activities__in = Activity.objects.all()) | 623 | students_activit = User.objects.filter(activities__in = Activity.objects.all()) |
624 | materials = Material.objects.filter(topic = topic) | 624 | materials = Material.objects.filter(topic = topic) |
625 | if has_role(self.request.user, 'professor'): | 625 | if has_role(self.request.user, 'professor'): |
626 | - users = User.objects.all() | 626 | + users = User.objects.filter(subject_student__in = Subject.objects.all()) |
627 | context['users'] = users | 627 | context['users'] = users |
628 | elif has_role(self.request.user, 'student'): | 628 | elif has_role(self.request.user, 'student'): |
629 | exercises = Exercise.objects.all().filter(students=self.request.user) | 629 | exercises = Exercise.objects.all().filter(students=self.request.user) |