public function parse($userSelected, $report, $reports)
 {
     global $ilCtrl, $lng;
     $lng->loadLanguageModule("scormtrac");
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this->parent_obj));
     $options = array("all" => $lng->txt("all"));
     include_once "Services/Tracking/classes/class.ilTrQuery.php";
     $users = ilTrQuery::getParticipantsForObject($this->parent_obj->object->ref_id);
     include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $privacy = ilPrivacySettings::_getInstance();
     $allowExportPrivacy = $privacy->enabledExportSCORM();
     //$users = $this->parent_obj->object->getTrackedUsers("");
     foreach ($users as $user) {
         if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
             if ($allowExportPrivacy == true) {
                 $e_user = new ilObjUser($user);
                 $options[$user] = $e_user->getLastname() . ", " . $e_user->getFirstname();
             } else {
                 $options[$user] = 'User Id: ' . $user;
             }
         }
     }
     $si = new ilSelectInputGUI($lng->txt("user"), "userSelected");
     $si->setOptions($options);
     $si->setValue($userSelected);
     $this->form->addItem($si);
     $options = array("choose" => $lng->txt("please_choose"));
     for ($i = 0; $i < count($reports); $i++) {
         $options[$reports[$i]] = $lng->txt(strtolower($reports[$i]));
     }
     $si = new ilSelectInputGUI($lng->txt("report"), "report");
     $si->setOptions($options);
     $si->setValue($report);
     $this->form->addItem($si);
     $this->form->addCommandButton($this->parent_cmd, $lng->txt("apply_filter"));
 }
 /**
  * Show tracking table
  * @global ilTabs $ilTabs
  * $global ilToolbar $ilToolbar
  */
 protected function showTrackingItems()
 {
     global $ilTabs;
     ilObjSCORMLearningModuleGUI::setSubTabs();
     $ilTabs->setTabActive('cont_tracking_data');
     $ilTabs->setSubTabActive('cont_tracking_byuser');
     $reports = array('exportSelectedSuccess', 'exportSelectedCore', 'exportSelectedInteractions', 'exportSelectedObjectives', 'exportSelectedRaw');
     $userSelected = "all";
     if (isset($_GET["userSelected"])) {
         $userSelected = ilUtil::stripSlashes($_GET["userSelected"]);
     }
     if (isset($_POST["userSelected"])) {
         $userSelected = ilUtil::stripSlashes($_POST["userSelected"]);
     }
     $this->ctrl->setParameter($this, 'userSelected', $userSelected);
     $report = "choose";
     if (isset($_GET["report"])) {
         $report = ilUtil::stripSlashes($_GET["report"]);
     }
     if (isset($_POST["report"])) {
         $report = ilUtil::stripSlashes($_POST["report"]);
     }
     $this->ctrl->setParameter($this, 'report', $report);
     include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerUserFilterGUI.php';
     $filter = new ilSCORMTrackingItemsPerUserFilterGUI($this, 'showTrackingItems');
     $filter->parse($userSelected, $report, $reports);
     if ($report == "choose") {
         $this->tpl->setContent($filter->form->getHTML());
     } else {
         $usersSelected = array();
         if ($userSelected != "all") {
             $usersSelected[] = $userSelected;
         } else {
             include_once "Services/Tracking/classes/class.ilTrQuery.php";
             $users = ilTrQuery::getParticipantsForObject($this->ref_id);
             foreach ($users as $user) {
                 if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
                     $usersSelected[] = $user;
                 }
             }
         }
         $scosSelected = array();
         $scos = $this->object->getTrackedItems();
         foreach ($scos as $row) {
             $scosSelected[] = (int) $row->getId();
         }
         //with check for course ...
         // include_once "Services/Tracking/classes/class.ilTrQuery.php";
         // $a_users=ilTrQuery::getParticipantsForObject($this->ref_id);
         //			var_dump($this->object->getTrackedUsers(""));
         include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsTableGUI.php';
         $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItems', $usersSelected, $scosSelected, $report);
         $this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
     }
     return true;
 }