get_quizzes
Retrieve the list of quizzes from a configured Moodle course to manage assessments and track student progress.
Instructions
Obtiene la lista de quizzes en el curso configurado
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_quizzes"
}
}Input 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' to fetch quizzes for the configured course and returns them as JSON string.
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, defining 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:49-56 (schema)TypeScript interface defining the structure of a Quiz object, used in the context of quiz data.
interface Quiz { id: number; name: string; timeopen: number; timeclose: number; grade: number; timemodified: number; } - src/index.ts:247-248 (registration)Dispatcher in CallToolRequest handler that routes 'get_quizzes' calls to the getQuizzes() method.
case 'get_quizzes': return await this.getQuizzes(); - src/index.ts:149-153 (schema)Input schema for the get_quizzes tool, specifying no required parameters.
inputSchema: { type: 'object', properties: {}, required: [], },