@extends('layouts.app') @section('content')
Statystyki {{ $testData->name }}
@php $x = 1; @endphp @foreach ($testData->questions as $question)

Pytanie {{ $x++ }}. {{ $question->question }}

Czas na odpowiedź: {{ $question->time }}s Mnożnik punktów: x{{ $question->multiplier }} Typ: {{ $question->open ? "otwarte" : ($question->arrange ? "ułóż według kolejności" : "zamknięte")}} Liczba odpowiedzi: @if($question->arrange) {{ round(count($question->playeranswers)/count($question->answers)) }} @else {{ count($question->playeranswers) }} @endif
@if($question->photo) Obrazek @endif
@if($question->open)
Prawidłowa odpowiedź:  
@foreach ($question->answers as $answer) {{ $answer->answer }}, @endforeach @elseif($question->closed) @foreach ($question->answers as $answer) @endforeach @elseif($question->arrange)
{{ $answer->answer }} @php $percent = count($question->playeranswers) ? round(100*(count($answer->player_answers)/(count($question->playeranswers)))) : 0 @endphp
{{ $percent }}%
@foreach ($question->answers as $answer) @php $place = array_fill(0, count($question->answers),0); foreach ($answer->player_answers as $answerr){ $place[$answerr->order_ans]++; } @endphp @endforeach @endif
Miejsce odpowiedzi:
@for($i = 1; $i <= count($question->answers); $i++)
{{ $i }}
@endfor
{{ $answer->answer }}
@for($i=0; $i < count($place); $i++)
{{ count($answer->player_answers) ? round($place[$i]*100/count($answer->player_answers)) : 0 }}%
@endfor
@if($question->open)

Odpowiedzi:

@if(count($question->playeranswers) > 0) @php $tmp = $question->playeranswers[0]->answer_open; $counter = 0 @endphp @foreach ($question->playeranswers as $answer) @if(empty($answer->answer_open)) @continue; @endif @if($tmp != $answer->answer_open && !empty($tmp))
{{ $tmp }} @if($counter > 1) x{{$counter }} @endif
@php $counter = 0 @endphp @endif @php $tmp = $answer->answer_open; $counter++ @endphp @endforeach
{{ $tmp }} @if($counter > 1) x{{$counter }} @endif
@endif
@endif
@endforeach
@include('blocks.knt.statistic-details') @endsection @section('style') @endsection @section("scripts") @endsection