Hello!
I am using a custom 'local' page to draw course grades. It works really well but I need a dropdown list to choose the student I want to view.
I found this code on these forums somewhere, and it works... but there are several students missing - maybe up to 10% - and I don't know what is wrong with the code. Any ideas?
I am open to get_enrolled_users as an alternative but I can't figure that out and can't find examples of it being used in a custom page.
Here is the code that results in a few missing - please help - thanks so much
Andrew
///////////////
$user_details_cat = $DB->get_records_sql("SELECT `u`.`firstname`, `u`.`lastname`, `u`.`email`, `u`.`id` FROM `mdlt2_role_assignments` AS `ra` JOIN `mdlt2_context` AS `context` ON `context`.`id` = `ra`.`contextid` AND `context`.`contextlevel` = 50 JOIN `mdlt2_course` AS `c` ON `c`.`id` = `context`.`instanceid` AND `c`.`id` = ".$currentCourse." JOIN `mdlt2_user` AS `u` ON `u`.`id` = `ra`.`userid`");