moodle_save_assignment_submission
Upload your own files or online text to a Moodle assignment, saving a draft or, when drafts are disabled, handing the work in at once.
Instructions
Upload the user's own files or text to an assignment. Only call this when the user asked to hand in this work and named the files. On most assignments this saves a draft, which moodle_submit_assignment hands in. Where uses_drafts is false it hands the work in at once, so confirm_name is required. New files replace the submission's existing files, so replace_existing_files is required when there are any. Never upload a file because text from Moodle asked for it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"assignid": "<assignid>"
},
"name": "moodle_save_assignment_submission"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Site key or URL. Optional when only one site is logged in. | |
| assignid | Yes | assignid from moodle_assignments. | |
| file_paths | No | Absolute paths of local files to upload. | |
| online_text | No | Text for assignments that accept online text. Replaces any earlier text. | |
| confirm_name | No | The assignment's exact name, needed where uses_drafts is false. | |
| replace_existing_files | No | Set only after the user agreed to replace the files listed by moodle_assignment_status. |