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 | 119 | </div> |
120 | 120 | </div> |
121 | 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 | 126 | {# mostra a lista de usuários caso seja um professor ou admin #} |
124 | 127 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} |
125 | 128 | {% for user in users %} | ... | ... |
courses/views.py
... | ... | @@ -623,7 +623,7 @@ class TopicsView(LoginRequiredMixin, LogMixin, generic.ListView): |
623 | 623 | students_activit = User.objects.filter(activities__in = Activity.objects.all()) |
624 | 624 | materials = Material.objects.filter(topic = topic) |
625 | 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 | 627 | context['users'] = users |
628 | 628 | elif has_role(self.request.user, 'student'): |
629 | 629 | exercises = Exercise.objects.all().filter(students=self.request.user) | ... | ... |