@if($puedeGestionar && !empty($gradebook['categorias'])) @php $flatCategories = []; $flattenCategories = function (array $nodes, int $depth = 0) use (&$flattenCategories, &$flatCategories) { foreach ($nodes as $node) { $flatCategories[] = ['id' => $node['id'], 'nombre' => $node['nombre'], 'depth' => $depth, 'es_raiz' => $node['es_raiz']]; if (! empty($node['children'])) { $flattenCategories($node['children'], $depth + 1); } } }; $flattenCategories($gradebook['categorias']); @endphp
Estructura de calificación del curso