diff --git a/reports/locale/pt_BR/LC_MESSAGES/django.po b/reports/locale/pt_BR/LC_MESSAGES/django.po index 0868bf9..08ac713 100644 --- a/reports/locale/pt_BR/LC_MESSAGES/django.po +++ b/reports/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-20 18:40-0300\n" +"POT-Creation-Date: 2017-03-24 18:33-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,7 +50,7 @@ msgstr "Mural da disciplina" msgid "Messages" msgstr "Mensagens" -#: forms.py:52 +#: forms.py:52 views.py:133 views.py:200 msgid "All" msgstr "Todos" @@ -127,84 +127,88 @@ msgid "register(s)" msgstr "registro(s)" #: templates/reports/view.html:68 -msgid "Interactions Data" -msgstr "Dados de interação" +msgid "Interactions Data (.csv)" +msgstr "Dados de interação (.csv)" -#: views.py:67 +#: templates/reports/view.html:72 +msgid "Interactions Data (.xls)" +msgstr "Dados de interação (.xls)" + +#: views.py:70 msgid "Report created successfully" msgstr "Relatório criado com sucesso!" -#: views.py:169 +#: views.py:224 msgid "Number of help posts created by the user." msgstr "Número de postagens de dúvidas criadas no mural da disciplina." -#: views.py:175 +#: views.py:230 msgid "Amount of comments on help posts created by the student." msgstr "" "Número de comentários criados para as próprias postagens de dúvidas no mural " "da disciplina." -#: views.py:180 +#: views.py:235 msgid "Amount of comments made by the student on teachers help posts." msgstr "" "Número de comentários às postagens de dúvidas no mural da disciplina criadas " "pelo professor." -#: views.py:184 +#: views.py:239 msgid "Amount of comments made by the student on other students help posts." msgstr "" "Número de comentários às postagens de dúvidas no mural da disciplina criadas " "por outros estudantes." -#: views.py:195 +#: views.py:250 msgid "Number of help posts created by the user that the teacher commented on." msgstr "" "Número de comentários às postagens de dúvidas no mural da disciplina criadas " "por outros estudantes" -#: views.py:203 +#: views.py:258 msgid "Number of help posts created by the user others students commented on." msgstr "" " Número de postagens de dúvidas criadas no mural da disciplina que foram " "comentadas por outros estudantes." -#: views.py:206 +#: views.py:261 msgid "Number of student visualizations on the mural of the subject." msgstr "Número de visualizações do mural da disciplina." -#: views.py:218 +#: views.py:273 msgid "Number of access to mural between 6 a.m to 12a.m. ." msgstr "" "Número de acessos ao ambiente virtual da disciplina no horário de 06h às 12h." -#: views.py:222 +#: views.py:277 msgid "Number of access to mural between 0 p.m to 6p.m. ." msgstr "" "Número de acessos ao ambiente virtual da disciplina no horário de 12h às 18h." -#: views.py:225 +#: views.py:280 msgid "Number of access to mural between 6 p.m to 12p.m. ." msgstr "" "Número de acessos ao ambiente virtual da disciplina no horário de 18h às 24h." -#: views.py:229 +#: views.py:284 msgid "Number of access to mural between 0 a.m to 6a.m. ." msgstr "" "Número de acessos ao ambiente virtual da disciplina no horário de 24h às 06h." -#: views.py:237 views.py:240 +#: views.py:292 views.py:295 msgid "Number of access to the subject on " msgstr "Número de acessos ao assunto na(o) " -#: views.py:243 +#: views.py:298 msgid "Number of distinct days the user access the subject. " msgstr "Número de dias distintos que acessou o ambiente virtual da disciplina." -#: views.py:244 +#: views.py:299 msgid "Class" msgstr "Classe" -#: views.py:245 +#: views.py:300 msgid "Performance" msgstr "Desempenho" diff --git a/reports/templates/reports/_form.html b/reports/templates/reports/_form.html index 77974a6..e086457 100644 --- a/reports/templates/reports/_form.html +++ b/reports/templates/reports/_form.html @@ -20,16 +20,16 @@
{{form.topic.errors}} - + {% render_field form.topic class="form-control" %}
- + {% render_field form.init_date class='form-control date-picker' %}
- + {% render_field form.end_date class='form-control date-picker' %}
diff --git a/reports/views.py b/reports/views.py index 8dce2f5..2788563 100644 --- a/reports/views.py +++ b/reports/views.py @@ -129,18 +129,22 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): params_data = self.request.GET subject = Subject.objects.get(id=params_data['subject_id']) context['subject_name'] = subject.name - context['topic_name'] = params_data['topic'] + + if params_data['topic'] == _("All"): + context['topic_name'] = params_data['topic'] + else: + context['topic_name'] = Topic.objects.get(id=int(params_data['topic'])).name context['init_date'] = params_data['init_date'] context['end_date'] = params_data['end_date'] context['subject'] = subject - + #I used getlist method so it can get more than one tag and one resource class_name resources = params_data.getlist('resource') tags = params_data.getlist('tag') self.from_mural = params_data['from_mural'] - context['data'], context['header'] = self.get_mural_data(subject, context['topic_name'], params_data['init_date'], params_data['end_date'], + context['data'], context['header'] = self.get_mural_data(subject, params_data['topic'], params_data['init_date'], params_data['end_date'], resources, tags ) @@ -254,7 +258,7 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): interactions[_('Number of help posts created by the user others students commented on.')] = help_posts.filter(user=student, id__in = help_posts_ids).count() #Number of student visualizations on the mural of the subject - interactions[_('Number of student visualizations on the mural of the subject.')] = MuralVisualizations.objects.filter(post__in = SubjectPost.objects.filter(space__id=subject.id), + interactions[_('Number of student visualizations on the mural of the subject.')] = MuralVisualizations.objects.filter(post__in = SubjectPost.objects.filter(space__id=subject.id, create_date__range=(init_date, end_date)), user = student).count() @@ -285,8 +289,9 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView): day_names = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"] distinct_days = 0 for day_num in day_numbers: + #day+1 is because the days are started on 1 instead of the lists, which index starts at 0 interactions[_('Number of access to the subject on ')+ day_names[day_num]] = Log.objects.filter(action="access", resource="subject", - user_id= student.id, context__contains = {'subject_id' : subject.id}, datetime__week_day = day_num, datetime__range = (init_date, end_date)).count() + user_id= student.id, context__contains = {'subject_id' : subject.id}, datetime__week_day = day_num+1, datetime__range = (init_date, end_date)).count() #to save the distinct days the user has accessed if interactions[_('Number of access to the subject on ')+ day_names[day_num]] > 0: distinct_days += 1 -- libgit2 0.21.2