@extends('layouts.app')
@section('admin_title', 'Manage Skill Based Course')
@section('content')
@if($errors->any())
@foreach($errors->all() as $e)
- {{ $e }}
@endforeach
@endif
@if(session('error'))
{{ session('error') }}
@endif
@if($skillCourses->isEmpty())
@else
@endif
@if($selectedCourse && $selectedModule && $selectedTopic)
Active Coding Topic
{{ $selectedCourse->coursename }}
/
{{ $selectedModule->module }}
/
{{ $selectedTopic->topic }}
@if($isSql)
SQL Mode
@endif
{{ $questions->total() }} Question(s)
Add {{ $isSql ? 'SQL ' : '' }}Coding Question
| S.No |
Title |
Level |
Test Cases |
Actions |
@forelse($questions as $idx => $q)
@php
$lvl = strtolower((string) $q->level);
$lvlClass = $lvl === 'hard' ? 'sa-badge-hard' : ($lvl === 'medium' ? 'sa-badge-medium' : 'sa-badge-easy');
$tcCount = 0;
if ($isSql) {
$tcCount = trim((string) $q->t1) !== '' ? 1 : 0;
} else {
foreach (['t1', 't2', 't3', 't4'] as $tk) {
if (trim((string) ($q->$tk ?? '')) !== '') {
$tcCount++;
}
}
}
$qPayload = [
'id' => $q->id,
'title' => $q->title,
'level' => ucfirst(strtolower((string) $q->level)),
'question' => $q->question,
'answer' => $q->answer,
'solution' => $q->solution,
'i1' => $q->i1 ?? '',
'i2' => $q->i2 ?? '',
'i3' => $q->i3 ?? '',
'i4' => $q->i4 ?? '',
't1' => $q->t1 ?? '',
't2' => $q->t2 ?? '',
't3' => $q->t3 ?? '',
't4' => $q->t4 ?? '',
];
@endphp
| {{ ($questions->currentPage() - 1) * $questions->perPage() + $idx + 1 }} |
{{ $q->title }}
{{ \Illuminate\Support\Str::limit(strip_tags((string) $q->question), 90) }}
|
{{ ucfirst(strtolower((string) $q->level)) }}
|
{{ $tcCount }} / {{ $isSql ? 1 : 4 }}
|
|
@empty
|
No coding questions added for this topic yet. Use the form above to add your first question.
|
@endforelse
@if($questions->hasPages())
@endif
Question
Expected Answer / Code
Edit Coding Question
@elseif($skillCourses->isNotEmpty())
Select a Module & Topic to Begin
Pick a Skill-Based Course, Module, and Topic above to add or manage coding questions.
@endif
@endsection