/**
  * execute command
  */
 public function executeCommand()
 {
     $setting = new ilSetting('assessment');
     if (!(bool) $setting->get('assessment_adjustments_enabled', false)) {
         $this->ctrl->redirectByClass('ilObjTestGUI');
     }
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         default:
             return $this->dispatchCommand($cmd);
     }
 }
 /**
  * Check permission of user
  * Redirect to course if permission check fails
  *
  */
 protected function checkPermission()
 {
     if (!$this->access->checkAccess('write', '', $this->ref_id)) {
         $this->ctrl->setParameterByClass('ilrepositorygui', 'ref_id', $this->ref_id);
         ilUtil::sendFailure($this->pl->txt('msg_no_permission_certificates'), true);
         $this->ctrl->redirectByClass('ilrepositorygui');
     }
 }
 /**
  * Command Execution
  */
 public function executeCommand()
 {
     // allow only write access
     if (!$this->access->checkAccess('write', '', $this->poolGUI->ref_id)) {
         ilUtil::sendInfo($this->lng->txt('cannot_edit_question_pool'), true);
         $this->ctrl->redirectByClass('ilObjQuestionPoolGUI', 'infoScreen');
     }
     // activate corresponding tab (auto activation does not work in ilObjTestGUI-Tabs-Salad)
     $this->tabs->activateTab('settings');
     // process command
     $nextClass = $this->ctrl->getNextClass();
     switch ($nextClass) {
         default:
             $cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM) . 'Cmd';
             $this->{$cmd}();
     }
 }
 protected function redirectToRefId($a_ref_id, $a_cmd = "")
 {
     $obj_type = ilObject::_lookupType($a_ref_id, true);
     if ($obj_type != "orgu") {
         parent::redirectToRefId($a_ref_id, $a_cmd);
     } else {
         $this->ctrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $a_ref_id);
         $this->ctrl->redirectByClass("ilObjOrgUnitGUI", $a_cmd);
     }
 }
 protected function accessDenied()
 {
     if (!$this->ctrl->isAsynch()) {
         ilUtil::sendFailure($this->lng->txt('dcl_msg_no_perm_edit'), true);
         $this->ctrl->redirectByClass('ildatacollectionrecordlistgui', 'listRecords');
     } else {
         echo $this->lng->txt('dcl_msg_no_perm_edit');
         exit;
     }
 }
 public function delete()
 {
     $mainTableId = $this->table->getCollectionObject()->getMainTableId();
     if ($mainTableId == $this->table->getId()) {
         ilUtil::sendFailure($this->lng->txt("dcl_cant_delete_main_table"), true);
     } else {
         $this->ctrl->setParameterByClass("ildatacollectionfieldlistgui", "table_id", $mainTableId);
     }
     $this->table->doDelete();
     $this->ctrl->redirectByClass("ildatacollectionfieldlistgui", "listFields");
 }
 public function executeCommand()
 {
     if (!$this->checkPermission()) {
         ilUtil::sendFailure($this->pl->txt('msg_no_permission'), true);
         $this->ctrl->redirectByClass('ilpersonaldesktopgui');
     }
     if (iLCertificatePlugin::getBaseClass() == 'ilUIPluginRouterGUI') {
         $this->tpl->getStandardTemplate();
     }
     $cmd = $this->ctrl->getCmd('index');
     switch ($cmd) {
         case 'index':
             $this->index();
             break;
         case 'applyFilter':
             $this->applyFilter();
             break;
         case 'resetFilter':
             $this->resetFilter();
             break;
         case 'downloadCertificate':
             $this->downloadCertificate();
             break;
         case 'downloadCertificates':
             $this->downloadCertificates();
             break;
         case 'buildActions':
             $this->buildActions();
             break;
         default:
             $this->performCommand($cmd);
     }
     if (iLCertificatePlugin::getBaseClass() == 'ilUIPluginRouterGUI') {
         $this->tpl->show();
     }
 }
 /**
  * Command Execution
  */
 public function executeCommand()
 {
     // allow only write access
     if (!$this->access->checkAccess("write", "", $this->testOBJ->getRefId())) {
         ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
         $this->ctrl->redirectByClass('ilObjTestGUI', "infoScreen");
     }
     // activate corresponding tab (auto activation does not work in ilObjTestGUI-Tabs-Salad)
     $this->tabs->activateTab('assQuestions');
     // process command
     $nextClass = $this->ctrl->getNextClass();
     switch ($nextClass) {
         default:
             $cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM) . 'Cmd';
             $this->{$cmd}();
     }
 }
 /**
  * Creates an output of the solution of an answer compared to the correct solution
  *
  * @access public
  */
 protected function outCorrectSolution()
 {
     if (!$this->object->getShowSolutionDetails()) {
         ilUtil::sendInfo($this->lng->txt("no_permission"), true);
         $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
     }
     $testSession = $this->testSessionFactory->getSession();
     $activeId = $testSession->getActiveId();
     if (!($activeId > 0)) {
         $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
     }
     $this->ctrl->saveParameter($this, "pass");
     $pass = (int) $_GET['pass'];
     $questionId = (int) $_GET['evaluation'];
     if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
         $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $pass);
         $testSequence->loadFromDb();
         $testSequence->loadQuestions();
         require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
         $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
         $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
         $objectivesList->loadObjectivesTitles();
     } else {
         $objectivesList = null;
     }
     global $ilTabs;
     if ($this instanceof ilTestEvalObjectiveOrientedGUI) {
         $ilTabs->setBackTarget($this->lng->txt("tst_back_to_virtual_pass"), $this->ctrl->getLinkTarget($this, 'showVirtualPass'));
     } else {
         $ilTabs->setBackTarget($this->lng->txt("tst_back_to_pass_details"), $this->ctrl->getLinkTarget($this, 'outUserPassDetails'));
     }
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $this->tpl->setCurrentBlock("ContentStyle");
     $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $this->tpl->parseCurrentBlock();
     $this->tpl->setCurrentBlock("SyntaxStyle");
     $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $this->tpl->parseCurrentBlock();
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
     if ($this->object->getShowSolutionAnswersOnly()) {
         $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
     }
     $solution = $this->getCorrectSolutionOutput($questionId, $activeId, $pass, $objectivesList);
     $this->tpl->setContent($solution);
 }
 public function executeCommand()
 {
     if (!$this->access->checkAccess("write", "", $this->testOBJ->getRefId())) {
         ilUtil::sendFailure($this->lng->txt("cannot_edit_test"), true);
         $this->ctrl->redirectByClass('ilObjTestGUI', "infoScreen");
     }
     if ($this->isAvoidManipulationRedirectRequired()) {
         ilUtil::sendFailure($this->lng->txt("tst_msg_cannot_modify_random_question_set_conf_due_to_part"), true);
         $this->ctrl->redirect($this);
     }
     $this->handleTabs();
     $nextClass = $this->ctrl->getNextClass();
     switch ($nextClass) {
         case 'ilTestRandomQuestionSetPoolDefinitionFormGUI':
             $formGUI = new ilTestRandomQuestionSetPoolDefinitionFormGUI($this->ctrl, $this->lng, $this->testOBJ, $this, $this->questionSetConfig);
             $this->ctrl->forwardCommand($formGUI);
             break;
         default:
             $cmd = $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM) . 'Cmd';
             $this->{$cmd}();
     }
 }
 public function executeCommand()
 {
     if (!$this->checkPermission()) {
         ilUtil::sendFailure($this->pl->txt('msg_no_permission'), true);
         $this->ctrl->redirectByClass('ilpersonaldesktopgui');
     }
     global $ilMainMenu;
     $ilMainMenu->setActive('none');
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     if (!in_array($cmd, array('addType', ''))) {
         $this->ctrl->saveParameter($this, 'type_id');
         $this->ctrl->saveParameter($this, 'signature_id');
     }
     // needed for ILIAS >= 4.5
     if (ilCertificatePlugin::getBaseClass() != 'ilRouterGUI') {
         $this->tpl->getStandardTemplate();
     }
     switch ($next_class) {
         case '':
             switch ($cmd) {
                 case 'showTypes':
                     $this->showTypes();
                     break;
                 case 'editType':
                     $this->editType();
                     $this->setTabs('general');
                     break;
                 case 'addType':
                     $this->addType();
                     $this->setTabs('general');
                     break;
                 case 'saveType':
                     $this->saveType();
                     $this->setTabs('general');
                     break;
                 case 'editTemplate':
                     $this->editTemplate();
                     $this->setTabs('template');
                     break;
                 case 'updateTemplate':
                     $this->updateTemplate();
                     $this->setTabs('template');
                     break;
                 case 'downloadDefaultTemplate':
                     $this->downloadDefaultTemplate();
                     $this->setTabs('template');
                     break;
                 case 'downloadTemplate':
                     $this->downloadTemplate();
                     $this->setTabs('template');
                     break;
                 case 'showSettings':
                     $this->showSettings();
                     $this->setTabs('settings');
                     break;
                 case 'editSetting':
                     $this->editSetting();
                     $this->setTabs('settings');
                     break;
                 case 'updateSetting':
                     $this->updateSetting();
                     $this->setTabs('settings');
                     break;
                 case 'addCustomSetting':
                     $this->addCustomSetting();
                     $this->setTabs('settings');
                     break;
                 case 'editCustomSetting':
                     $this->editCustomSetting();
                     $this->setTabs('settings');
                     break;
                 case 'confirmDeleteCustomSetting':
                     $this->confirmDeleteCustomSetting();
                     $this->setTabs('settings');
                     break;
                 case 'deleteCustomSetting':
                     $this->deleteCustomSetting();
                     break;
                 case 'saveCustomSetting':
                     $this->saveCustomSetting();
                     $this->setTabs('settings');
                     break;
                 case 'showPlaceholders':
                     $this->showPlaceholders();
                     $this->setTabs('placeholders');
                     break;
                 case 'addPlaceholder':
                     $this->addPlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'editPlaceholder':
                     $this->editPlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'updatePlaceholder':
                     $this->updatePlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'createPlaceholder':
                     $this->createPlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'deletePlaceholder':
                     $this->deletePlaceholder();
                     break;
                 case 'confirmDeletePlaceholder':
                     $this->confirmDeletePlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'showSignatures':
                     $this->showSignatures();
                     $this->setTabs('signatures');
                     break;
                 case 'addSignature':
                     $this->addSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'editSignature':
                     $this->editSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'createSignature':
                     $this->createSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'updateSignature':
                     $this->updateSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'confirmDeleteSignature':
                     $this->confirmDeleteSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'deleteSignature':
                     $this->deleteSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'downloadSignature':
                     $this->downloadSignature();
                     $this->setTabs('signatures');
                     break;
                 case '':
                     $this->showTypes();
                     break;
             }
             break;
     }
     // needed for ILIAS >= 4.5
     if (ilCertificatePlugin::getBaseClass() != 'ilRouterGUI') {
         $this->tpl->show();
     }
 }
 public function doTableSwitch()
 {
     $this->ctrl->setParameterByClass("ilObjDataCollectionGUI", "table_id", $_POST['table_id']);
     $this->ctrl->redirectByClass("ilDataCollectionFieldListGUI", "listFields");
 }
 private function backToInfoScreenCmd()
 {
     $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
 }
 public function gatewayShowHintListCmd()
 {
     $this->saveQuestionSolution();
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
     $this->ctrl->redirectByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_SHOW_LIST);
 }