In the plugin I need to put the lesson activity link. At first I though that is the lesson id and gave it. But I am getting errors.
Lesson y is there with id 15 in the mdl_lesson table in the moodle database.
Please guide me.
You need to give the course module id from the mdl_course_modules table in the situation listed above.
You can run the following query to get the course module id that you want:
SELECT cm.id AS "course module id", l.id AS "lesson id"Best of luck with your plugin.
FROM mdl_course_modules cm
JOIN mdl_modules m ON cm.module = m.id AND m.name = 'lesson'
JOIN mdl_lesson l ON cm.instance = l.id
WHERE l.id = 4 -- Change the 4 here to the lesson ID that you want.
Thank you Adrian
Your solution worked like a charm