diff --git a/common/djangoapps/course_modes/models.py b/common/djangoapps/course_modes/models.py index c8b789aa9391426ce5be2bdd0dca263680e03319..816028bc1148cfd1cc21d27f783025775c718790 100644 --- a/common/djangoapps/course_modes/models.py +++ b/common/djangoapps/course_modes/models.py @@ -133,13 +133,14 @@ class CourseMode(models.Model): history = HistoricalRecords() - HONOR = u'honor' - PROFESSIONAL = u'professional' - VERIFIED = u'verified' - AUDIT = u'audit' - NO_ID_PROFESSIONAL_MODE = u'no-id-professional' - CREDIT_MODE = u'credit' - MASTERS = u'masters' + HONOR = 'honor' + PROFESSIONAL = 'professional' + VERIFIED = 'verified' + AUDIT = 'audit' + NO_ID_PROFESSIONAL_MODE = 'no-id-professional' + CREDIT_MODE = 'credit' + MASTERS = 'masters' + EXECUTIVE_EDUCATION = 'executive-education' DEFAULT_MODE = Mode( settings.COURSE_MODE_DEFAULTS['slug'], @@ -154,13 +155,22 @@ class CourseMode(models.Model): ) DEFAULT_MODE_SLUG = settings.COURSE_MODE_DEFAULTS['slug'] - ALL_MODES = [AUDIT, CREDIT_MODE, HONOR, NO_ID_PROFESSIONAL_MODE, PROFESSIONAL, VERIFIED, MASTERS, ] + ALL_MODES = [ + AUDIT, + CREDIT_MODE, + HONOR, + NO_ID_PROFESSIONAL_MODE, + PROFESSIONAL, + VERIFIED, + MASTERS, + EXECUTIVE_EDUCATION + ] # Modes utilized for audit/free enrollments AUDIT_MODES = [AUDIT, HONOR] # Modes that allow a student to pursue a verified certificate - VERIFIED_MODES = [VERIFIED, PROFESSIONAL, MASTERS] + VERIFIED_MODES = [VERIFIED, PROFESSIONAL, MASTERS, EXECUTIVE_EDUCATION] # Modes that allow a student to pursue a non-verified certificate NON_VERIFIED_MODES = [HONOR, AUDIT, NO_ID_PROFESSIONAL_MODE] @@ -169,7 +179,7 @@ class CourseMode(models.Model): CREDIT_MODES = [CREDIT_MODE] # Modes that are eligible to purchase credit - CREDIT_ELIGIBLE_MODES = [VERIFIED, PROFESSIONAL, NO_ID_PROFESSIONAL_MODE] + CREDIT_ELIGIBLE_MODES = [VERIFIED, PROFESSIONAL, NO_ID_PROFESSIONAL_MODE, EXECUTIVE_EDUCATION] # Modes for which certificates/programs may need to be updated CERTIFICATE_RELEVANT_MODES = CREDIT_MODES + CREDIT_ELIGIBLE_MODES + [MASTERS] diff --git a/lms/djangoapps/certificates/models.py b/lms/djangoapps/certificates/models.py index 9a40eaf81c9b50268194b3ec16f3a325ccde07cb..7a7fe3e5ad52de52cf4d349096c00c3926043679 100644 --- a/lms/djangoapps/certificates/models.py +++ b/lms/djangoapps/certificates/models.py @@ -263,9 +263,17 @@ class GeneratedCertificate(models.Model): # results. Django requires us to explicitly declare this. objects = models.Manager() - MODES = Choices(u'verified', u'honor', u'audit', u'professional', u'no-id-professional', u'masters') + MODES = Choices( + 'verified', + 'honor', + 'audit', + 'professional', + 'no-id-professional', + 'masters', + 'executive-education' + ) - VERIFIED_CERTS_MODES = [CourseMode.VERIFIED, CourseMode.CREDIT_MODE, CourseMode.MASTERS] + VERIFIED_CERTS_MODES = [CourseMode.VERIFIED, CourseMode.CREDIT_MODE, CourseMode.MASTERS, CourseMode.EXECUTIVE_EDUCATION] user = models.ForeignKey(User, on_delete=models.CASCADE) course_id = CourseKeyField(max_length=255, blank=True, default=None) diff --git a/lms/djangoapps/certificates/signals.py b/lms/djangoapps/certificates/signals.py index be2ae3f63963021177ff9d01137801d4f8a375b0..ef7c6dbfb6f5220a9c71af75f00ea597cc8145c0 100644 --- a/lms/djangoapps/certificates/signals.py +++ b/lms/djangoapps/certificates/signals.py @@ -155,6 +155,7 @@ def fire_ungenerated_certificate_task(user, course_key, expected_verification_st CourseMode.PROFESSIONAL, CourseMode.NO_ID_PROFESSIONAL_MODE, CourseMode.MASTERS, + CourseMode.EXECUTIVE_EDUCATION, ] enrollment_mode, __ = CourseEnrollment.enrollment_mode_for_user(user, course_key) cert = GeneratedCertificate.certificate_for_student(user, course_key) diff --git a/lms/djangoapps/courseware/rules.py b/lms/djangoapps/courseware/rules.py index 58866b397afea5c7ea49be6cacf7365506f3e22d..5360e79578639e19e3130987039d5cee6d8a4464 100644 --- a/lms/djangoapps/courseware/rules.py +++ b/lms/djangoapps/courseware/rules.py @@ -37,7 +37,7 @@ def is_track_ok_for_exam(user, exam): """ course_id = CourseKey.from_string(exam['course_id']) mode, is_active = CourseEnrollment.enrollment_mode_for_user(user, course_id) - return is_active and mode in (CourseMode.VERIFIED, CourseMode.MASTERS, CourseMode.PROFESSIONAL) + return is_active and mode in (CourseMode.VERIFIED, CourseMode.MASTERS, CourseMode.PROFESSIONAL, CourseMode.EXECUTIVE_EDUCATION) # The edx_proctoring.api uses this permission to gate access to the diff --git a/lms/djangoapps/program_enrollments/rest_api/v1/utils.py b/lms/djangoapps/program_enrollments/rest_api/v1/utils.py index 5aacc94a28d64732d00ac29e07c292faadc1860c..828e1b1a313cfa6ff6447f86d579e2b14394d0ab 100644 --- a/lms/djangoapps/program_enrollments/rest_api/v1/utils.py +++ b/lms/djangoapps/program_enrollments/rest_api/v1/utils.py @@ -217,7 +217,7 @@ def get_enrollments_for_courses_in_program(user, program): return CourseEnrollment.objects.filter( user=user, course_id__in=course_keys, - mode__in=[CourseMode.VERIFIED, CourseMode.MASTERS], + mode__in=[CourseMode.VERIFIED, CourseMode.MASTERS, CourseMode.EXECUTIVE_EDUCATION], is_active=True, ) diff --git a/lms/envs/common.py b/lms/envs/common.py index 9e7b368a73fca083f2f9c481103ab37fc1d47c43..87b5cf8a4dd10e3e3e77129fdd0c62047e08ed56 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3911,6 +3911,12 @@ COURSE_ENROLLMENT_MODES = { "display_name": _("Master's"), "min_price": 0, }, + "executive-education": { + "id": 8, + "slug": "executive-educations", + "display_name": _("Executive Education"), + "min_price": 1 + } } CONTENT_TYPE_GATE_GROUP_IDS = { diff --git a/lms/templates/instructor/instructor_dashboard_2/course_info.html b/lms/templates/instructor/instructor_dashboard_2/course_info.html index 91e18660d18c77e4f1f6abf1f8ba36253ca95d4c..b521aefb078e3772815fa59ce0a1aa7ba2913dfc 100644 --- a/lms/templates/instructor/instructor_dashboard_2/course_info.html +++ b/lms/templates/instructor/instructor_dashboard_2/course_info.html @@ -24,6 +24,11 @@ from openedx.core.djangolib.markup import HTML, Text <tr> <th scope="row">${_("Professional")}</th><td>${modes['professional'] + modes['no-id-professional']}</td> </tr> + %if modes["executive-education"] > 0: + <tr> + <th scope="row">${_("Executive Education")}</th><td>${modes['executive-education']}</td> + </tr> + %endif %if modes['masters'] > 0: <tr> <th scope="row">${_("Master's")}</th><td>${modes['masters']}</td>