Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added content_title, progress_status in get_learner_data_records for derived classed #2267

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Unreleased
----------
* nothing unreleased

[4.28.2]
--------
* fix: added content_title, progress_status in get_learner_data_records for derived classed of learner data exporters.

[4.28.1]
--------
* feat: making to-be-deleted model field nullable
Expand Down
2 changes: 1 addition & 1 deletion enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Your project description goes here.
"""

__version__ = "4.28.1"
__version__ = "4.28.2"
4 changes: 4 additions & 0 deletions integrated_channels/blackboard/exporters/learner_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def get_learner_data_records(
self,
enterprise_enrollment,
completed_date=None,
content_title=None,
progress_status=None,
course_completed=False,
**kwargs
): # pylint: disable=arguments-differ
Expand Down Expand Up @@ -65,6 +67,8 @@ def get_learner_data_records(
course_completed=course_completed,
grade=percent_grade,
completed_timestamp=completed_date,
content_title=content_title,
progress_status=progress_status,
blackboard_completed_timestamp=blackboard_completed_timestamp,
enterprise_customer_uuid=enterprise_customer_user.enterprise_customer.uuid,
plugin_configuration_id=self.enterprise_configuration.id,
Expand Down
4 changes: 4 additions & 0 deletions integrated_channels/canvas/exporters/learner_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def get_learner_data_records(
self,
enterprise_enrollment,
completed_date=None,
content_title=None,
progress_status=None,
course_completed=False,
**kwargs
): # pylint: disable=arguments-differ
Expand Down Expand Up @@ -65,6 +67,8 @@ def get_learner_data_records(
course_completed=course_completed,
grade=percent_grade,
completed_timestamp=completed_date,
content_title=content_title,
progress_status=progress_status,
canvas_completed_timestamp=canvas_completed_timestamp,
enterprise_customer_uuid=enterprise_customer_user.enterprise_customer.uuid,
plugin_configuration_id=self.enterprise_configuration.id,
Expand Down
4 changes: 4 additions & 0 deletions integrated_channels/cornerstone/exporters/learner_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def get_learner_data_records(
enterprise_enrollment,
completed_date=None,
grade=None,
content_title=None,
progress_status=None,
course_completed=False,
**kwargs,
): # pylint: disable=arguments-differ
Expand Down Expand Up @@ -53,6 +55,8 @@ def get_learner_data_records(
csod_learner_data_transmission.grade = grade
csod_learner_data_transmission.course_completed = course_completed
csod_learner_data_transmission.completed_timestamp = completed_date
csod_learner_data_transmission.content_title = content_title
csod_learner_data_transmission.progress_status = progress_status

# Used for api error reporting
csod_learner_data_transmission.user_email = enterprise_enrollment.enterprise_customer_user.user_email
Expand Down
4 changes: 4 additions & 0 deletions integrated_channels/degreed2/exporters/learner_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def get_learner_data_records(
self,
enterprise_enrollment,
completed_date=None,
content_title=None,
progress_status=None,
course_completed=False,
**kwargs
): # pylint: disable=arguments-differ
Expand Down Expand Up @@ -70,6 +72,8 @@ def get_learner_data_records(
user_email=enterprise_enrollment.enterprise_customer_user.user_email,
course_id=get_course_id_for_enrollment(enterprise_enrollment),
completed_timestamp=completed_date,
content_title=content_title,
progress_status=progress_status,
degreed_completed_timestamp=degreed_completed_timestamp,
course_completed=course_completed,
grade=percent_grade,
Expand Down
4 changes: 4 additions & 0 deletions integrated_channels/moodle/exporters/learner_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def get_learner_data_records(
self,
enterprise_enrollment,
completed_date=None,
content_title=None,
progress_status=None,
course_completed=False,
**kwargs
): # pylint: disable=arguments-differ
Expand Down Expand Up @@ -67,6 +69,8 @@ def get_learner_data_records(
course_completed=course_completed,
grade=percent_grade,
completed_timestamp=completed_date,
content_title=content_title,
progress_status=progress_status,
moodle_completed_timestamp=moodle_completed_timestamp,
enterprise_customer_uuid=enterprise_customer_user.enterprise_customer.uuid,
plugin_configuration_id=self.enterprise_configuration.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def get_learner_data_records(
enterprise_enrollment,
completed_date=None,
grade=None,
content_title=None,
progress_status=None,
course_completed=False,
**kwargs,
): # pylint: disable=arguments-differ
Expand Down Expand Up @@ -74,6 +76,8 @@ def get_learner_data_records(
completed_timestamp=completed_date,
sap_completed_timestamp=sap_completed_timestamp,
grade=grade,
content_title=content_title,
progress_status=progress_status,
total_hours=total_hours,
credit_hours=total_hours,
enterprise_customer_uuid=self.enterprise_configuration.enterprise_customer.uuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def test_retrieve_same_learner_data_record(self, mock_course_catalog_api):
)
mock_course_catalog_api.return_value.get_course_id.return_value = self.course_key
exporter = BlackboardLearnerExporter('fake-user', self.config)
learner_data_records_1 = exporter.get_learner_data_records(enterprise_course_enrollment)[0]
learner_data_records_1 = exporter.get_learner_data_records(
enterprise_course_enrollment,
progress_status='In Progress'
)[0]
learner_data_records_1.save()
learner_data_records_2 = exporter.get_learner_data_records(enterprise_course_enrollment)[0]
learner_data_records_2.save()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def test_retrieve_same_learner_data_record(self, mock_course_catalog_api):
"""
mock_course_catalog_api.return_value.get_course_id.return_value = self.course_key
exporter = CanvasLearnerExporter('fake-user', self.config)
learner_data_records_1 = exporter.get_learner_data_records(self.enterprise_course_enrollment)[0]
learner_data_records_1 = exporter.get_learner_data_records(
self.enterprise_course_enrollment,
progress_status='In Progress'
)[0]
learner_data_records_1.save()
learner_data_records_2 = exporter.get_learner_data_records(self.enterprise_course_enrollment)[0]
learner_data_records_2.save()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def setUp(self):
self.user_guid = "fake-guid"
self.course_id = 'course-v1:edX+DemoX+DemoCourse'
self.course_key = 'edX+DemoX'
self.progress_status = 'In Progress'
self.content_title = 'DemoX'
self.enterprise_customer = factories.EnterpriseCustomerFactory(
enable_audit_enrollment=True,
enable_audit_data_reporting=True,
Expand Down Expand Up @@ -89,6 +91,8 @@ def _setup_enterprise_enrollment(self, user, course_id, course_key):
callback_url=self.callback_url,
subdomain=self.subdomain,
course_id=course_key,
progress_status=self.progress_status,
content_title=self.content_title,
user_guid=self.user_guid
)
return enterprise_course_enrollment
Expand All @@ -103,6 +107,8 @@ def test_get_learner_data_record(self, completed_date):
learner_data_records = exporter.get_learner_data_records(
self.enterprise_course_enrollment,
completed_date=completed_date,
progress_status=self.progress_status,
content_title=self.content_title,
course_completed=True,
)
assert learner_data_records[0].course_id == self.course_key
Expand All @@ -111,6 +117,8 @@ def test_get_learner_data_record(self, completed_date):
assert learner_data_records[0].subdomain == self.subdomain
assert learner_data_records[0].callback_url == self.callback_url
assert learner_data_records[0].session_token == self.session_token
assert learner_data_records[0].progress_status == self.progress_status
assert learner_data_records[0].content_title == self.content_title
assert learner_data_records[0].course_completed
assert learner_data_records[0].enterprise_course_enrollment_id == self.enterprise_course_enrollment.id
assert learner_data_records[0].completed_timestamp == (
Expand All @@ -124,9 +132,15 @@ def test_retrieve_same_learner_data_record(self, mock_course_catalog_api):
"""
mock_course_catalog_api.return_value.get_course_id.return_value = self.course_key
exporter = CornerstoneLearnerExporter('fake-user', self.config)
learner_data_records_1 = exporter.get_learner_data_records(self.enterprise_course_enrollment)[0]
learner_data_records_1 = exporter.get_learner_data_records(
self.enterprise_course_enrollment,
progress_status='In Progress'
)[0]
learner_data_records_1.save()
learner_data_records_2 = exporter.get_learner_data_records(self.enterprise_course_enrollment)[0]
learner_data_records_2 = exporter.get_learner_data_records(
self.enterprise_course_enrollment,
progress_status='In Progress'
)[0]
learner_data_records_2.save()

assert learner_data_records_1.id == learner_data_records_2.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def test_retrieve_same_learner_data_record(self):
exporter = Degreed2LearnerExporter('fake-user', self.config)
learner_data_records_1 = exporter.get_learner_data_records(
enterprise_course_enrollment,
progress_status='In Progress'
)[0]
learner_data_records_1.save()
learner_data_records_2 = exporter.get_learner_data_records(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ def test_retrieve_same_learner_data_record(self, mock_course_catalog_api):
)
mock_course_catalog_api.return_value.get_course_id.return_value = self.course_key
exporter = MoodleLearnerExporter('fake-user', self.config)
learner_data_records_1 = exporter.get_learner_data_records(enterprise_course_enrollment)[0]
learner_data_records_1 = exporter.get_learner_data_records(
enterprise_course_enrollment,
progress_status='In Progress'
)[0]
learner_data_records_1.save()
learner_data_records_2 = exporter.get_learner_data_records(enterprise_course_enrollment)[0]
learner_data_records_2.save()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def test_retrieve_same_learner_data_record(
user = UserFactory()
completed_date = None
grade = 'Pass'
progress_status = 'Passed'
course_completed = False
enterprise_enrollment = EnterpriseCourseEnrollmentFactory(
enterprise_customer_user=self.enterprise_customer_user
Expand All @@ -130,7 +131,8 @@ def test_retrieve_same_learner_data_record(
enterprise_enrollment,
completed_date,
grade,
course_completed
course_completed,
progress_status
)[0]
learner_data_records_1.save()
learner_data_records_2 = exporter.get_learner_data_records(
Expand Down
Loading