From 461055485c6e09328accbe66f1511494378ea52c Mon Sep 17 00:00:00 2001 From: yash Date: Wed, 17 Jul 2024 18:03:26 +0530 Subject: [PATCH] Added tabs to view responses and statistics seperately for individual responses. --- .../views/responses/viewResponse.blade.php | 346 +++++++++++------- 1 file changed, 222 insertions(+), 124 deletions(-) diff --git a/resources/views/responses/viewResponse.blade.php b/resources/views/responses/viewResponse.blade.php index 5f0949d..9c76a99 100644 --- a/resources/views/responses/viewResponse.blade.php +++ b/resources/views/responses/viewResponse.blade.php @@ -1,77 +1,3 @@ -{{-- - - - - - - - - - - Response Detail - - - - -
-
-
- - Google Form Icon - -

{{ $form->title }} - Response Detail

-
-
-
- -
-
-

Response from {{ $responses->first()->user->name ?? 'Anonymous' }} - {{ $responses->first()->submitted_at }}

- - @foreach ($responses as $response) - @php - $question = $questions[$response->question_id] ?? null; - $decodedAnswers = json_decode($response->answers, true); - @endphp - - @if ($question) -
-

{{ $question->question_text }}

- @if ($question->type == 'dropdown') - - @elseif (in_array($question->type, ['multiple_choice', 'checkbox'])) -
- @foreach (json_decode($question->options) as $option) - - @endforeach -
- @else -

{{ is_array($decodedAnswers) ? implode(', ', $decodedAnswers) : $decodedAnswers }}

- @endif -
- @else -

Question not found for ID: {{ $response->question_id }}

- @endif - @endforeach -
-
- - - - - --}} - - - @@ -84,67 +10,167 @@ - + + {{-- --}} + - +
-
-
- - Google Form Icon - -

{{ $form->title }} - Response Detail

+
+ + Google Form Icon + +

{{ $form->title }} - Response Detail

+
+
+
+ + + +
    +
  • + +
  • +
  • + +
  • +
-
-
-
-
- - + +
+ +
+
+
+
+ + +
+
+ + @foreach ($responses as $response) + @php + $question = $questions[$response->question_id] ?? null; + $decodedAnswers = json_decode($response->answers, true); + @endphp + + @if ($question) +
+

{{ $question->question_text }}

+ @if ($question->type == 'dropdown') + + @elseif (in_array($question->type, ['multiple_choice', 'checkbox'])) +
+ @foreach (json_decode($question->options) as $option) +
+ + {{ $option }} +
+ @endforeach +
+ @else +

{{ is_array($decodedAnswers) ? implode(', ', $decodedAnswers) : $decodedAnswers }}

+ @endif +
+ @else +

Question not found for ID: {{ $response->question_id }}

+ @endif + @endforeach +
-
-

Response from {{ $responses->first()->user->name ?? 'Anonymous' }} - {{ $responses->first()->submitted_at }}

- @foreach ($responses as $response) - @php - $question = $questions[$response->question_id] ?? null; - $decodedAnswers = json_decode($response->answers, true); - @endphp - - @if ($question) -
-

{{ $question->question_text }}

- @if ($question->type == 'dropdown') - - @elseif (in_array($question->type, ['multiple_choice', 'checkbox'])) -
- @foreach (json_decode($question->options) as $option) -
- - {{ $option }} -
- @endforeach -
- @else -

{{ is_array($decodedAnswers) ? implode(', ', $decodedAnswers) : $decodedAnswers }}

- @endif -
- @else -

Question not found for ID: {{ $response->question_id }}

- @endif - @endforeach + +
+

Statistics

+ +
+ +
+ +
+ +
@@ -154,7 +180,79 @@
+ + + + +