|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/parassaas.edukrypt.in/resources/views/admin/report/ |
Upload File : |
@extends('admin.layout')
@section('content')
<!-- begin::main content -->
<main class="main-content">
<div class="container">
<!-- begin::page header -->
<div class="page-header">
<h3>{{ $mcq->name }}</h3>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ asset('dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active" aria-current="page">
<a href="{{ asset('admin/user-list?query=' . $users->user_unique_id) }}">{{ $users->name }}</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
<a
href="{{ asset('admin/report-dashboard/' . $users->user_unique_id) }}">{{ $courseDetails->name }}</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
<a
href="{{ asset('admin/complete-report/') . '/' . $users->user_unique_id . '/' . $courseDetails->id }}">{{ $mcq->name }}</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Practice Quiz Report</li>
</ol>
</nav>
</div>
<!-- end::page header -->
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-12">
<table class="table table-hover table-striped">
<tr>
<td>Name:</td>
<td>{{ $users->name }}</td>
</tr>
<tr>
<td>Percentile (based on first Attempt):</td>
<td>
@if ($analytic['totalMarks'] > 0)
{{ round(($analytic['yourMarks'] / $analytic['totalMarks']) * 100) }} %
@else
<span>0 %</span>
@endif
</td>
</tr>
<tr>
<td>Your Marks:</td>
<td>{{ $analytic['yourMarks'] }}/{{ $analytic['totalMarks'] }} </td>
</tr>
<tr>
<td>Time Taken:</td>
<td>{{ $mcqHistory->time_taken }} (hh:mm:ss)</td>
</tr>
<tr>
<td>Correct Question:</td>
<td>{{ $analytic['correctQ'] }}</td>
</tr>
<tr>
<td>Incorrect Question:</td>
<td>{{ $analytic['incorrectQ'] }}</td>
</tr>
<tr>
<td>Skipped Question:</td>
<td>{{ $analytic['skipQ'] }}</td>
</tr>
</table>
</div>
<div class="col-md-6">
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
@if (count($mcq_questions) > 0)
@php
$i = 1;
@endphp
@foreach ($mcq_questions as $question)
{{-- Main Question --}}
<table class="table table-bordered">
<tr>
<td>
<p>
<button class="btn btn-sm btn-success">{{ $question->code }}</button>
<button class="btn btn-sm btn-info">{{ $question->tags }}</button>
<button class="btn btn-sm btn-dark">{{ $question->type }}</button>
@if ($question->group_question == '1')
<button class="btn btn-sm btn-warning">Sub Question:
{{ count($question->subquestion()->get()) }}</button>
@endif
</p>
@if ($question->group_question == '1')
<h6>Group Text:</h6>
{!! $question->group_text !!}
@endif
<h6>Question: {{ $i }}</h6>
{!! $question->question !!}
</td>
</tr>
</tr>
{{-- fill --}}
@if ($question->type == 'fill')
<tr>
<td>
@if (!empty($question->answer))
<h6>Correct Answer: {{ $question->answer }} </h6>
@if (!empty($question->user_answers()->first()))
<h6>Your answer: {{ $question->user_answers()->first()->fill_answer }}
</h6>
@if ($question->answer == $question->user_answers()->first()->fill_answer)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
@else
<h6>Min:{{ $question->min }}</h6>
<h6>Max:{{ $question->max }}</h6>
@if (!empty($question->user_answers()->first()))
<h6>Your answer: {{ $question->user_answers()->first()->fill_answer }}
</h6>
@if (
$question->min <= $question->user_answers()->first()->fill_answer &&
$question->max >= $question->user_answers()->first()->fill_answer)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
@endif
</td>
</tr>
@endif
{{-- mcq --}}
@if ($question->type == 'mcq')
@php
$p = 1;
$flagQuestion = 0;
@endphp
@foreach ($question->options()->get() as $option)
<tr>
<td>
<b>Option: {{ $p }}</b>
{{-- Correct Option --}}
@if ($option->correct == 1)
<i class="text-success fa fa-check fa-lg"></i>
@endif
{!! $option->options !!}
{{-- Your Option --}}
@foreach ($question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->get() as $user_answer)
@if ($user_answer->option_id == $option->id)
@if ($option->correct == 1)
@php
$flagQuestion++;
@endphp
<b class="text-success">(Your Answer)</b>
@else
<b class="text-danger">(Your Answer)</b>
@endif
@endif
@endforeach
</td>
</tr>
@php
$p++;
@endphp
@endforeach
<tr>
<td>
<h6>
@if ($question->user_answers()->count() > 0)
@if ($question->options()->where('correct', 1)->count() == $flagQuestion)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-danger">Your Answer is wrong</b>
<button
class="btn btn-danger btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
</h6>
</td>
</tr>
@endif
{{-- Single --}}
@if ($question->type == 'single_mcq')
@php
$p = 1;
$flagQuestion = false;
@endphp
@foreach ($question->options()->get() as $option)
<tr>
<td>
<b>Option: {{ $p }}</b>
@if ($option->correct == 1)
<i class="text-success fa fa-check fa-lg"></i>
@endif
{!! $option->options !!}
{{-- Your Option --}}
@foreach ($question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->get() as $user_answer)
@if ($user_answer->option_id == $option->id)
@if ($option->correct == 1)
@php
$flagQuestion = true;
@endphp
<b class="text-success">(Your Answer)</b>
@else
<b class="text-danger">(Your Answer)</b>
@endif
@endif
@endforeach
</td>
</tr>
@php
$p++;
@endphp
@endforeach
<tr>
<td>
<h6>
@if ($question->user_answers()->count() > 0)
@if ($flagQuestion)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-danger">Your Answer is wrong</b>
<button
class="btn btn-danger btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
</h6>
</td>
</tr>
@endif
{{-- T/F --}}
@if ($question->type == 'true_false')
@php
$p = 1;
$flagQuestion = false;
@endphp
@foreach ($question->options()->get() as $option)
<tr>
<td>
<b>Option: {{ $p }}</b>
{!! $option->options !!}
{{-- Correct Option --}}
@if ($option->correct == 1)
<i class="text-success fa fa-check fa-lg"></i>
@endif
{{-- Your Option --}}
@if ($question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->count() > 0)
@if ($question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()->option_id == $option->id)
@if ($option->correct == 1)
@php
$flagQuestion = true;
@endphp
<b class="text-success">(Your Answer)</b>
@else
<b class="text-danger">(Your Answer)</b>
@endif
@endif
@endif
</td>
</tr>
@php
$p++;
@endphp
@endforeach
<tr>
<td>
<h6>
@if ($question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->count() > 0)
@if ($flagQuestion)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-danger">Your Answer is wrong</b>
<button
class="btn btn-danger btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
</h6>
</td>
</tr>
@endif
<tr>
<td>
<h6>Explanation:</h6>
{!! $question->question !!}
</td>
</table>
{{-- End Main Question --}}
{{-- Sub Questions --}}
@if (count($question->subquestion()->get()) > 0)
@php
$j = $i + 1;
@endphp
@foreach ($question->subquestion()->get() as $question)
<table class="table table-bordered">
<tr>
<td>
<p>
<button class="btn btn-sm btn-success">{{ $question->code }}</button>
<button class="btn btn-sm btn-info">{{ $question->tags }}</button>
<button class="btn btn-sm btn-dark">{{ $question->type }}</button>
@if ($question->group_question == '1')
<button class="btn btn-sm btn-warning">Sub Question:
{{ count($question->subquestion()->get()) }}</button>
@endif
</p>
@if ($question->group_question == '1')
<h3>Group Text:</h3>
{!! $question->group_text !!}
@endif
<h3>Sub Question: {{ $j }}</h3>
{!! $question->question !!}
</td>
</tr>
{{-- SUB fill --}}
@if ($question->type == 'fill')
<tr>
<td>
@if (!empty($question->answer))
<h6>Correct Answer: {{ $question->answer }} </h6>
@if (
!empty(
$question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()
))
<h6>Your answer:
{{ $question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()->fill_answer }}
</h6>
@if (
$question->answer ==
$question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()->fill_answer)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
@else
<h6>Min:{{ $question->min }}</h6>
<h6>Max:{{ $question->max }}</h6>
@if (
!empty(
$question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()
))
<h6>Your answer:
{{ $question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()->fill_answer }}
</h6>
@if (
$question->min <=
$question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()->fill_answer &&
$question->max >=
$question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()->fill_answer)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
@endif
</td>
</tr>
@endif
{{-- SUB mcq --}}
@if ($question->type == 'mcq')
@php
$p = 1;
$flagQuestion = 0;
@endphp
@foreach ($question->options()->get() as $option)
<tr>
<td>
<b>Option: {{ $p }}</b>
{{-- Correct Option --}}
@if ($option->correct == 1)
<i class="text-success fa fa-check fa-lg"></i>
@endif
{!! $option->options !!}
{{-- Your Option --}}
@foreach ($question->user_answers()->get() as $user_answer)
@if ($user_answer->option_id == $option->id)
@if ($option->correct == 1)
@php
$flagQuestion++;
@endphp
<b class="text-success">(Your Answer)</b>
@else
<b class="text-danger">(Your Answer)</b>
@endif
@endif
@endforeach
</td>
</tr>
@php
$p++;
@endphp
@endforeach
<tr>
<td>
<h6>
@if ($question->user_answers()->count() > 0)
@if ($question->options()->where('correct', 1)->count() == $flagQuestion)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-danger">Your Answer is wrong</b>
<button
class="btn btn-danger btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
</h6>
</td>
</tr>
@endif
{{-- SUB single --}}
@if ($question->type == 'single_mcq')
@php
$p = 1;
$flagQuestion = false;
@endphp
@foreach ($question->options()->get() as $option)
<tr>
<td>
<b>Option: {{ $p }}</b>
@if ($option->correct == 1)
<i class="text-success fa fa-check fa-lg"></i>
@endif
{!! $option->options !!}
{{-- Your Option --}}
@foreach ($question->user_answers()->get() as $user_answer)
@if ($user_answer->option_id == $option->id)
@if ($option->correct == 1)
@php
$flagQuestion = true;
@endphp
<b class="text-success">(Your Answer)</b>
@else
<b class="text-danger">(Your Answer)</b>
@endif
@endif
@endforeach
</td>
</tr>
@php
$p++;
@endphp
@endforeach
<tr>
<td>
<h6>
@if ($question->user_answers()->count() > 0)
@if ($flagQuestion)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-danger">Your Answer is wrong</b>
<button
class="btn btn-danger btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
</h6>
</td>
</tr>
@endif
{{-- SUB true_false --}}
@if ($question->type == 'true_false')
@php
$p = 1;
$flagQuestion = false;
@endphp
@foreach ($question->options()->get() as $option)
<tr>
<td>
<b>Option: {{ $p }}</b>
{!! $option->options !!}
{{-- Correct Option --}}
@if ($option->correct == 1)
<i class="text-success fa fa-check fa-lg"></i>
@endif
{{-- Your Option --}}
@if ($question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->count() > 0)
@if ($question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->first()->option_id == $option->id)
@if ($option->correct == 1)
@php
$flagQuestion = true;
@endphp
<b class="text-success">(Your Answer)</b>
@else
<b class="text-danger">(Your Answer)</b>
@endif
@endif
@endif
</td>
</tr>
@php
$p++;
@endphp
@endforeach
<tr>
<td>
<h6>
@if ($question->user_answers()->where('user_unique_id', $users->user_unique_id)->where('mcq_history_id', $mcqHistory->id)->where('mcq_id', $mcq->id)->count() > 0)
@if ($flagQuestion)
<b class="text-success">Your Answer is right</b>
<button
class="btn btn-success btn-sm">+{{ $question->mark }}</button>
@else
<b class="text-danger">Your Answer is wrong</b>
<button
class="btn btn-danger btn-sm">-{{ $question->penalty }}</button>
@endif
@else
<b class="text-primary">You Skipped this question.</b>
@endif
</h6>
</td>
</tr>
@endif
<tr>
<td>
<h6>Explanation:</h6>
{!! $question->question !!}
</td>
</tr>
</table>
@php
$j++;
@endphp
@endforeach
@endif
{{-- End Subquestions --}}
@php
$i++;
@endphp
@endforeach
@endif
</div>
</div>
</div>
</main>
<!-- end::main content -->
@endsection
@push('footer-script')
<script>
$(document).ready(function() {
$('.resetProgress').click(function() {
var user_unique_id = $(this).data('unique_id');
var product_id = $(this).data('product_id');
var cat_id = $(this).data('cat_id');
var video_id = $(this).data('video_id');
swal({
title: 'Are you sure?',
text: 'Once video play history deleted, you will not be recover!',
icon: 'warning',
dangerMode: true,
buttons: ["Cancel", "Reset!"],
}).then(function(value) {
$.ajax({
url: "{{ asset('admin/reset-progress-video') }}",
type: "post",
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
'video_id': video_id,
'cat_id': cat_id,
'product_id': product_id,
'user_unique_id': user_unique_id
},
success: function(d) {
if (d == false) {
swal("Something went wrong, please try again!");
} else {
location.reload();
}
}
});
});
});
});
</script>
@endpush