get_quizzes
Retrieve available quizzes from a configured Moodle course to access assessment materials and manage learning activities.
Instructions
Obtiene la lista de quizzes en el curso configurado
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:335-355 (handler)The main handler function for the 'get_quizzes' tool. It calls the Moodle Web Service 'mod_quiz_get_quizzes_by_courses' for the configured course and returns the list of quizzes as a JSON-formatted text response.private async getQuizzes() { console.error('[API] Requesting quizzes'); const response = await this.axiosInstance.get('', { params: { wsfunction: 'mod_quiz_get_quizzes_by_courses', courseids: [MOODLE_COURSE_ID], }, }); const quizzes = response.data.quizzes || []; return { content: [ { type: 'text', text: JSON.stringify(quizzes, null, 2), }, ], }; }
- src/index.ts:146-154 (registration)Tool registration in the ListTools response, including name, description, and empty input schema (no parameters required).{ name: 'get_quizzes', description: 'Obtiene la lista de quizzes en el curso configurado', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/index.ts:247-248 (registration)Dispatch case in the CallToolRequest handler that routes 'get_quizzes' calls to the getQuizzes() method.case 'get_quizzes': return await this.getQuizzes();
- src/index.ts:49-56 (schema)TypeScript interface defining the structure of Quiz objects returned by the tool.interface Quiz { id: number; name: string; timeopen: number; timeclose: number; grade: number; timemodified: number; }