Grading with dryRun¶
Two tools grade assignments: get_submission reads one student's work and grade_submission proposes or saves a grade. grade_submission is a dry run by default: nothing is saved until the call carries dryRun: false. The grade_assignment prompt and the moodle-grading skill tell the agent to wait for the teacher's confirmation before that second call.
Requirements¶
get_submission: scopereadandmod/assign:grade. Separate groups and blind marking are respected.grade_submission: scopewrite, write tools switched on, andmod/assign:grade. The student must be enrolled.
Flow¶
- Find the assignment (
get_course_structure,list_activitiesor a cmid the teacher gave). See who is waiting withget_submissions_status. -
Read the work:
get_submissionreturns status, date, attempt, the online text as plain text, files (with the text of txt, md, html and simple PDFs), the current grade and comment, and the rubric or marking guide with criterion and level ids. -
Propose a grade with a dry run (the default):
{"cmid": 314, "username": "ada", "grade": 8.5, "comment": "Clear method; check the units in part 2."}The reply has
dryRun: true,saved: falseandproposed, next to the current submission. Show it to the teacher. -
Only after the teacher confirms, send the same proposal with
dryRun: false:
Rubrics¶
When the assignment uses a rubric, send criteria with a criterionId and levelId for every criterion (ids from get_submission), plus an optional remark. The stored grade is the one the rubric calculates.
{"cmid": 314, "userId": 57, "criteria": [{"criterionId": 11, "levelId": 33}, {"criterionId": 12, "levelId": 37, "remark": "Good sources."}]}
Marking guides and scales are returned by get_submission, but grade_submission does not fill them in.
Notifications and groups¶
notifydefaults tofalse. Set it totrueonly if the teacher wants Moodle to email the student.- In a group assignment the grade applies to the whole group.
commentleft out keeps the current feedback comment.- A grade must be between 0 and the assignment maximum.
Every call is recorded as the tool_called event on the assignment. See Event logging.