by James Ballard.
Running into the same issue and tried both approaches, however core_course_get_contents returns the id as the Course Module id rather than the assignment id. I can't see instance id in the response
Is there a bridging service between course modules and the module instances?