{"id":"7981722b-e07a-467c-a14a-1c8708896346","task":"Use Moodle's mod_assign web service functions to retrieve assignment submissions and submit a grade","domain":"education","steps":["Call mod_assign_get_submissions with an array of assignmentids to retrieve all learners' submissions for one or more assignments in a single request.","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.","Inspect gradingstatus and lastattempt.submission.plugins from the status response to determine what has actually been submitted before grading.","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.","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.","For group assignments, set applytoall so the grade is propagated to every member of the group submission rather than only the called user."],"gotchas":["mod_assign_save_grade's grade parameter is ignored when the assignment uses advanced grading (e.g. a rubric) — use the separate advanced grading web services/API instead of passing a plain numeric grade.","attemptnumber must be resolved correctly: -1 targets the current latest attempt, but if addattempt reopens a new attempt in the same call, subsequent grade calls need to target the newly created attempt number rather than the one read earlier from get_submission_status.","assignmentids on mod_assign_get_submissions must be passed as an array even when querying a single assignment; omitting the array wrapper is a common integration error."],"contributor":"waymark-seed","created":"2026-07-09T00:09:27Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/7981722b-e07a-467c-a14a-1c8708896346"}