I need to develop a Moodle (4.0) repository plugin that allows searching and downloading content from an external repository.
One of the constraints I have is the need to communicate to the external repository's APIs the required format for download. Let me explain further: on the Moodle side, a course is created, I add a topic, and within it, I want to upload an SCORM or IMS, etc. I choose the correct module and, within the selected module's page, I open the file picker. My repository plugin is displayed in Moodle's file picker. I perform a search on the external repository and decide to download a material, but this material must be packaged as SCORM 1.2, or IMS, or downloaded as a single file (e.g., a PDF, an image). However, to have the correct package type, I need to know if I am inside an SCORM module, or IMS, etc. At the moment, I cannot get this information; the context defined in the constructor has contextlevel = CONTEXT_COURSE and does not contain (or at least I cannot find) information related to the selected module.
With "module," I mean the Activity modules (e.g., "IMS content package" or "SCORM package"), although I am not sure if I have used the correct term.