@php // The display-mode toolbar icons. The mode ids below are the ones // XrtDisplayModes already defines; this map only records which supplied // file and which spoken name belong to each, so the processing script // stays free of asset paths. Asset::url() is the application's existing // cache-busting helper (the one behind @xrtAsset). $displayModeIcons = collect([ 'ORIGINAL' => ['file' => 'img1.png', 'alt' => 'Original'], 'CONTRAST' => ['file' => 'img2.png', 'alt' => 'Contrast'], 'OO' => ['file' => 'img3.png', 'alt' => 'OO'], 'OS' => ['file' => 'img4.png', 'alt' => 'OS'], 'NEG' => ['file' => 'img5.png', 'alt' => 'Negative'], 'BW' => ['file' => 'img6.png', 'alt' => 'Black and White'], 'HIGH_LUM' => ['file' => 'img7.png', 'alt' => 'High Luminance'], 'LOW_LUM' => ['file' => 'img8.png', 'alt' => 'Low Luminance'], 'METAL' => ['file' => 'img9.png', 'alt' => 'Metal'], 'METAL_SUPP' => ['file' => 'img10.png', 'alt' => 'Metal Suppression'], ])->map(fn (array $icon) => [ 'src' => \App\Support\Asset::url('images/display_modes/'.$icon['file']), 'alt' => $icon['alt'], ])->all(); // Images, question text and the student's own input. Expected answers and // target regions are only present for questions already committed in a // training (immediate feedback) exam - never for an open question. $config = $payload + [ 'displayModeIcons' => $displayModeIcons, 'csrf' => csrf_token(), 'student' => ['name' => auth('student')->user()->name, 'studentId' => auth('student')->user()->student_id], 'urls' => [ 'answer' => route('student.attempts.answer', ['attempt' => $attempt, 'question' => '__QUESTION__']), 'time' => route('student.attempts.time', $attempt), 'review' => route('student.attempts.review', $attempt), 'result' => route('student.attempts.result', $attempt), ], ]; @endphp