Use Moodle's mod_assign web service functions to retrieve assignment submissions and submit a grade

domain: education · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Call mod_assign_get_submissions with an array of assignmentids to retrieve all learners' submissions for one or more assignments in a single request.
  2. Call mod_assign_get_submission_status for a specific user/assignment to get the full status page data, including the lastattempt object, feedback, and the submission's gradingstatus.
  3. Inspect gradingstatus and lastattempt.submission.plugins from the status response to determine what has actually been submitted before grading.
  4. Call mod_assign_save_grade passing userid, grade, attemptnumber (-1 for the latest attempt), addattempt, and workflowstate to record a grade for that student's submission.
  5. For rich feedback, populate the plugindata parameter on mod_assign_save_grade, e.g. assignfeedbackcomments_editor (text/format) for comments and files_filemanager (a draft file area id) for feedback file attachments.
  6. For group assignments, set applytoall so the grade is propagated to every member of the group submission rather than only the called user.

Known gotchas

Related routes

Use the Moodle external functions API to retrieve course participants and upload a file via web services
moodle.org · 6 steps · unrated
Enrol a user in a Moodle course via REST web service (enrol_manual_enrol_users)
docs.moodle.org · 6 steps · unrated
Call the Moodle Web Services REST API to create a course, enroll users, and upload a SCORM package using the file upload and mod_scorm_add_instance functions
moodle.org · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans