@extends('layouts.main') @section('content')
{{$title}}
@foreach ($sections as $section)
{{ $section->name }} @foreach ($section->questions as $question) @php $data = App\Answer::where('answers.question_id', $question->id) ->where('answers.feedback_assessment_id', $assesment->id) ->join('question_responses', 'answers.question_response_id', '=', 'question_responses.id') ->selectRaw('question_responses.text_response, question_responses.mark, COUNT(answers.feedback_assessment_id) as response_count') ->groupBy('question_responses.text_response', 'question_responses.mark') ->orderBy('response_count', 'DESC') ->get(); $labels = $data->pluck('text_response')->toArray(); $counts = $data->pluck('response_count')->toArray(); $totalResponses = array_sum($counts); @endphp

{{ $question->question }}

@if ($question->answer_type != 'none')
@endif @php $comments = App\Answer::select('remarks', 'customer_id', 'user_id', 'created_at') ->where('answers.question_id', $question->id) ->where('feedback_assessment_id', $assesment->id) ->whereNotNull('remarks') ->get(); @endphp @foreach ($comments as $comment)

{{ $comment->customer->name."-".$comment->customer->phone_number." - ".$comment->customer->address }}: {{ $comment->remarks }} - {{ $comment->created_at }} {{ $comment->user->name }}

@endforeach @if ($question->answer_type != 'none') @push('scripts') @endpush @endif @endforeach
@endforeach @endsection @push('scripts') @endpush