remove column in addiction test
This commit is contained in:
parent
3b8990d6a3
commit
49caec88af
|
@ -37,9 +37,7 @@ public function history()
|
||||||
|
|
||||||
public function addiction()
|
public function addiction()
|
||||||
{
|
{
|
||||||
$items = Item::with('factor')
|
$items = Item::where('status', 'active')->get();
|
||||||
->get()
|
|
||||||
->groupBy('factor.name');
|
|
||||||
|
|
||||||
$likerts = Likert::orderBy('score')->get();
|
$likerts = Likert::orderBy('score')->get();
|
||||||
return view('user.addiction', compact('items', 'likerts'));
|
return view('user.addiction', compact('items', 'likerts'));
|
||||||
|
|
|
@ -20,20 +20,13 @@
|
||||||
<table class="table table-bordered w-100 text-wrap align-middle">
|
<table class="table table-bordered w-100 text-wrap align-middle">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Factor</th>
|
|
||||||
<th class="text-center">Item</th>
|
|
||||||
<th>Item Content</th>
|
<th>Item Content</th>
|
||||||
<th class="text-center">Select Answer</th>
|
<th class="text-center">Select Answer</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($items as $factorName => $groupedItems)
|
@foreach ($items as $item)
|
||||||
@foreach ($groupedItems as $item)
|
|
||||||
<tr>
|
<tr>
|
||||||
@if ($loop->first)
|
|
||||||
<td rowspan="{{ $groupedItems->count() }}">{{ $factorName }}</td>
|
|
||||||
@endif
|
|
||||||
<td class="text-center">{{ $item->code }}</td>
|
|
||||||
<td class="text-wrap">{{ $item->content }}</td>
|
<td class="text-wrap">{{ $item->content }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<input type="hidden" name="values[]" value="{{ $item->value }}">
|
<input type="hidden" name="values[]" value="{{ $item->value }}">
|
||||||
|
@ -48,7 +41,6 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endforeach
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue