From a9476ea50eeb1c3b93bd976403f4e9492961619a Mon Sep 17 00:00:00 2001 From: Daniel Clemente Laboreo Date: Thu, 23 May 2019 16:33:30 +0300 Subject: [PATCH] Add last_login and date_joined to the student profile export --- lms/djangoapps/instructor/views/api.py | 3 +++ lms/djangoapps/instructor_analytics/basic.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index 1a8aed27ad..3cf7e7e1b4 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -1317,6 +1317,7 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red 'id', 'username', 'name', 'email', 'language', 'location', 'year_of_birth', 'gender', 'level_of_education', 'mailing_address', 'goals', 'enrollment_mode', 'verification_status', + 'last_login', 'date_joined', ] # Provide human-friendly and translatable names for these features. These names @@ -1336,6 +1337,8 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red 'goals': _('Goals'), 'enrollment_mode': _('Enrollment Mode'), 'verification_status': _('Verification Status'), + 'last_login': _('Last Login'), + 'date_joined': _('Date Joined'), } if is_course_cohorted(course.id): diff --git a/lms/djangoapps/instructor_analytics/basic.py b/lms/djangoapps/instructor_analytics/basic.py index d45d792446..9f48160918 100644 --- a/lms/djangoapps/instructor_analytics/basic.py +++ b/lms/djangoapps/instructor_analytics/basic.py @@ -39,7 +39,8 @@ from student.models import CourseEnrollment, CourseEnrollmentAllowed log = logging.getLogger(__name__) -STUDENT_FEATURES = ('id', 'username', 'first_name', 'last_name', 'is_staff', 'email') +STUDENT_FEATURES = ('id', 'username', 'first_name', 'last_name', 'is_staff', 'email', + 'date_joined', 'last_login') PROFILE_FEATURES = ('name', 'language', 'location', 'year_of_birth', 'gender', 'level_of_education', 'mailing_address', 'goals', 'meta', 'city', 'country')