<?php
namespace Claromentis\Quiz\Controller\Rest\V2;

$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] ?: array()) + array("_f4eafa5f" . "493306ffd" . "b51a688b2" . "1dd507" => base64_decode("dG90YWw" . "="), "_dadf790baf241afac94" . "2824c1e6e37c4" => base64_decode("dH" . "lw" . "ZQ" . "=="), "_49c6565477ee9f822b499a53e6d" . "2995f" => base64_decode("YXJyYXlfa2V5X2V4" . "aXN0cw=="), "_686fd241b761d54b42b10ec0022" . "55dd3" => base64_decode("YXR0ZW" . "1wdGFi" . "bGVz"));
use Claromentis\Core\Application;
use Claromentis\Core\Http\JsonPrettyResponse;
use Claromentis\Core\Http\RequestData;
use Claromentis\Quiz\AttemptableType;
use Claromentis\Quiz\Facade\AttemptableFacade;
class AttemptableController
{
    
    
    
    
    protected $attemptable_facade;
    
    
    
    
    
    
    public function __construct(AttemptableFacade $attemptable_facade)
    {
        $this->attemptable_facade = $attemptable_facade;
    }
    
    
    
    
    
    
    
    
    public function GetAttemptables(Application $_6eb6fcb92c942851e079f8ec5fb80324, RequestData $data)
    {
        $_dadf790baf241afac942824c1e6e37c4 = $data->Get($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_dadf790baf24" . "1afac942824c1" . "e6e37c4"]);
        $_72f27270e57b073f488bc8fa83607074 = AttemptableType::MAP;
        if ($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_49c6565" . "477ee9f8" . "22b499a5" . "3e6d2995" . "f"]($_dadf790baf241afac942824c1e6e37c4, $_72f27270e57b073f488bc8fa83607074)) {
            $_dadf790baf241afac942824c1e6e37c4 = $_72f27270e57b073f488bc8fa83607074[$_dadf790baf241afac942824c1e6e37c4];
        } else {
            $_dadf790baf241afac942824c1e6e37c4 = AttemptableType::TYPE_ALL;
        }
        $context = $_6eb6fcb92c942851e079f8ec5fb80324->security;
        $user_id = $context->GetUserId();
        $_1f24efd4735b7a11b391147435e7d35d = $this->attemptable_facade->GetAttemptables($user_id, [], null, $_dadf790baf241afac942824c1e6e37c4, 10, 0, true);
        return new JsonPrettyResponse(array($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_686fd241b761d54b42b10ec0" . "02255dd3"] => $_1f24efd4735b7a11b391147435e7d35d[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_686fd241b761d54b42b10ec00225" . "5dd3"]], $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_f4eafa5f4" . "93306ffdb5" . "1a688b21dd" . "507"] => $_1f24efd4735b7a11b391147435e7d35d[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_f4eafa5f493306ffdb5" . "1a688b21dd507"]]));
    }
}