Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added course archived date to all course enrollment reports #467

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def all_courses_enrollment_report(request):
"course_url",
"course_title",
"available_since",
"archived_date",
"parent_course_url",
"parent_course_title",
"total_learners_enrolled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def upload_all_courses_enrollment_csv(
csv_type = task_input.get("csv_type", "all_enrollments_stats")

query_features_names = [
'Course URL', 'Course title', 'Course available since', 'Parent course URL', 'Parent course title', 'Total learners enrolled', 'Total learners completed', 'Percentage of learners who completed the course', 'Certificates Generated',
'Course URL', 'Course title', 'Course available since', 'Course Archived Date', 'Parent course URL', 'Parent course title', 'Total learners enrolled', 'Total learners completed', 'Percentage of learners who completed the course', 'Certificates Generated',
]
data = list_all_courses_enrollment_data()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,10 @@ def list_all_courses_enrollment_data():

# Append outside the try block
courses_data.append({
'course_url': get_cms_course_url(str(course.id)),
'course_title': course.display_name,
'available_since': course.enrollment_start.strftime("%Y-%m-%d") if course.enrollment_start else '',
"course_url": get_cms_course_url(str(course.id)),
"course_title": course.display_name,
"available_since": course.enrollment_start.strftime("%Y-%m-%d") if course.enrollment_start else '',
"archived_date": course.end.strftime("%Y-%m-%d") if course.has_ended() else '',
"parent_course_url": parent_course_url,
"parent_course_title": parent_course_title,
"total_learners_enrolled": course_completion_stats["total_learners_enrolled"],
Expand Down