Problem Description
I need **$cm->id** Because In latest Moodle 2.6.0 Version. <br/>
`$context = get_context_instance(CONTEXT_MODULE, $courseId);` <br/> Not Working Above Code. <br/>
Instead Of this given code I need to implement.
**$contextmodule = context_module::instance($cm->id);** <br/>
Use of this code i need **$contextId**;
Hence my point is how can I get $cm->id Or $contextmodule using $courseId.
Thanks in advance.
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?