@extends('user.master')
@section('content')
@if (!empty($data))
<div class="col-md-2"></div>
<!--- MAIN BODY--->
<div class="col-md-8">
    @include('user.user-profile') <!-- Include user profile blade file ---->
    <div class="clearfix">&nbsp;</div>
    @if(Input::get('error_message'))
    <center> <h4 class="text-danger"><i class="fa fa-facebook-square"></i> {{Input::get('error_message')}}</h4> </center>
    @endif
    <div class="bg-default animated flipInY">
        @if(Input::get('share')>0 && Input::get('error_code')=='')
        <h4>Correct Ans : {{$result['correct']}}</h4>
        <h4>Incorrect Ans : {{$result['incorrect']}}</h4>
        <h4>Success : {{$result['parcent']}}%</h4>
        <h4>Time : {{$result['time']}}</h4>
        <!------- Result table ------->
        <table class="table table-hover">
            <tr>
                <th> Quiz </th>
                <th> Your Answer </th>
                <th> Result </th>
            </tr>
            @foreach($result['details'] as $r)
            <tr>
                <td> {{$r->text}}  </td>
                <td> {{$r->your_ans}}</td>
                <td> @if($r->true_ans==$r->your_ans)<i class="fa fa-check text-success"></i> @else <i class="fa fa-times text-danger"></i> @endif </td>
            </tr>
            @endforeach
        </table>
        <!------//- Result table end------->
        @else
        <center>
            <h4 class="text-success"><i class="fa fa-check-circle"></i> You have successfully completed the quiz !</h4>
            <h4> To see the complete result please share it once  !</h4>
        </center>
        @endif
        <br>
        <center><a class="btn btn-primary btn-sm " href="{{$share}}"><i class="fa fa-facebook"></i> Share Now </a></center>
        <div class="clearfix">&nbsp;</div>
    </div>
    <hr>
</div>
<!--- MAIN BODY END --->
<div class="col-md-2"></div>
@endif
@stop
