@extends('task.layout') @section('content')

ルーブリック名 / 項目名

{{ $task->context_title }} {{ $task->title }} 被評価結果一覧

被評価者: {{ $user->display_name }}
{{-- 左側: 条件情報ブロック --}}
条件情報(集計情報として何を表示するか検討要
評価数:{{ is_iterable($reviewerids ?? []) ? count($reviewerids) : 0 }}
良い点(平均文字数、最大文字数)/改善点(平均文字数、最大文字数)
{{-- 右側: ルーブリック一覧ボタン --}}
ルーブリック一覧
{{-- ===== メイン表 ===== --}}
被評価一覧
{{-- データ準備 --}} @php $labels = $rubricitems ?? collect(); $rowCount = is_countable($labels) ? count($labels) : 0; // 評価者リスト(自己評価、他者平均も含む) $reviewersList = collect([ (object)['id' => 'self', 'display_name' => '自己評価', 'type' => 'point'], (object)['id' => 'avg', 'display_name' => '他者平均', 'type' => 'point'], ]); foreach(($reviewerids ?? []) as $id) { $reviewer = $otherReviews[$id]; $reviewersList->push((object)[ 'id' => $id, 'display_name' => $reviewer['display_name'], 'type' => 'reviewer' ]); } @endphp {{-- === 行列切替前の表 === --}}
{{-- 各評価者列(display_name をヘッダに) --}} @foreach(($reviewerids) as $id) @php $reviewer = $otherReviews[$id]; @endphp @endforeach @for($i = 0; $i < $rowCount; $i++) @php // 最後の行 (i = rowCount - 1) の場合にのみ bd-thick-bottom クラスを追加 $lastRowClass = ($i === $rowCount-1) ? 'bd-thick-bottom' : ''; @endphp {{-- 自己評価 --}} @php $selfPt = $selfPoint[$i] ?? null; @endphp {{-- 他者平均 --}} @php $avg = $averagepoint[$i] ?? null; @endphp {{-- 各評価者 --}} @foreach(($reviewerids ?? []) as $rid) @php $pt = $reviewerPoints[$rid][$i] ?? null; @endphp @endforeach @endfor {{-- 改善点行 --}} @for($i = 0; $i < count($commentTitles); $i++) @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 @endforeach @endfor
No. 評価指標 自己評価 他者平均 {{ $reviewer['display_name'] }}
{{ $i }} {{-- 0行目:ルーブリック名、以降:指標 --}} @if($i === 0) {{ $labels[$i] ?? '' }} @else {{ $labels[$i] ?? '' }} @endif {{ is_numeric($selfPt) ? $selfPt : '—' }} {{ isset($avg) ? number_format($avg, 1) : '—' }} {{ is_numeric($pt) ? $pt : '—' }}
{{ $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 . '文字' : '—' }} {{ isset($comment) ? mb_strlen($comment) . '文字' : '—' }}
{{-- === 行列を切り替えた表 === --}}
※ 評価者が評価した被評価者または被評価グループ一覧が表示される
※ 被評価者名をクリックすると、評価結果の詳細へ
戻る
@endsection @push('scripts') @endpush