:::

4-5 /resources/views/exam/topic.blade.php

@forelse($exam->topics as $key => $topic)
    <dl>
        <dt class="h3">            
            @can('建立測驗')
                {{-- <button type="button" class="btn btn-danger btn-del-topic" data-id="{{ $topic->id }}">刪除</button> --}}
                <a href="#" class="btn btn-danger btn-del-topic" data-id="{{ $topic->id }}">刪除</a>
                <a href="{{ route('topic.edit', $topic->id) }}" class="btn btn-warning">編輯</a>
                ({{ $topic->ans }})
            @endcan
            <span class="badge badge-success">{{ $key+1 }}</span>                
            {{ $topic->topic }}
        </dt>
        <dd class="opt">
            {{ bs()->hidden("ans[$topic->id]", 0) }}
            {{ bs()->radioGroup("ans[$topic->id]", [
                1 => "&#10102; $topic->opt1", 
                2 => "&#10103; $topic->opt2",  
                3 => "&#10104; $topic->opt3",  
                4 => "&#10105; $topic->opt4", 
                ])
                ->selectedOption((Auth::user() and Auth::user()->can('建立測驗'))?$topic->ans:0)
                ->addRadioClass(['my-1','mx-3'])}}
        </dd>
    </dl>
@empty
    <div class="alert alert-danger">
        尚無題目
    </div>
@endforelse

 


:::

書籍目錄

展開 | 闔起

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

計數器

今天: 1968196819681968
昨天: 4038403840384038
總計: 5565931556593155659315565931556593155659315565931