@extends('task.layout') @section('content')
ルーブリック名 / 項目名
| No. | 評価指標 | 自己評価 | 他者平均 | {{-- 各評価者列(display_name をヘッダに) --}} @foreach(($reviewerids) as $id) @php $reviewer = $otherReviews[$id]; @endphp{{ $reviewer['display_name'] }} | @endforeach
|---|---|---|---|---|
| {{ $i }} | {{-- 0行目:ルーブリック名、以降:指標 --}} @if($i === 0) {{ $labels[$i] ?? '' }} @else {{ $labels[$i] ?? '' }} @endif | {{-- 自己評価 --}} @php $selfPt = $selfPoint[$i] ?? null; @endphp{{ is_numeric($selfPt) ? $selfPt : '—' }} | {{-- 他者平均 --}} @php $avg = $averagepoint[$i] ?? null; @endphp{{ isset($avg) ? number_format($avg, 1) : '—' }} | {{-- 各評価者 --}} @foreach(($reviewerids ?? []) as $rid) @php $pt = $reviewerPoints[$rid][$i] ?? null; @endphp{{ is_numeric($pt) ? $pt : '—' }} | @endforeach
| {{ $commentTitles[$i]->title }} | @php if($selfComments[$i]->comment_name_id === $commentTitles[$i]->id) { $selfCm = $selfComments[$i]->comment; } @endphp {{ isset($selfCm) ? mb_strlen($selfCm) . '文字' : '—' }} | @php $totalLength = 0; $count = 0; foreach(($otherComments ?? []) as $comment) { if ($comment->comment_name_id === $commentTitles[$i]->id && isset($comment->comment)) { $totalLength += mb_strlen($comment->comment); $count++; } } $avgLength = ($count > 0) ? round($totalLength / $count) : null; @endphp {{ isset($avgLength) ? $avgLength . '文字' : '—' }} | @foreach(($reviewerids ?? []) as $rid) @php $comment = null; foreach(($otherComments ?? []) as $c) { if ($c->reviewer_id === $rid && $c->comment_name_id === $commentTitles[$i]->id && isset($c->comment)) { $comment = $c->comment; break; } } @endphp{{ isset($comment) ? mb_strlen($comment) . '文字' : '—' }} | @endforeach