<?php
namespace Claromentis\Quiz\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] ?: array()) + array("_4b3aa89c34b0ff23c024c95" . "51e5cff8a" => base64_decode("cGVvcGxlLnByZV9kZWxldGVfdXN" . "lcg=="), "user_i" . "d" => base64_decode("dXNlcl9pZA=" . "="), "_b21bc8e15c6e4bca8622e4da46" . "0a26b8" => base64_decode("SGFuZGx" . "lVXNlck" . "RlbGV0a" . "W9u"), "_8973800324bb90d37ffd58aa" . "1c2b1e02" => base64_decode("cmVhc3NpZ25" . "fdG8="));
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["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_4b3aa89c34b0ff23c024c9551e5cff8" . "a"] => $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_b21bc8e15c6e4bca8622e4d" . "a460a26b8"]);
    }
    
    
    
    
    
    
    
    
    
    
    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["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["user_i" . "d"])) {
            return;
        }
        $_a1fc9430abe46400f5bef8e268b69b5b = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["user" . "_id"]);
        
        
        $this->attempt_facade->ClearAttempts($this->attempt_facade->GetUserAttempts($_a1fc9430abe46400f5bef8e268b69b5b, Plugin::AGGREGATION_QUIZ, null, false));
        
        
        
        
        
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_8973800324bb90d37ff" . "d58aa1c2b1e02"])) {
            return;
        }
        $_288250ca14a339936d623ef928a899cc = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_8973800324bb" . "90d37ffd58aa1" . "c2b1e02"]);
        
        
        $this->quiz_repository->ReassignQuizzes($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->survey_repository->ReassignSurveys($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->poll_repository->ReassignPolls($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
        $this->question_repository->ReassignQuestions($_a1fc9430abe46400f5bef8e268b69b5b, $_288250ca14a339936d623ef928a899cc);
    }
}