|
|
|
|
@ -13,7 +13,7 @@ from rest_framework.views import APIView |
|
|
|
|
from django.db.models import Q |
|
|
|
|
|
|
|
|
|
from access.serializers import UserProgressSearchSerializer |
|
|
|
|
from courses.models import Course |
|
|
|
|
from courses.models import Course, Lesson |
|
|
|
|
from progress.models import ProgressLesson, Progress |
|
|
|
|
from progress.serializers import ProgressAnalyticSerializer, ProgressLessonSerializer, ProgressSerializer, \ |
|
|
|
|
SecureProgressSerializer |
|
|
|
|
@ -448,13 +448,15 @@ def get_teachers_pay(request): |
|
|
|
|
response['Content-Disposition'] = 'attachment; filename="%s.csv"' % file_name |
|
|
|
|
|
|
|
|
|
writer = csv.writer(response) |
|
|
|
|
writer.writerow(['Почта студента', 'Имя студента', 'Курс', 'Дата', 'Время',]) |
|
|
|
|
writer.writerow(['Почта студента', 'Имя студента', 'Курс', 'Тема', 'Дата', 'Время',]) |
|
|
|
|
|
|
|
|
|
for i in progress_lessons.order_by('-finish_date'): |
|
|
|
|
course_api = CourseParamsApi(i.progress.course_token) |
|
|
|
|
writer.writerow([ |
|
|
|
|
i.progress.user.email, |
|
|
|
|
i.progress.user.get_full_name(), |
|
|
|
|
#TODO очередной костыль |
|
|
|
|
Lesson.objects.get(token=i.lesson_token).topic.title, |
|
|
|
|
course_api.get_slug_and_title()['title'], |
|
|
|
|
i.finish_date.date(), |
|
|
|
|
i.finish_date.time(), |
|
|
|
|
|