@extends('layouts.app') @push('css') @endpush @section('conteudo')

@csrf
@for ($i = 1; $i <= 4; $i++) @endfor @foreach($alunosMatriculados->unique('aluno_id') as $matricula) @php $aluno = $matricula->aluno; $pauta = $pautas->firstWhere('aluno_id', $aluno->id); $numeroCampo = 'numero'; $copCampo = 'cop' . $trimestre; $sinCampo = 'sin' . $trimestre; @endphp {{-- Número --}} {{-- Testes 1 a 4 --}} @php $testesValores = []; @endphp @for ($i = 1; $i <= 4; $i++) @php $campo = 'teste'.$i.'Tr'.$trimestre; $valor = $pauta?->$campo; if ($valor > 0) $testesValores[] = $valor; @endphp @endfor {{-- Média dos testes (MM) --}} @php $mmCampo = 'mmTr'.$trimestre; $mmValor = $pauta?->$mmCampo; $mediaAcs = count($testesValores) > 0 ? round(array_sum($testesValores) / count($testesValores), 2) : 0; @endphp {{-- M.ACS (média dos testes) - só leitura --}} {{-- Avaliação Trimestral (AT / AP) --}} @php $apCampo = 'apTr'.$trimestre; $apValor = $pauta?->$apCampo; @endphp {{-- MT (Média Trimestral) = (2*M.ACS + AT) / 3 --}} @php $mt = ($mediaAcs > 0 && $apValor > 0) ? round((2 * $mediaAcs + $apValor) / 3) : 0; @endphp {{-- Comportamento --}} {{-- Sinalética --}} @endforeach @for ($i = 1; $i <= 4; $i++) @endfor
{{ $classe->nome }} - {{ $nomeDisciplina->nome }} - {{ $trimestre }}º Trimestre
Nome de Aluno G ACS M.ACS AT MT Comportamento Sinalética
{{ $i }}ª
{{ $aluno->pessoa->nome }} {{ substr($aluno->pessoa->genero, 0, 1) }} {{ $mediaAcs > 0 ? $mediaAcs : '' }} {{ $mt > 0 ? $mt : '' }}
Nome de Aluno G ACS M.ACS AT MT Comportamento Sinalética
{{ $i }}ª
{{ $trimestre }}º Trimestre


@endsection @push('js') @endpush