feat: add progress data of user to api [BB-7189]
Adds user progress data in a course to synchorine_user
task which sends these data to specified endpoints in settings.
Test instructions
- Setup nutmeg devstack
- Get lms up and running using
make lms-up
. - Open shell in lms using
make lms-shell
. - Clone this repo in
<devstack-base-dir>/src/ytp_api
- In
ytp_api/tasks.py
->synchronize_user
function comment outsend_post_to_api
andsend_enrollment_data
function calls. - Install this inside lms container using
pip install -e /edx/src/ytp_api
- Open django shell using
python manage.py lms shell
. - Run below snippet:
from ytp_api.tasks import synchronize_user
synchronize_user("edx")
- 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