Do not show upgrade banner for archived courses

Description

Please hide the upgrade banner for archived courses since the upgrade option is no longer available


The learner is seeing upgrade option for archived courses on mobile app.
Samsung Galaxy S20
Android 11 (Google Play Patch Level 01.01.2021)
edX-App version 2.24.3
Username: e483370e602a47dbac109a04515f78

Epic Link

None

Activity

Show:
Mian Khalid
March 11, 2021, 8:16 AM

Sounds good! lets use the end date to check if a course is archived or not.

Thanks !

Mian Khalid
March 10, 2021, 9:11 AM
Edited

Gotcha! is there a way to do this using the enrollments API in any way or will we need to update it?

Cuz calling the dates API on this screen (My Courses) won’t work as we’ll have to call it for all the courses the user has enrolled in just to check if a course is archived.

For example, if a user is enrolled in 15 courses, we’ll have to hit the dates API 15 times just to check if courses are archived.

Jawad Khan
March 10, 2021, 9:11 AM
Edited

I looked into dates api and they use course.has_ended() to determine whether a course is ended(archived) or not. So we can say if a course’s end date is in past it is archived.
Code ref:
https://github.com/edx/edx-platform/blob/9bfa56e27b39bbba3fb955a927c090fc7adefe7f/common/lib/xmodule/xmodule/course_metadata_utils.py#L102-L111
we can use end date from enrollment api to determine this on mobile side.

Jawad Khan
March 10, 2021, 8:53 AM

It doesn’t have this info, the is_active in this api means whether user is active or not in the course.
A course is archived if its end date is in past. you can call api/course_home/v1/dates/{course_key} api for courses which have ended.

Mian Khalid
March 9, 2021, 11:54 AM

any idea how we can know if a course is archived?

I’ve tried hitting the Enrollments API but not really sure if it has this info:
/api/mobile/v1/users/{username}/course_enrollments/

Priority

Unset

Assignee

Unassigned

Fix versions

None

Sprint

Labels

None

Story Points

None

Reporter

Poornima Hanumara