Get correct id in lesson activity link.

Re: Get correct id in lesson activity link.

by Adrian Greeve -
Number of replies: 1
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers

Hello Amir,

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"
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.
Best of luck with your plugin.

Average of ratings:Useful (1)
In reply to Adrian Greeve

Re: Get correct id in lesson activity link.

by Amir Mustafa -

Thank you Adrian

Your solution worked like a charm smile smile