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

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] ?: array()) + array("_ada909094c3f" . "2b48f2ba66bec" . "3334aab" => base64_decode("cXVpei5mYWNhZG" . "UucXVpeg=="), "_0c5123aa744f69bbc0e8b3ea2f6e84" . "7d" => base64_decode("bG1z" . "Zw=="), "_a6cb83fdacd366dfe0da33afe934" . "397a" => base64_decode("cXVpel9" . "wcmV2aW" . "V3"), "_378a2afc2803a91e1b7526bbba" . "785672" => base64_decode("cXVpei5lcnJvci5ub3RfZm91bm" . "Q="), "_556c6740a7c938ba7b49ba5" . "0f10cf12d" => base64_decode("cXVpei5lcnJvci5ub19wcmV2aWV3X3Blc" . "m1z"));
use Claromentis\Core\Application;
use Claromentis\Core\Http\JsonPrettyResponse;
use Claromentis\Core\Repository\Exception\NotFoundException;
use Claromentis\Quiz\Facade;
use Claromentis\Quiz\Permissions\QuizPermissions;
use RestExForbidden;
use RestExNotFound;
use RestFormat;
use Symfony\Component\HttpFoundation\JsonResponse;









class AdminController
{
    
    
    
    
    protected $formatter;
    
    
    
    
    
    
    public function __construct(RestFormat $formatter)
    {
        $this->formatter = $formatter;
    }
    
    
    
    
    
    
    
    
    
    
    public function Preview(Application $_6eb6fcb92c942851e079f8ec5fb80324, $quiz_id)
    {
        
        
        
        
        $_876ca2097b275e704d71e00d36b3e7c5 = $_6eb6fcb92c942851e079f8ec5fb80324[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_ada909094c3f2b4" . "8f2ba66bec3334aa" . "b"]];
        try {
            $quiz = $_876ca2097b275e704d71e00d36b3e7c5->GetEntireQuiz($quiz_id);
        } catch (NotFoundException $_c35473364fa7a050299058f332ec29c1) {
            throw new RestExNotFound($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_0c5123aa744f69bbc0e8b3ea2f6e" . "847d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_378a2afc2803" . "a91e1b7526bbb" . "a785672"]));
        }
        if (!QuizPermissions::CanPreview($_6eb6fcb92c942851e079f8ec5fb80324->acl, $_6eb6fcb92c942851e079f8ec5fb80324->security, $quiz)) {
            throw new RestExForbidden($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_0c5123aa744f69bbc0e8b3ea2f6e847" . "d"]($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_556c6740a7c938b" . "a7b49ba50f10cf12" . "d"]));
        }
        $_6eb6fcb92c942851e079f8ec5fb80324->session->set($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_a6cb83fdacd36" . "6dfe0da33afe93" . "4397a"], $quiz_id);
        return new JsonPrettyResponse(array());
    }
    
    
    
    
    
    
    
    public function StopPreview(Application $_6eb6fcb92c942851e079f8ec5fb80324)
    {
        $_6eb6fcb92c942851e079f8ec5fb80324->session->remove($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_a6cb83fdacd366dfe0da33af" . "e934397a"]);
        return new JsonPrettyResponse(array());
    }
}