Credit message on track selection page.

* Adds a credit course mode to indicate that a course
has a credit option.

* Hides the credit option from the track selection and
pay-and-verify pages.

* Shows different messaging for the verified track if
it's possible to upgrade from verified to credit at the end
of the course.
This commit is contained in:
Will Daly
2015-04-14 08:37:18 -04:00
parent 0b5d0b2949
commit 3b160eefcb
6 changed files with 138 additions and 13 deletions

View File

@@ -96,9 +96,24 @@ class ChooseModeView(View):
chosen_price = donation_for_course.get(unicode(course_key), None)
course = modulestore().get_course(course_key)
# When a credit mode is available, students will be given the option
# to upgrade from a verified mode to a credit mode at the end of the course.
# This allows students who have completed photo verification to be eligible
# for univerity credit.
# Since credit isn't one of the selectable options on the track selection page,
# we need to check *all* available course modes in order to determine whether
# a credit mode is available. If so, then we show slightly different messaging
# for the verified track.
has_credit_upsell = any(
CourseMode.is_credit_mode(mode) for mode
in CourseMode.modes_for_course(course_key, only_selectable=False)
)
context = {
"course_modes_choose_url": reverse("course_modes_choose", kwargs={'course_id': course_key.to_deprecated_string()}),
"modes": modes,
"has_credit_upsell": has_credit_upsell,
"course_name": course.display_name_with_default,
"course_org": course.display_org_with_default,
"course_num": course.display_number_with_default,