The course settings `certificate_available_date` (CAD) and `certificates_display_behavior` (CDB) were previously acting indedependantly of one another. They now work in tandem. This change: - limits CDB to a dropdown - removes "early_with_info" and adds "end_with_date" - only takes CAD into account if "end_with_date" is selected - Moves CDB to the main course schedule settings page - updates CourseOverview to validate these fields and choose sane defaults if they aren't expected values Certificates will now show under the following circumstances: "Immediately upon passing" certificate_availability_date = null certificates_display_behavior = "early_no_info" "End date of course" certificate_availability_date = null certificates_display_behavior = "end" "A date after the course end date" certificate_availability_date = <date> certificates_display_behavior = "end_with_date"
26 lines
713 B
Python
26 lines
713 B
Python
"""
|
|
Public data structures for this app.
|
|
|
|
See OEP-49 for details
|
|
"""
|
|
from enum import Enum
|
|
|
|
|
|
class CertificatesDisplayBehaviors(str, Enum):
|
|
"""
|
|
Options for the certificates_display_behavior field of a course
|
|
|
|
end: Certificates are available at the end of the course
|
|
end_with_date: Certificates are available after the certificate_available_date (post course end)
|
|
early_no_info: Certificates are available immediately after earning them.
|
|
|
|
Only in affect for instructor based courses.
|
|
"""
|
|
END = "end"
|
|
END_WITH_DATE = "end_with_date"
|
|
EARLY_NO_INFO = "early_no_info"
|
|
|
|
@classmethod
|
|
def includes_value(cls, value):
|
|
return value in set(item.value for item in cls)
|