protected function populateCharSelector()
 {
     global $ilSetting;
     if ($ilSetting->get('char_selector_availability') > 0) {
         require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
         $char_selector = ilCharSelectorGUI::_getCurrentGUI($this->object);
         if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED) {
             $char_selector->addToPage();
             $this->tpl->setCurrentBlock('char_selector');
             $this->tpl->setVariable("CHAR_SELECTOR_IMAGE", ilUtil::getImagePath('icon_omega_test.svg', 'Services/UIComponent/CharSelector'));
             $this->tpl->setVariable("CHAR_SELECTOR_TEXT", $this->lng->txt('char_selector'));
             $this->tpl->setVariable("CHAR_SELECTOR_TEMPLATE", $char_selector->getSelectorHtml());
             $this->tpl->parseCurrentBlock();
         }
     }
 }
 /**
  * Get Content.
  */
 function getContent()
 {
     global $lng, $tpl, $ilUser, $ilSetting;
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initEvent();
     ilYuiUtil::initDom();
     ilYuiUtil::initAnimation();
     $tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
     $tpl->addJavaScript("Services/Form/js/Form.js");
     $this->tpl = new ilTemplate("tpl.property_form.html", true, true, "Services/Form");
     // check if form has not title and first item is a section header
     // -> use section header for title and remove section header
     // -> command buttons are presented on top
     $fi = $this->items[0];
     if ($this->getMode() == "std" && $this->getTitle() == "" && is_object($fi) && $fi->getType() == "section_header") {
         $this->setTitle($fi->getTitle());
         unset($this->items[0]);
     }
     // title icon
     if ($this->getTitleIcon() != "" && @is_file($this->getTitleIcon())) {
         $this->tpl->setCurrentBlock("title_icon");
         $this->tpl->setVariable("IMG_ICON", $this->getTitleIcon());
         $this->tpl->parseCurrentBlock();
     }
     // title
     if ($this->getTitle() != "") {
         // commands on top
         if (count($this->buttons) > 0 && $this->getShowTopButtons() && count($this->items) > 2) {
             // command buttons
             foreach ($this->buttons as $button) {
                 $this->tpl->setCurrentBlock("cmd2");
                 $this->tpl->setVariable("CMD", $button["cmd"]);
                 $this->tpl->setVariable("CMD_TXT", $button["text"]);
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->setCurrentBlock("commands2");
             $this->tpl->parseCurrentBlock();
         }
         if (is_object($ilSetting)) {
             if ($ilSetting->get('char_selector_availability') > 0) {
                 require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
                 if (ilCharSelectorGUI::_isAllowed()) {
                     $char_selector = ilCharSelectorGUI::_getCurrentGUI();
                     if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED) {
                         $char_selector->addToPage();
                         $this->tpl->TouchBlock('char_selector');
                     }
                 }
             }
         }
         $this->tpl->setCurrentBlock("header");
         $this->tpl->setVariable("TXT_TITLE", $this->getTitle());
         $this->tpl->setVariable("LABEL", $this->getTopAnchor());
         $this->tpl->setVariable("TXT_DESCRIPTION", $this->getDescription());
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->touchBlock("item");
     // properties
     $this->required_text = false;
     foreach ($this->items as $item) {
         if ($item->getType() != "hidden") {
             $this->insertItem($item);
         }
     }
     // required
     if ($this->required_text && $this->getMode() == "std") {
         $this->tpl->setCurrentBlock("required_text");
         $this->tpl->setVariable("TXT_REQUIRED", $lng->txt("required_field"));
         $this->tpl->parseCurrentBlock();
     }
     // command buttons
     foreach ($this->buttons as $button) {
         $this->tpl->setCurrentBlock("cmd");
         $this->tpl->setVariable("CMD", $button["cmd"]);
         $this->tpl->setVariable("CMD_TXT", $button["text"]);
         $this->tpl->parseCurrentBlock();
     }
     // try to keep uploads even if checking input fails
     if ($this->getMultipart()) {
         $hash = $_POST["ilfilehash"];
         if (!$hash) {
             $hash = md5(uniqid(mt_rand(), true));
         }
         $fhash = new ilHiddenInputGUI("ilfilehash");
         $fhash->setValue($hash);
         $this->addItem($fhash);
     }
     // hidden properties
     $hidden_fields = false;
     foreach ($this->items as $item) {
         if ($item->getType() == "hidden") {
             $item->insert($this->tpl);
             $hidden_fields = true;
         }
     }
     if ($this->required_text || count($this->buttons) > 0 || $hidden_fields) {
         $this->tpl->setCurrentBlock("commands");
         $this->tpl->parseCurrentBlock();
     }
     if ($this->getMode() == "subform") {
         $this->tpl->touchBlock("sub_table");
     } else {
         $this->tpl->touchBlock("std_table");
         $this->tpl->setVariable('STD_TABLE_WIDTH', $this->getTableWidth());
     }
     return $this->tpl->get();
 }
 /**
  * Render the selector for unicode characters
  */
 function renderCharSelector()
 {
     global $ilSetting;
     if ($ilSetting->get('char_selector_availability') > 0) {
         require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
         $char_selector = ilCharSelectorGUI::_getCurrentGUI();
         if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED) {
             $char_selector->addToPage();
             $this->tpl->TouchBlock("char_selector");
         }
     }
 }
 public function getKioskHead()
 {
     global $ilUser;
     $template = new ilTemplate('tpl.il_as_tst_kiosk_head.html', true, true, 'Modules/Test');
     if ($this->object->getShowKioskModeTitle()) {
         $template->setCurrentBlock("kiosk_show_title");
         $template->setVariable("TEST_TITLE", $this->object->getTitle());
         $template->parseCurrentBlock();
     }
     if ($this->object->getShowKioskModeParticipant()) {
         $template->setCurrentBlock("kiosk_show_participant");
         $template->setVariable("PARTICIPANT_NAME_TXT", $this->lng->txt("login_as"));
         $template->setVariable("PARTICIPANT_NAME", $ilUser->getFullname());
         $template->setVariable("PARTICIPANT_LOGIN", $ilUser->getLogin());
         $template->setVariable("PARTICIPANT_MATRICULATION", $ilUser->getMatriculation());
         $template->setVariable("PARTICIPANT_EMAIL", $ilUser->getEmail());
         $template->parseCurrentBlock();
     }
     if ($this->object->getExamidInKiosk()) {
         $template->setCurrentBlock("kiosk_show_exam_id");
         $template->setVariable("EXAM_ID_TXT", $this->lng->txt("exam_id"));
         $user_id = $ilUser->getId();
         $object_id = $this->object->getTestId();
         $active_id = $this->object->_getActiveIdOfUser($user_id, $object_id);
         $pass = $this->object->_getPass($active_id);
         $exam_id = $this->object->getExamId($active_id, $pass);
         $template->setVariable("EXAM_ID", $exam_id);
         $template->parseCurrentBlock();
     }
     global $ilSetting;
     if ($ilSetting->get('char_selector_availability') > 0) {
         require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
         $char_selector = ilCharSelectorGUI::_getCurrentGUI();
         if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED) {
             $char_selector->addToPage();
             $template->setVariable("CHAR_SELECTOR_TEMPLATE", $char_selector->getSelectorHtml());
         }
     }
     return $template->get();
 }
 /**
  * Execute Command
  */
 public function executeCommand()
 {
     global $ilUser, $ilDB, $ilPluginAdmin, $lng, $ilTabs;
     $ilTabs->clearTargets();
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     $this->ctrl->saveParameter($this, "sequence");
     $this->ctrl->saveParameter($this, "active_id");
     if (preg_match("/^gotoquestion_(\\d+)\$/", $cmd, $matches)) {
         $cmd = "gotoquestion";
         if (strlen($matches[1])) {
             $this->ctrl->setParameter($this, 'gotosequence', $matches[1]);
         }
     }
     $testSessionFactory = new ilTestSessionFactory($this->object);
     $this->testSession = $testSessionFactory->getSession($_GET['active_id']);
     if (!$this->testSession->getActiveId()) {
         $this->testSession->setUserId($ilUser->getId());
         $this->testSession->setAnonymousId($_SESSION["tst_access_code"][$this->object->getTestId()]);
         $this->testSession->saveToDb();
     }
     $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
     $this->testSequence = $testSequenceFactory->getSequence($this->testSession);
     $this->testSequence->loadFromDb();
     $this->testSequence->loadQuestions();
     include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initConnectionWithAnimation();
     // Ensure that the selector for unicode characters respects the test settings
     // This should be done before ilMainMenu gets the current selector for display
     global $ilSetting;
     if ($ilSetting->get('char_selector_availability') > 0) {
         require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
         ilCharSelectorGUI::_getCurrentGUI($this->object);
     }
     $cmd = $this->getCommand($cmd);
     switch ($next_class) {
         case 'iltestsubmissionreviewgui':
             require_once './Modules/Test/classes/class.ilTestSubmissionReviewGUI.php';
             $gui = new ilTestSubmissionReviewGUI($this, $this->object);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionhintrequestgui':
             $questionGUI = $this->object->createQuestionGUI("", $this->testSequence->getQuestionForSequence($this->calculateSequence()));
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
             $gui = new ilAssQuestionHintRequestGUI($this, $this->testSession, $questionGUI);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestsignaturegui':
             require_once './Modules/Test/classes/class.ilTestSignatureGUI.php';
             $gui = new ilTestSignatureGUI($this);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         default:
             $cmd .= 'Cmd';
             $ret =& $this->{$cmd}();
             break;
     }
     return $ret;
 }