@extends('layouts.app') @section('title', __('Questions')) @section('content')

{{ __('Questions') }}

{{ __('Each employee has their own question set. Section weights are fixed at 40, 50 and 10.') }}

@if ($employee) {{ __('Add question') }} @endif
@if (! $employee)
@else
@foreach ($sections as $section) @php($sum = (float) ($totals[$section->id] ?? 0)) @php($ok = abs($sum - $section->weight_percent) < 0.001)
{{ $section->scorer_role->label() }} · {{ $section->name }}{{ $sum }}% / {{ $section->weight_percent }}%
{{ $ok ? __('Weights OK') : __('Must total :n%', ['n' => $section->weight_percent]) }}
@endforeach
@if ($questions->isEmpty()) @else
@foreach ($questions as $q) @endforeach
#{{ __('Title') }}{{ __('Arabic title') }}{{ __('Section') }}{{ __('Scorer') }}{{ __('Weight') }}{{ __('Code') }}{{ __('Actions') }}
{{ $q->sort_order }} {{ $q->title_en }}
{{ \Illuminate\Support\Str::limit($q->description_en, 110) }}
{{ $q->title_ar }} {{ $q->section->name }} {{ $q->section->scorer_role->label() }} {{ (float) $q->weight }}% {{ $q->code }}
@endif
@endif @if ($drawer) @php($d = $drawer) @php($close = route('admin.questions.index', ['employee' => $d->employee_id]))

{{ __('For') }} {{ $employee->name }}

@if ($d->exists) @endif {{ __('Cancel') }}
@if ($d->exists)
@csrf @method('DELETE')
@endif @endif @endsection