The QTI integration is done with Assessment: when a resource has type="imsqti_xmlv1p0", the IMS-LD package call the Assessment package to manage this resource.
Since communication between packages is possible, Assessment tells IMS-LD that the test has been completed and the resource is labeled as completed. Other interactions are possible, of course.
Cheers,
Luis