@extends('layouts.student_dashboard') @section('title', 'Practice Questions') @push('styles') @endpush @section('content') @php $courseData = \Illuminate\Support\Facades\DB::table('courses')->where('id', $course_id)->first(); $moduleData = \Illuminate\Support\Facades\DB::table('modules')->where('id', $module_id)->first(); $topicData = \Illuminate\Support\Facades\DB::table('topics')->where('id', $topic_id)->first(); $mcqTotalCount = count($mcq_questions ?? []); $codingTotalCount = count($coding_questions ?? []); $mcqSolvedIds = $completed_mcqs ?? []; $codingSolvedIds = $completed_codings ?? []; $mcqSolvedCount = 0; foreach ($mcq_questions as $m) { if (in_array($m->id, $mcqSolvedIds)) $mcqSolvedCount++; } $codingSolvedCount = 0; foreach ($coding_questions as $c) { if (in_array($c->id, $codingSolvedIds)) $codingSolvedCount++; } $totalQuestionsAll = $mcqTotalCount + $codingTotalCount; $totalSolvedAll = $mcqSolvedCount + $codingSolvedCount; $overallPct = $totalQuestionsAll > 0 ? (int) round(($totalSolvedAll / $totalQuestionsAll) * 100) : 0; @endphp
{{ $mcqTotalCount }} fun {{ \Illuminate\Support\Str::plural('quiz', $mcqTotalCount) }} in this mission
{{ strip_tags($mcq->question) }}
No quizzes have been added for this mission yet.
{{ $codingTotalCount }} coding {{ \Illuminate\Support\Str::plural('puzzle', $codingTotalCount) }} in this mission
{{ $code->title }}
No coding puzzles have been added for this mission yet.