Hi everyone, sorry in advance, I'm new to Moodle
I'd like to test my angular front performing a web service call with the standard web service function core_course_get_course_module_by_instance which has 2 parameters "module" (string - of component type) and "instance" (integer) but how do I find the module name and instance id of a given module?
My course "GDP" has a quiz activity module "test: 1" how can I find out the module name and instance ID?
In the below REST call I have tried the component name "mod_quiz" and the instance id "1":
My error is "Invalid external api parameter: the value is "TEST%1instance=1", the server was expecting "component" type"
But if I try the frankenstyle name "mod_TEST: 1" or variants without punctuation "mod_test_1" don't work either.
The code given in the https://docs.moodle.org/dev/Course_module looks good, but it assumes I already know the
$course = $DB->get_record('course', array('id' => $courseid));
$info = get_fast_modinfo($course);
is the 'course' in this case 'gdp' and then what is the get course id function?
UPDATE: I changed the webservice to be core_course_get_contents instead because that only uses the course ID which is visible in the URL of the course after you click on it: https://your.moodle.com/course/view.php?id=3
not only that but this function is much more useful (for my learning purposes) because it actually lays out everything in the course in XML format (or you can use moodlewsrestformat=json)