Skip to content

feat: add progress data of user to api [BB-7189]

Navin Karkera requested to merge navin/chart-data into opencraft-release/maple.3

Adds user progress data in a course to synchorine_user task which sends these data to specified endpoints in settings.

Test instructions

  1. Setup nutmeg devstack
  2. Get lms up and running using make lms-up.
  3. Open shell in lms using make lms-shell.
  4. Clone this repo in <devstack-base-dir>/src/ytp_api
  5. In ytp_api/tasks.py -> synchronize_user function comment out send_post_to_api and send_enrollment_data function calls.
  6. Install this inside lms container using pip install -e /edx/src/ytp_api
  7. Open django shell using python manage.py lms shell.
  8. Run below snippet:
from ytp_api.tasks import synchronize_user
synchronize_user("edx")
  1. It should print data completion summary data to be sent to API.
2023-03-09 06:38:13,026 INFO 644 [ytp_api.tasks] [user None] [ip None] tasks.py:101 - Synchronizing completion summary for user: edx in course course-v1:edX+DemoX+Demo_Course
2023-03-09 06:38:13,037 WARNING 644 [edx_toggles.toggles.internal.waffle.flag] [user None] [ip None] flag.py:79 - Flag 'course_experience.relative_dates' accessed without a request, which is likely in the context of a celery task.
2023-03-09 06:38:13,046 INFO 644 [ytp_api.tasks] [user None] [ip None] tasks.py:108 - Sending completion summary data to server: {'complete_count': 0, 'incomplete_count': 46, 'locked_count': 0, 'username': 'edx', 'course_id': 'course-v1:edX+DemoX+Demo_Course'}
Edited by Navin Karkera

Merge request reports