get_quizzes
Retrieve the list of quizzes available in the configured Moodle course to access assessment materials and track learning progress.
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 core handler function for the 'get_quizzes' tool. It makes an API call to Moodle's 'mod_quiz_get_quizzes_by_courses' web service for the configured course ID, extracts the quizzes array from the response, and returns it as a JSON-formatted text content block.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:149-153 (schema)Input schema for the 'get_quizzes' tool, which is an empty object (no input parameters expected).inputSchema: { type: 'object', properties: {}, required: [], },
- src/index.ts:247-248 (registration)Dispatch case in the CallToolRequestHandler switch statement that routes calls to the getQuizzes() handler method.case 'get_quizzes': return await this.getQuizzes();
- src/index.ts:49-56 (helper)TypeScript interface defining the expected structure of a Quiz object, matching the Moodle API response fields.interface Quiz { id: number; name: string; timeopen: number; timeclose: number; grade: number; timemodified: number; }