From 3a1c6175f310bcba4ae3ff5053034380939859f1 Mon Sep 17 00:00:00 2001 From: Abdul-Muqadim-Arbisoft <139064778+Abdul-Muqadim-Arbisoft@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:54:42 +0500 Subject: [PATCH] Added course archived date to all course enrollment reports (#467) --- .../wikimedia_features/admin_dashboard/admin_task/api.py | 1 + .../admin_dashboard/course_versions/task_helper.py | 2 +- .../admin_dashboard/course_versions/utils.py | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openedx/features/wikimedia_features/admin_dashboard/admin_task/api.py b/openedx/features/wikimedia_features/admin_dashboard/admin_task/api.py index 328b21eff78c..186899d6540c 100644 --- a/openedx/features/wikimedia_features/admin_dashboard/admin_task/api.py +++ b/openedx/features/wikimedia_features/admin_dashboard/admin_task/api.py @@ -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", diff --git a/openedx/features/wikimedia_features/admin_dashboard/course_versions/task_helper.py b/openedx/features/wikimedia_features/admin_dashboard/course_versions/task_helper.py index cd8ac318ad8e..dbd5e82540b0 100644 --- a/openedx/features/wikimedia_features/admin_dashboard/course_versions/task_helper.py +++ b/openedx/features/wikimedia_features/admin_dashboard/course_versions/task_helper.py @@ -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() diff --git a/openedx/features/wikimedia_features/admin_dashboard/course_versions/utils.py b/openedx/features/wikimedia_features/admin_dashboard/course_versions/utils.py index 9efe52c6b72e..e5cf7dc545a6 100644 --- a/openedx/features/wikimedia_features/admin_dashboard/course_versions/utils.py +++ b/openedx/features/wikimedia_features/admin_dashboard/course_versions/utils.py @@ -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"],