@extends('layouts.app') @section('title', 'Review Feedback #{{ $surveyResponse->id }}') @push('styles') @endpush @section('content')
{{-- LEFT: Meta + Q&A --}}
{{-- Collector info --}}

Collector Information

Submitted {{ $surveyResponse->submitted_at?->diffForHumans() }}
Employee Name
{{ $surveyResponse->employeeCollector?->employee_name ?? '—' }}
Employee ID
{{ $surveyResponse->employeeCollector?->employee_id ?? '—' }}
Department
{{ $surveyResponse->employeeCollector?->department ?? '—' }}
Location
{{ $surveyResponse->employeeCollector?->location ?? '—' }}
Respondent Name
{{ $surveyResponse->employeeCollector?->respondent_name ?? '—' }}
Respondent Phone
{{ $surveyResponse->employeeCollector?->respondent_phone ?? '—' }}
Relationship Source
{{ ucfirst(str_replace('_', ' ', $surveyResponse->employeeCollector?->relationship_source ?? '—')) }}
Language
{{ $surveyResponse->language === 'bn' ? '🇧🇩 বাংলা' : '🇬🇧 English' }}
{{-- Q&A --}}

Survey Answers

{{ $surveyResponse->answers->count() }} questions
@foreach($surveyResponse->answers as $i => $answer)
{{ $i+1 }} {{ $surveyResponse->language === 'bn' && $answer->question->question_text_bn ? $answer->question->question_text_bn : $answer->question->question_text }}
@php $hasAnswer = ($answer->answer_text && trim($answer->answer_text) !== '') || (!empty($answer->answer_options)); @endphp @if(!$hasAnswer)
No answer provided
@elseif($answer->answer_text)
{{ $answer->answer_text }}
@elseif($answer->answer_options)
@php $opts = $answer->answer_options; @endphp @if(is_array($opts)) @foreach($opts as $opt) @php // Try to get label from question options JSON $label = $opt; $qOpts = $answer->question->options; if (is_array($qOpts)) { foreach ($qOpts as $qo) { if (($qo['value'] ?? null) === $opt) { $label = $surveyResponse->language === 'bn' && isset($qo['label_bn']) ? $qo['label_bn'] : ($qo['label'] ?? $opt); } } } @endphp
{{ $label }}
@endforeach @else {{ $opts }} @endif
@endif
@endforeach
{{-- RIGHT: Scoring + Comments --}}
{{-- Score card --}}

Score & Flags

{{-- Points display --}}
{{ $surveyResponse->feedbackScore?->points_awarded ?? 1 }}
points awarded
@if($surveyResponse->feedbackScore?->scored_at)
Reviewed {{ $surveyResponse->feedbackScore->scored_at->diffForHumans() }}
@endif
{{-- Flag toggles --}} @php $score = $surveyResponse->feedbackScore; @endphp
@csrf
@csrf
@csrf
{{-- Comments --}}

Management Notes

{{ $surveyResponse->managementComments->count() }} note{{ $surveyResponse->managementComments->count() !== 1 ? 's' : '' }}
{{-- Add comment --}}
@csrf @error('comment')
{{ $message }}
@enderror
{{-- Existing comments --}} @if($surveyResponse->managementComments->count())
@foreach($surveyResponse->managementComments->sortByDesc('created_at') as $comment)
{{ $comment->user?->name ?? 'Unknown' }} — {{ $comment->created_at->format('d M Y, h:i A') }}
{{ $comment->comment }}
@endforeach
@endif
@endsection