|
2 | 2 | Data attributes for events within the architecture subdomain `learning`. These |
3 | 3 | attributes follow the form of attr objects specified in OEP-49 data pattern. |
4 | 4 | """ |
5 | | - |
6 | | -from datetime import datetime |
7 | 5 | from typing import Dict |
8 | 6 |
|
9 | 7 | import attr |
@@ -41,37 +39,40 @@ class RegistrationData: |
41 | 39 |
|
42 | 40 |
|
43 | 41 | @attr.s(frozen=True) |
44 | | -class CourseData: |
| 42 | +class CourseOverviewData: |
45 | 43 | """ |
46 | | - Attributes defined for Open edX course object. |
| 44 | + Attributes defined for Open edX Course Overview object. |
47 | 45 | """ |
48 | 46 | course_key = attr.ib(type=CourseKey) |
49 | | - display_name = attr.ib(type=CourseKey, factory='') |
| 47 | + display_name = attr.ib(type=CourseKey, factory=str) |
50 | 48 |
|
51 | 49 |
|
52 | 50 | @attr.s(frozen=True) |
53 | | -class EnrollmentData: |
| 51 | +class CourseEnrollmentData: |
54 | 52 | """ |
55 | 53 | Attributes defined for Open edX Course Enrollment object. |
56 | 54 | """ |
57 | 55 | user = attr.ib(type=StudentData) |
58 | | - course = attr.ib(type=CourseData) |
| 56 | + course = attr.ib(type=CourseOverviewData) |
59 | 57 | mode = attr.ib(type=str) |
| 58 | + is_active = attr.ib(type=bool) |
60 | 59 |
|
61 | 60 |
|
62 | 61 | @attr.s(frozen=True) |
63 | | -class CertificateData(EnrollmentData): |
| 62 | +class CertificateData(CourseEnrollmentData): |
64 | 63 | """ |
65 | | - Attributes defined for Open edX Course Enrollment object. |
| 64 | + Attributes defined for Open edX Certificate data object. |
66 | 65 | """ |
| 66 | + grade = attr.ib(type=str) |
67 | 67 | status = attr.ib(type=str) |
68 | | - available_date = attr.ib(type=datetime) |
| 68 | + download_url = attr.ib(type=str) |
| 69 | + name = attr.ib(type=str) |
69 | 70 |
|
70 | 71 |
|
71 | 72 | @attr.s(frozen=True) |
72 | 73 | class CohortData: |
73 | 74 | """ |
74 | | - Attributes defined for Open edX Course Enrollment object. |
| 75 | + Attributes defined for Open edX Cohort Membership object. |
75 | 76 | """ |
76 | 77 | user = attr.ib(type=StudentData) |
77 | | - course = attr.ib(type=CourseData) |
| 78 | + course = attr.ib(type=CourseOverviewData) |
0 commit comments