provide_feedback
Submit feedback and grades for student assignments on Moodle. Enter student ID, assignment ID, grade, and feedback text to evaluate and guide performance effectively.
Instructions
Proporciona feedback sobre una tarea entregada por un estudiante
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignmentId | Yes | ID de la tarea | |
| feedback | Yes | Texto del feedback a proporcionar | |
| grade | No | Calificación numérica a asignar | |
| studentId | Yes | ID del estudiante |
Input Schema (JSON Schema)
{
"properties": {
"assignmentId": {
"description": "ID de la tarea",
"type": "number"
},
"feedback": {
"description": "Texto del feedback a proporcionar",
"type": "string"
},
"grade": {
"description": "Calificación numérica a asignar",
"type": "number"
},
"studentId": {
"description": "ID del estudiante",
"type": "number"
}
},
"required": [
"studentId",
"assignmentId",
"feedback"
],
"type": "object"
}
Implementation Reference
- src/index.ts:446-483 (handler)The core handler function for the 'provide_feedback' tool. It validates the input parameters (studentId, assignmentId, feedback) and calls the Moodle Web Service 'mod_assign_save_grade' to assign a grade and feedback comment to a student's assignment submission. 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:173-198 (registration)Tool registration in the ListToolsRequestHandler response. Defines the tool name, description, and input schema specifying required parameters: studentId, assignmentId, feedback (grade optional).{ 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:176-197 (schema)Input schema definition for the provide_feedback tool, defining types and descriptions for parameters and marking studentId, assignmentId, feedback as required.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 (helper)Dispatcher in the CallToolRequestHandler switch statement that invokes the provideFeedback handler with the tool arguments.case 'provide_feedback': return await this.provideFeedback(request.params.arguments);