<?php
namespace Claromentis\Quiz\Subscriber;

$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] ?: array()) + array("_89738003" . "24bb90d37" . "ffd58aa1c" . "2b1e02" => base64_decode("cmVhc3N" . "pZ25fdG" . "8="), "_b21bc8e15c" . "6e4bca8622e" . "4da460a26b8" => base64_decode("SGFuZGxlVXNlckRlbGV" . "0aW9u"), "user" . "_id" => base64_decode("dXNlcl9pZA=" . "="), "_4b3aa89" . "c34b0ff2" . "3c024c95" . "51e5cff8" . "a" => base64_decode("cGVvcGxlLnByZV9kZWx" . "ldGVfdXNlcg=="));
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["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_4b3aa89c" . "34b0ff23c" . "024c9551e" . "5cff8a"] => $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_b21bc8e" . "15c6e4bc" . "a8622e4d" . "a460a26b" . "8"]);
    }
    
    
    
    
    
    
    
    
    
    
    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["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["us" . "er" . "_i" . "d"])) {
            return;
        }
        $_a1fc9430abe46400f5bef8e268b69b5b = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["user_i" . "d"]);
        
        
        $this->attempt_facade->ClearAttempts($this->attempt_facade->GetUserAttempts($_a1fc9430abe46400f5bef8e268b69b5b, Plugin::AGGREGATION_QUIZ, null, false));
        
        
        
        
        
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_8973800324bb90d37ffd58aa1c2" . "b1e02"])) {
            return;
        }
        $_288250ca14a339936d623ef928a899cc = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_8973800324bb90d37ff" . "d58aa1c2b1e02"]);
        
        
        $this->quiz_repository->ReassignQuizzes($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->survey_repository->ReassignSurveys($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->poll_repository->ReassignPolls($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->question_repository->ReassignQuestions($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
    }
}