tl-its-umich-edu / my-learning-analytics

My Learning Analytics (MyLA)
Apache License 2.0
35 stars 39 forks source link

Cron fails when same resource is used in separate courses #918

Closed pushyamig closed 4 years ago

pushyamig commented 4 years ago

Thank you for contributing to this project!

Expected behavior (A clear and concise description of what you expected to happen) :

Describe the bug (Tell us what happens instead of the expected behavior) :

Cron is failing when accessing resources data( like lecture video )with the same id used on multiple courses. This is probably occurring due to the Primary key on the resource id which is the resource id of the file.

The better solution to fix this will be use auto-increment id and a separate column called resource_id

By Default, cron is only checking if course exists in the Canvas Dataware house(CDH) and if some of the courses added to Myla don't have a presence in CDH then wiping of the data don't happen for those courses.

Steps to Reproduce :

Screenshots/Video (If possible, add media to help explain your problem) :

Additional context (Add any other context about the problem here) :

pushyamig commented 4 years ago

Test plan: The resource table is now modified to take auto-increment id and instead of resource id as a primary key that way after each insert into DB table has the unique key is not dependent on resource id. This will work well in cases when instructor uses same Resource with same id in 2 different course

  1. For courses with the Leccapture tool, uses same resource in 2 different course sections331347, 347677. These courses are a good way to test it cron runs successfully.
jennlove-um commented 4 years ago

The lecture capture recording shows up correctly in both courses.