provide_feedback
Submit feedback and grades for student assignments in Moodle. Enter student ID, assignment ID, grade, and feedback text to evaluate submissions.
Instructions
Proporciona feedback sobre una tarea entregada por un estudiante
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| studentId | Yes | ID del estudiante | |
| assignmentId | Yes | ID de la tarea | |
| grade | No | Calificación numérica a asignar | |
| feedback | Yes | Texto del feedback a proporcionar |
Implementation Reference
- src/index.ts:446-483 (handler)The provideFeedback function implements the core logic of the 'provide_feedback' tool. It validates input parameters, calls the Moodle API 'mod_assign_save_grade' to save the grade and feedback comment, and returns a success message.private async provideFeedback(args: any) { if (!args.studentId || !args.assignmentId || !args.feedback) { throw new McpError( ErrorCode.InvalidParams, 'Student ID, Assignment ID, and feedback are required' ); } console.error(`[API] Providing feedback for student ${args.studentId} on assignment ${args.assignmentId}`); const response = await this.axiosInstance.get('', { params: { wsfunction: 'mod_assign_save_grade', assignmentid: args.assignmentId, userid: args.studentId, grade: args.grade || 0, attemptnumber: -1, // Último intento addattempt: 0, workflowstate: 'released', applytoall: 0, plugindata: { assignfeedbackcomments_editor: { text: args.feedback, format: 1, // Formato HTML }, }, }, }); return { content: [ { type: 'text', text: `Feedback proporcionado correctamente para el estudiante ${args.studentId} en la tarea ${args.assignmentId}.`, }, ], }; }
- src/index.ts:176-197 (schema)Input schema for the 'provide_feedback' tool defining properties for studentId, assignmentId, grade (optional), and feedback (required), with required fields specified.inputSchema: { type: 'object', properties: { studentId: { type: 'number', description: 'ID del estudiante', }, assignmentId: { type: 'number', description: 'ID de la tarea', }, grade: { type: 'number', description: 'Calificación numérica a asignar', }, feedback: { type: 'string', description: 'Texto del feedback a proporcionar', }, }, required: ['studentId', 'assignmentId', 'feedback'], },
- src/index.ts:173-198 (registration)Tool registration in the ListTools response, including name, description, and inputSchema for 'provide_feedback'.{ name: 'provide_feedback', description: 'Proporciona feedback sobre una tarea entregada por un estudiante', inputSchema: { type: 'object', properties: { studentId: { type: 'number', description: 'ID del estudiante', }, assignmentId: { type: 'number', description: 'ID de la tarea', }, grade: { type: 'number', description: 'Calificación numérica a asignar', }, feedback: { type: 'string', description: 'Texto del feedback a proporcionar', }, }, required: ['studentId', 'assignmentId', 'feedback'], }, },
- src/index.ts:251-252 (handler)Dispatch case in the CallToolRequestSchema handler that routes 'provide_feedback' calls to the provideFeedback method.case 'provide_feedback': return await this.provideFeedback(request.params.arguments);