<?php
namespace Claromentis\Quiz\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"] ?: array()) + array("us" . "er" . "_i" . "d" => base64_decode("dXNlcl9p" . "ZA=="), "_8973800324bb90d37ffd58aa1c2" . "b1e02" => base64_decode("cmVhc3N" . "pZ25fdG" . "8="), "_4b3aa89c34b0f" . "f23c024c9551e5" . "cff8a" => base64_decode("cGVvcGxlLn" . "ByZV9kZWxl" . "dGVfdXNlcg" . "=="), "_b21bc8e15c6e4bca" . "8622e4da460a26b8" => base64_decode("SGFuZGxlVXNlckRlb" . "GV0aW9u"));
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\People\Event\DeleteUserEvent;
use Claromentis\Quiz\Facade\AttemptFacade;
use Claromentis\Quiz\Plugin;
use Claromentis\Quiz\Repository\PollRepository;
use Claromentis\Quiz\Repository\QuestionRepository;
use Claromentis\Quiz\Repository\QuizRepository;
use Claromentis\Quiz\Repository\SurveyRepository;






class CoreSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $attempt_facade;
    
    
    
    
    protected $quiz_repository;
    
    
    
    
    protected $question_repository;
    
    
    
    
    protected $survey_repository;
    
    
    
    
    protected $poll_repository;
    
    
    
    
    
    
    public static function getSubscribedEvents()
    {
        return array($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_4b3aa89c" . "34b0ff23c" . "024c9551e" . "5cff8a"] => $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_b21bc8e15c6e4bca" . "8622e4da460a26b8"]);
    }
    
    
    
    
    
    
    
    
    
    
    public function __construct(AttemptFacade $attempt_facade, QuizRepository $_bd1f015f5330aa0ada93292e3c30af2f, QuestionRepository $_5a3386561baf4e9123dbfd55ed91de19, SurveyRepository $_d788c955b64166f591e5ce0a44478441, PollRepository $poll_repository)
    {
        $this->attempt_facade = $attempt_facade;
        $this->quiz_repository = $_bd1f015f5330aa0ada93292e3c30af2f;
        $this->question_repository = $_5a3386561baf4e9123dbfd55ed91de19;
        $this->survey_repository = $_d788c955b64166f591e5ce0a44478441;
        $this->poll_repository = $poll_repository;
    }
    
    
    
    
    
    
    public function HandleUserDeletion(DeleteUserEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        
        
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["us" . "er" . "_i" . "d"])) {
            return;
        }
        $_a1fc9430abe46400f5bef8e268b69b5b = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["user_" . "id"]);
        
        
        $this->attempt_facade->ClearAttempts($this->attempt_facade->GetUserAttempts($_a1fc9430abe46400f5bef8e268b69b5b, Plugin::AGGREGATION_QUIZ, null, false));
        
        
        
        
        
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_8973800324bb90" . "d37ffd58aa1c2b1" . "e02"])) {
            return;
        }
        $_288250ca14a339936d623ef928a899cc = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_8973800324bb90d37ffd58aa1c2" . "b1e02"]);
        
        
        $this->quiz_repository->ReassignQuizzes($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->survey_repository->ReassignSurveys($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->poll_repository->ReassignPolls($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->question_repository->ReassignQuestions($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
    }
}