get('mdl_course_categories');
$todos_los_cursos = $moodle_db->query("SELECT courseid, fullname, shortname, COALESCE(MIN(calculation) <> '', false) as formula, MAX(AGGREGATIONCOEF) > 0 as ponderacion FROM mdl_grade_items mgi JOIN mdl_course mc ON mc.id = mgi.courseid WHERE itemtype IN ('course', 'category') GROUP BY courseid, fullname, shortname");
function imprimir_curso($category_id = null)
{
global $todas_las_categorías, $todos_los_cursos, $todos_los_items;
# obtener subcategorías
$categories = array_filter($todas_las_categorías, fn ($category) => $category['parent'] == $category_id ?? 0 && count(array_filter($todas_las_categorías, fn ($category) => $category['parent'] == $category_id ?? 0)) > 0);
# print them as an accordion
foreach ($categories as $category) : ?>
= $category['name'] ?>
Curso | Construcción | Ponderación |
---|---|---|
= $course['fullname'] ?> = $course['shortname'] ?> |