ENTRENADOR DE ACTIVIDADES PAU 2027
{{ strtoupper((string) ($generatorName ?? '')) }}
{{ (string) ($communityName ?? '') }}
{{ isset($scoreTen) ? number_format((float) $scoreTen, 1, ',', '') : '0,0' }}
{{ strtoupper((string) ($summaryTitle ?? '')) }}
{{ (string) ($summaryText ?? __('trainer.feedback_summary_text')) }}

DETALLE POR PREGUNTAS

Revisa tus respuestas y el feedback de cada pregunta.

@foreach (($details ?? []) as $detail) @php $statusKey = (string) ($detail['status_key'] ?? 'improvable'); $statusClass = $statusKey === 'correct' ? 'card--ok' : ($statusKey === 'insufficient' ? 'card--ko' : 'card--imp'); $badgeText = $statusKey === 'correct' ? 'Correcta' : ($statusKey === 'insufficient' ? 'Insuficiente' : 'Mejorable'); $icon = $statusKey === 'correct' ? public_path('/imgs/icons/check-circle.png') : ($statusKey === 'insufficient' ? public_path('/imgs/icons/x-circle.png') : public_path('/imgs/icons/exclaimation-circle.png')); $structure = $detail['block_structure'] ?? null; $hasDirect = is_array($structure) && !empty($structure['direct'] ?? []); $hasGroups = is_array($structure) && !empty($structure['groups'] ?? []); @endphp
{{ ($detail['number'] ?? '') }}.- {!! (string) ($detail['statement'] ?? '') !!}
Resultado: {{ isset($detail['score']) ? $detail['score'] . '/' . ($detail['max_score'] ?? 2) . ' puntos' : '0/2 puntos' }}
{{ $badgeText }}
@if ($hasDirect || $hasGroups)
@if ($hasDirect)
@foreach ($structure['direct'] as $item)
{!! $item['question'] ?? '' !!} @if (($item['type'] ?? '') === 'match' && !empty($item['matches']))
@foreach ($item['matches'] as $match)
{{ $match['left'] ?? '' }}
@endforeach
@foreach ($item['matches'] as $match)
{{ $match['right'] ?? '' }}
@endforeach
@endif @if (($item['type'] ?? '') === 'test' && !empty($item['test_options']))
    @foreach ($item['test_options'] as $option)
  • {{ $option }}
  • @endforeach
@endif
@endforeach
@endif @if ($hasGroups) @foreach ($structure['groups'] as $group) @if (!empty($group['title']))
{!! $group['title'] !!}
@endif @if (!empty($group['items']))
@foreach ($group['items'] as $item)
{!! $item['question'] ?? '' !!} @if (($item['type'] ?? '') === 'match' && !empty($item['matches']))
@foreach ($item['matches'] as $match)
{{ $match['left'] ?? '' }}
@endforeach
@foreach ($item['matches'] as $match)
{{ $match['right'] ?? '' }}
@endforeach
@endif @if (($item['type'] ?? '') === 'test' && !empty($item['test_options']))
    @foreach ($item['test_options'] as $option)
  • {{ $option }}
  • @endforeach
@endif
@endforeach
@endif @endforeach @endif
@endif

Tu respuesta es:

@php $answerHtml = (string) ($detail['user_answer'] ?? 'Sin respuesta'); $containsWiris = str_contains($answerHtml, '/i', static function ($matches) { $math = $matches[0] ?? ''; $src = 'https://www.wiris.net/demo/editor/render.png?mml=' . rawurlencode($math); try { $response = \Illuminate\Support\Facades\Http::timeout(15)->get($src); if ($response->ok()) { $mime = $response->header('Content-Type') ?: 'image/png'; $base64 = base64_encode($response->body()); return 'formula'; } } catch (\Throwable $exception) { } return 'formula'; }, $answerHtml) ?? $answerHtml; $pdfAnswerLineHtml = $pdfAnswerHtml; if ($containsWiris) { libxml_use_internal_errors(true); $pdfAnswerDocument = new \DOMDocument('1.0', 'UTF-8'); $loadedPdfAnswer = $pdfAnswerDocument->loadHTML( '
' . $pdfAnswerHtml . '
', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD ); if ($loadedPdfAnswer) { $pdfAnswerWrapper = $pdfAnswerDocument->getElementsByTagName('div')->item(0); $pdfAnswerChunks = []; if ($pdfAnswerWrapper instanceof \DOMElement) { foreach ($pdfAnswerWrapper->childNodes as $childNode) { if ($childNode instanceof \DOMText) { $textLines = preg_split('/\R/u', $childNode->nodeValue ?? '') ?: []; foreach ($textLines as $textLine) { $textLine = trim((string) $textLine); if ($textLine !== '') { $pdfAnswerChunks[] = '
' . e($textLine) . '
'; } } continue; } if (!$childNode instanceof \DOMElement) { continue; } $tagName = strtolower($childNode->tagName); if (in_array($tagName, ['p', 'div'], true)) { $innerHtml = ''; foreach ($childNode->childNodes as $innerNode) { $innerHtml .= $pdfAnswerDocument->saveHTML($innerNode); } $innerHtml = trim($innerHtml); if ($innerHtml !== '') { $pdfAnswerChunks[] = '
' . $innerHtml . '
'; } continue; } $nodeHtml = trim($pdfAnswerDocument->saveHTML($childNode)); if ($nodeHtml !== '') { $pdfAnswerChunks[] = $nodeHtml; } } } if (count($pdfAnswerChunks) > 0) { $pdfAnswerLineHtml = implode('', $pdfAnswerChunks); } } libxml_clear_errors(); } $plainAnswer = str_ireplace(['
', '
', '
'], "\n", $answerHtml); $plainAnswer = trim(strip_tags($plainAnswer)); $plainAnswer = preg_replace('/\s+([b-z]\)\s)/iu', "\n$1", $plainAnswer) ?? $plainAnswer; $plainLines = preg_split('/\R/u', $plainAnswer) ?: []; $plainLines = array_values(array_filter( array_map(static fn ($line) => trim((string) $line), $plainLines), static fn ($line) => $line !== '' )); @endphp
@if ($containsWiris) {!! $pdfAnswerLineHtml !!} @elseif (count($plainLines) > 0) @foreach ($plainLines as $line)
{{ $line }}
@endforeach @else Sin respuesta @endif

Feedback:

{{ $detail['feedback'] ?? '' }}

@endforeach