@extends('layouts.app') @section('content')

Report

Pilih Student

@if (!empty($user_id))
Your badge

{{ $current_badge->name }}

Your Score

{{ $final_score }}

Your progress

{{ $percentage }} %

{{ $percentage }}%
Finished test

{{ sizeof($finish_code_tests) }} Test


Code Test Report

@foreach ($code_score as $sc)
@php $q = \App\Models\Question::find($sc->question_id); $c = \App\Models\Content::find($sc->content_id); $score = \App\Models\TotalScore::where('user_id', $user_id) ->where('question_id', $q->id) ->first(); if ($score !== null) { $final = $score->score; } else { $wondering = \App\Models\WonderingScore::where(['user_id' => $user_id]) ->where('content_id', $c->id) ->sum('score'); $exploring = \App\Models\UserScore::where('user_id', $user_id) ->where('question_id', $q->id) ->sum('score'); $final = $wondering + $exploring; } @endphp
{{ $q->question_name }}
Question Name
{{--
@php $f = \Carbon\Carbon::parse($sc->started_at); $t = \Carbon\Carbon::parse($sc->ended_at); $h = $t->diff($f)->format('%Hh %Im %Ss'); @endphp On Timer {{ $sc->on_timer }} Duration: {{ $h }}
{{ $sc->started_at }} {{ $sc->ended_at }}
--}}
@php $err = \App\Models\ExerciseCodeLog::where([ 'user_id' => $user_id, 'question_id' => $sc->question_id, 'is_error' => 1, ]); $sucess = \App\Models\ExerciseCodeLog::where([ 'user_id' => $user_id, 'question_id' => $sc->question_id, 'is_error' => 0, ]); @endphp {{ $err->count() }} Errors
{{ $sucess->count() }} Success
Total Score: {{ $final ?? 0 }}
@endforeach
@endif
@endsection @section('scripts') @endsection