@extends('layouts.app') @section('admin_title', 'Manage Skill Based Course') @section('content')
@if($errors->any())
@endif @if(session('error'))
{{ session('error') }}
@endif

Manage Skill Based Course

Select a Skill-Based Course, Module, and Topic to add and manage coding questions.

Skill Courses & Syllabus
@if($skillCourses->isEmpty())

No Skill-Based Courses Found

Create a Skill-Based course along with its modules and topics first.

Create Skill-Based Course
@else
@if($selectedCourse && $modules->isEmpty()) This course has no modules yet. Add Modules → @elseif($selectedModule && $topics->isEmpty()) This module has no topics yet. Add Topics → @else Choose a module and topic to open the coding question editor. @endif
@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

@csrf
@if($isSql)
SQL Test Case
@else
Test Cases (Inputs & Expected Outputs)
@php $tcPairs = [ ['idx' => 1, 'label' => 'Very Easy', 'color' => '#10b981'], ['idx' => 2, 'label' => 'Easy', 'color' => '#38bdf8'], ['idx' => 3, 'label' => 'Medium', 'color' => '#f59e0b'], ['idx' => 4, 'label' => 'Hard', 'color' => '#f43f5e'], ]; @endphp @foreach($tcPairs as $tc)
Test Case {{ $tc['idx'] }} — {{ $tc['label'] }}
@endforeach @endif

Questions in "{{ $selectedTopic->topic }}"

Showing {{ $questions->total() }} coding question(s)
@if($search !== '') Clear @endif
@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 @empty @endforelse
S.No Title Level Test Cases Actions
{{ ($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 }}
@csrf @method('DELETE')
No coding questions added for this topic yet. Use the form above to add your first question.
@if($questions->hasPages())
Showing {{ $questions->firstItem() }}–{{ $questions->lastItem() }} of {{ $questions->total() }}
@endif

Question
Expected Answer / Code


                

Edit Coding Question

@csrf @method('PUT')
@if($isSql)
@else @foreach([1 => 'Very Easy', 2 => 'Easy', 3 => 'Medium', 4 => 'Hard'] as $num => $lbl)
@endforeach @endif
@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