I couldn't get getLineItems() to return any data, and findOrCreateLineItem() was creating new line items constantly. It looks like the line items are actually returned into $response['body'] and not $response['body']['lineitems'], and this is backed up by the original PHP library and the Python library in these files:
Additionally, the 'tag' key was not being isset() tested like the other fields in findOrCreateLineitem() and so was producing a warning in PHP logs if the tag was not set in a returned line item.
Testing
Manual testing that shows the line items are now being returned from Canvas LMS.
I am wondering how this regression has occurred from the library it was forked from, and whether this code is being used in any production Canvas LTI tool integrations? I really appreciate all the work on it, just wondering how production-ready this code is. Does this return behavior differ by LMS systems and some do return it in the 'lineitems' key of the response? Thanks!
Summary of Changes
I couldn't get getLineItems() to return any data, and findOrCreateLineItem() was creating new line items constantly. It looks like the line items are actually returned into $response['body'] and not $response['body']['lineitems'], and this is backed up by the original PHP library and the Python library in these files:
https://github.com/IMSGlobal/lti-1-3-php-library/blob/master/src/lti/LTI_Assignments_Grades_Service.php https://github.com/dmitry-viskov/pylti1.3/blob/master/pylti1p3/assignments_grades.py
Additionally, the 'tag' key was not being isset() tested like the other fields in findOrCreateLineitem() and so was producing a warning in PHP logs if the tag was not set in a returned line item.
Testing
Manual testing that shows the line items are now being returned from Canvas LMS.
I am wondering how this regression has occurred from the library it was forked from, and whether this code is being used in any production Canvas LTI tool integrations? I really appreciate all the work on it, just wondering how production-ready this code is. Does this return behavior differ by LMS systems and some do return it in the 'lineitems' key of the response? Thanks!