moodle_download_resource
Download learning materials from Moodle—individual files, folders, or files linked in pages—to a chosen directory and receive the local file paths.
Instructions
Download a file, all files of a folder, or files linked in a page/text block, and return the local paths.
By default files go to the managed directory <download_directory>/<course>/<section>/,
which moodle_sync_course also uses.
Args:
resource_id: id from moodle_list_resources ("<cmid>" or "<folder cmid>/<path>"),
or a file link's resource_id from moodle_get_content ("<page/label id>/<file>");
the id of a page or text block downloads all files linked in it
destination: optional target directory; relative paths are resolved
against the configured download directory
overwrite: replace an existing local file (otherwise it is left as is)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| overwrite | No | ||
| destination | No | ||
| resource_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| failed | No | Linked files that could not be loaded | |
| resource_id | Yes |