@if ($evaluation->archivo)
@php
$isImage = preg_match('/\.(jpg|jpeg|png|gif|webp)$/i', $evaluation->archivo);
$isPDF = preg_match('/\.pdf$/i', $evaluation->archivo);
$isGoogleForm = Str::contains($evaluation->archivo, ['forms.gle', 'docs.google.com/forms']);
$isYouTube = Str::contains($evaluation->archivo, ['youtube.com', 'youtu.be']);
$isPath = !Str::startsWith($evaluation->archivo, ['http://', 'https://']);
if ($isGoogleForm) {
$embedLink = str_replace('viewform', 'viewform?embedded=true', $evaluation->archivo);
} elseif ($isYouTube) {
if (Str::contains($evaluation->archivo, 'watch?v=')) {
$videoId = explode('v=', parse_url($evaluation->archivo, PHP_URL_QUERY))[0] ?? null;
} else {
$videoId = Str::afterLast($evaluation->archivo, '/');
}
$embedLink = 'https://www.youtube.com/embed/' . $videoId;
} else {
$embedLink = $evaluation->archivo;
}
@endphp
@if ($isPath)
@endif
@if ($isPath)
Vista protegida — desbloquee un acceso temporal
@else
@if ($isImage)

@elseif($isPDF)
@elseif($isGoogleForm)
@elseif($isYouTube)
@else
Archivo no compatible
@endif
@endif
{{ $evaluation->title }}
{{ $evaluation->created_at->format('d/m/Y') }}
Volver
@else
No hay archivo asociado.
@endif
@if ($users->count() > 0)
@foreach ($users as $user)
@endforeach
@else
No hay usuarios asignados a esta evaluación.
@endif
@if (method_exists($users, 'links') && $users->total() > $users->perPage())
@endif