:::

4-6 /resources/views/exam/test.blade.php

@extends('layouts.app') 

@section('content')
    
    <h1 class="text-center">{{ $test->exam->title }}</h1>
    <div class="row">
        <div class="col-sm-6">
            <h2>測驗日期:<u>{{ $test->created_at->format('Y年m月d日 H:i:s') }}</u></h2>
        </div>
        <div class="col-sm-6 text-right">
            <h2>
                <u> {{ $test->grade }} </u>年<u> {{ $test->class }} </u>班<u> {{ $test->num }} </u>號
                姓名:<u> {{ $test->user->name }} </u>
                得分:<b class="
                @if($test->score >= 60)
                    text-info
                @else
                    text-danger
                @endif
                ">{{ $test->score }}</b> 分
            </h2>
        </div>
    </div>

    <hr>

    @foreach($content as $i => $data)
        <dl>
            <dt class="h3">  
                @if($data['ans']==$data['topic']->ans)
                    <img src="{{ asset('yes.png') }}" alt="答對了!" title="答對了!">
                @else
                    <img src="{{ asset('no.png') }}" alt="答錯!正確解答為「{{ $data['topic']->ans }}」" title="答錯!正確解答為「{{ $data['topic']->ans }}」">
                @endif
                ({{ $data['ans'] }})          
                <span class="badge badge-success">{{ $i }}</span>                
                {{ $data['topic']->topic }}
            </dt>
            <dd class="opt">
                {{ bs()->radioGroup("ans[{$data['topic']->id}]", [
                    1 => "&#10102; {$data['topic']->opt1}", 
                    2 => "&#10103; {$data['topic']->opt2}",  
                    3 => "&#10104; {$data['topic']->opt3}",  
                    4 => "&#10105; {$data['topic']->opt4}", 
                    ])
                    ->selectedOption($data['topic']->ans)
                    ->addRadioClass(['my-1','mx-3'])}}
            </dd>
        </dl>
    @endforeach

@endsection

 


:::

書籍目錄

展開 | 闔起

https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D41%26tbdsn%3D1331

計數器

今天: 997997997
昨天: 4125412541254125
總計: 5553007555300755530075553007555300755530075553007