Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lms/djangoapps/instructor/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,10 +1493,7 @@ def post(self, request, course_id, csv=False): # pylint: disable=redefined-oute
'enrollment_date',
]

additional_attributes = configuration_helpers.get_value_for_org(
course_key.org,
"additional_student_profile_attributes"
)
additional_attributes = instructor_analytics_basic.get_additional_student_profile_attributes(course_key)
if additional_attributes:
# Fail fast: must be list/tuple of strings.
if not isinstance(additional_attributes, (list, tuple)):
Expand Down
26 changes: 22 additions & 4 deletions lms/djangoapps/instructor_analytics/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,35 @@ def get_employment_status(self):
Returns:
tuple: Combined tuple of standard STUDENT_FEATURES and custom attributes
"""
additional_attributes = configuration_helpers.get_value_for_org(
course_key.org,
"additional_student_profile_attributes"
)
additional_attributes = get_additional_student_profile_attributes(course_key)

if additional_attributes:
return STUDENT_FEATURES + tuple(additional_attributes)

return STUDENT_FEATURES


def get_additional_student_profile_attributes(course_key):
"""
Return list of additional student profile attributes configured for the course organization.

This function retrieves any custom student profile attributes that have been configured for
a specific course organization. These attributes can be used to extend the standard set of
student features included in analytics exports.

Args:
course_key: CourseKey object for the course

Returns:
list: List of additional student profile attributes configured for the course organization
"""
return configuration_helpers.get_value_for_org(
course_key.org,
"additional_student_profile_attributes",
default=[]
)


def get_available_features(course_key):
"""
Return all available features including custom student attributes for a course.
Expand Down