当前位置: 首页>>代码示例>>PHP>>正文


PHP ilCtrl::setParameterByClass方法代码示例

本文整理汇总了PHP中ilCtrl::setParameterByClass方法的典型用法代码示例。如果您正苦于以下问题:PHP ilCtrl::setParameterByClass方法的具体用法?PHP ilCtrl::setParameterByClass怎么用?PHP ilCtrl::setParameterByClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilCtrl的用法示例。


在下文中一共展示了ilCtrl::setParameterByClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildActionMenu

 /**
  * Build action menu
  *
  * @param array $a_set
  * @return ilAdvancedSelectionListGUI
  */
 protected function buildActionMenu(array $a_set)
 {
     $list = new ilAdvancedSelectionListGUI();
     $list->setId($a_set['id']);
     $list->setListTitle($this->pl->txt('actions'));
     $this->ctrl->setParameterByClass('srcertificatetypegui', 'type_id', $this->type->getId());
     $this->ctrl->setParameterByClass('srcertificatetypegui', 'custom_setting_id', $a_set['id']);
     $list->addItem($this->lng->txt('edit'), 'edit', $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'editCustomSetting'));
     $list->addItem($this->lng->txt('delete'), 'delete', $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'confirmDeleteCustomSetting'));
     $this->ctrl->clearParametersByClass('srcertificatetypegui');
     return $list;
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:18,代码来源:class.srCertificateTypeCustomSettingsTableGUI.php

示例2: fillRow

 /**
  * Pass data to row template
  *
  * @param array $set
  */
 public function fillRow($set)
 {
     $this->tpl->setVariable('TITLE', $set['title']);
     $this->tpl->setVariable('DESCRIPTION', $set['description']);
     $this->tpl->setVariable('DEFAULT_LANG', $set['default_language']);
     $this->tpl->setVariable('ICON', $set['icon']);
     $this->ctrl->setParameterByClass("ilorgunittypegui", "type_id", $set['id']);
     $selection = new ilAdvancedSelectionListGUI();
     $selection->setListTitle($this->lng->txt('Actions'));
     $selection->setId('action_orgu_type' . $set['id']);
     $selection->addItem($this->lng->txt('edit'), 'edit', $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'edit'));
     $selection->addItem($this->lng->txt('delete'), 'delete', $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'delete'));
     $this->tpl->setVariable('ACTIONS', $selection->getHTML());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:19,代码来源:class.ilOrgUnitTypeTableGUI.php

示例3: fillRow

 /**
  * @param array $a_set
  */
 protected function fillRow(array $a_set)
 {
     // For checkboxes in first column
     if (count($this->getOption('actions_multi')) && $a_set['status'] == 3) {
         $this->tpl->setCurrentBlock('CHECKBOXES');
         $this->tpl->setVariable('VALUE', $a_set['id']);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock('COL');
         $this->tpl->setVariable('VALUE', '');
         $this->tpl->parseCurrentBlock();
     }
     $utc = ilCertificateConfig::get('time_format_utc');
     $date_function = $utc ? 'gmdate' : 'date';
     foreach ($this->columns as $k => $column) {
         $value = is_null($a_set[$column]) ? '' : $a_set[$column];
         if ($this->isColumnSelected($column)) {
             // Format dates
             if (in_array($column, array('valid_from', 'valid_to')) && $value != '') {
                 $time = strtotime($value);
                 $time = $utc ? $time + srCertificate::TIME_ZONE_CORRECTION : $time;
                 switch ($this->user->getDateFormat()) {
                     case ilCalendarSettings::DATE_FORMAT_DMY:
                         $value = $date_function('d.m.Y', $time);
                         break;
                     case ilCalendarSettings::DATE_FORMAT_MDY:
                         $value = $date_function('m/d/Y', $time);
                         break;
                 }
             } elseif (in_array($column, array('valid_from', 'valid_to')) && $value == '') {
                 $value = $this->pl->txt('unlimited');
             }
             if ($column == 'status') {
                 $value = $this->pl->txt("cert_status_" . (int) $value);
             }
             // Set value
             $this->tpl->setCurrentBlock('COL');
             $this->tpl->setVariable('VALUE', $value);
             $this->tpl->parseCurrentBlock();
         }
     }
     // Actions
     if (count($this->getOption('actions'))) {
         if ($this->hasAction($a_set)) {
             $this->ctrl->setParameterByClass(get_class($this->parent_obj), 'cert_id', $a_set['id']);
             $this->ctrl->setParameterByClass(get_class($this->parent_obj), 'status', $a_set['status']);
             $async_url = $this->ctrl->getLinkTargetByClass(array(ilCertificatePlugin::getBaseClass(), get_class($this->parent_obj)), 'buildActions', '', true);
             $actions = new ilAdvancedSelectionListGUI();
             $actions->setId('action_list_' . $a_set['id']);
             $actions->setAsynchUrl($async_url);
             $actions->setAsynch(true);
             $actions->setListTitle($this->pl->txt('actions'));
         } else {
             $actions = ' ';
         }
         $this->tpl->setCurrentBlock('ACTIONS');
         $this->tpl->setVariable('ACTIONS', is_string($actions) ? $actions : $actions->getHTML());
         $this->tpl->parseCurrentBlock();
     }
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:63,代码来源:class.srCertificateTableGUI.php

示例4: getPageObjectEditingLink

 /**
  * returns a link to page object editor for page object
  * with given type and id
  * 
  * @final
  * @access private
  * @param type $pageObjectType
  * @param type $pageObjectId
  * @return string $pageObjectEditingLink
  */
 private final function getPageObjectEditingLink($pageObjectType, $pageObjectId)
 {
     $cl = $this->getClassNameByType($pageObjectType, true);
     $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
     $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
     $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
     $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
     return "<a href='{$linkHREF}'>{$linkTEXT}</a>";
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:19,代码来源:class.ilAssQuestionFeedback.php

示例5: redirectToRefId

 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);
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:10,代码来源:class.ilObjOrgUnitGUI.php

示例6: delete

 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");
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:11,代码来源:class.ilDataCollectionTableEditGUI.php

示例7: modifyGUI

 /**
  * @param $a_comp
  * @param $a_part
  * @param array $a_par
  */
 public function modifyGUI($a_comp, $a_part, $a_par = array())
 {
     /**
      * @var $ilTabsGUI ilTabsGUI
      */
     if ($a_part == 'tabs' && isset($_GET['ref_id']) && self::$ref_is_crs !== false) {
         // ATM only display certificate tab in courses
         if (self::$ref_is_crs === null && ilObject::_lookupType((int) $_GET['ref_id'], true) != 'crs' || $_GET['admin_mode']) {
             self::$ref_is_crs = false;
             return;
         }
         self::$ref_is_crs = true;
         // User needs write access to course to see the tab 'certificate'
         if ($this->access->checkAccess('write', '', (int) $_GET['ref_id'])) {
             $ilTabsGUI = $a_par['tabs'];
             $this->ctrl->setParameterByClass('srCertificateDefinitionGUI', 'ref_id', $_GET['ref_id']);
             $link = $this->ctrl->getLinkTargetByClass(array(ilCertificatePlugin::getBaseClass(), 'srCertificateDefinitionGUI'));
             $ilTabsGUI->addTarget('certificate', $link, 'show', 'srCertificateDefinitionGUI');
         }
     }
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:26,代码来源:class.ilCertificateUIHookGUI.php

示例8: initHeader

 /**
  * Set Course title and icon in header
  *
  */
 protected function initHeader()
 {
     $lgui = ilObjectListGUIFactory::_getListGUIByType($this->crs->getType());
     $this->tpl->setTitle($this->crs->getTitle());
     $this->tpl->setDescription($this->crs->getDescription());
     if ($this->crs->getOfflineStatus()) {
         $this->tpl->setAlertProperties($lgui->getAlertProperties());
     }
     $this->tpl->setTitleIcon(ilUtil::getTypeIconPath('crs', $this->crs->getId(), 'big'));
     $this->ctrl->setParameterByClass('ilrepositorygui', 'ref_id', $this->ref_id);
     $this->tabs->setBackTarget($this->pl->txt('back_to_course'), $this->ctrl->getLinkTargetByClass('ilrepositorygui'));
 }
开发者ID:studer-raimann,项目名称:Certificate,代码行数:16,代码来源:class.srCertificateDefinitionGUI.php

示例9: addOtherRolesToolbar

 protected function addOtherRolesToolbar()
 {
     $arrLocalRoles = $this->rbacreview->getLocalRoles($this->parent_object->getRefId());
     $types = array();
     foreach ($arrLocalRoles as $role_id) {
         $ilObjRole = new ilObjRole($role_id);
         if (!preg_match("/il_orgu_/", $ilObjRole->getUntranslatedTitle())) {
             $types[$role_id] = $ilObjRole->getPresentationTitle();
         }
     }
     $this->ctrl->setParameterByClass('ilRepositorySearchGUI', 'addusertype', 'other');
     ilRepositorySearchGUI::fillAutoCompleteToolbar($this, $this->toolbar, array('auto_complete_name' => $this->lng->txt('user'), 'user_type' => $types, 'submit_name' => $this->lng->txt('add')));
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:13,代码来源:class.ilOrgUnitStaffGUI.php

示例10: checkAndPerformRedirect

 /**
  * Checkes to what view (table or detail) should be redirected and performs redirect
  *
  */
 protected function checkAndPerformRedirect($force_redirect = false)
 {
     if ($force_redirect || isset($_GET['redirect']) && !$this->ctrl->isAsynch()) {
         switch ((int) $_GET['redirect']) {
             case self::REDIRECT_DETAIL:
                 $this->ctrl->setParameterByClass('ildatacollectionrecordviewgui', 'record_id', $this->record_id);
                 $this->ctrl->setParameterByClass('ildatacollectionrecordviewgui', 'table_id', $this->table_id);
                 $this->ctrl->redirectByClass("ildatacollectionrecordviewgui", "renderRecord");
                 break;
             case self::REDIRECT_RECORD_LIST:
                 $this->ctrl->redirectByClass("ildatacollectionrecordlistgui", "listRecords");
                 break;
             default:
                 $this->ctrl->redirectByClass("ildatacollectionrecordlistgui", "listRecords");
         }
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:21,代码来源:class.ilDataCollectionRecordEditGUI.php

示例11: listRecords

 public function listRecords()
 {
     global $tpl, $lng, $ilToolbar;
     /**
      * @var $ilToolbar ilToolbarGUI
      * @var $ilToolbar ilToolbarGUI
      */
     // Show tables
     require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php";
     if (ilObjDataCollection::_hasWriteAccess($this->parent_obj->ref_id)) {
         $tables = $this->parent_obj->object->getTables();
     } else {
         $tables = $this->parent_obj->object->getVisibleTables();
     }
     $options = array();
     foreach ($tables as $table) {
         $options[$table->getId()] = $table->getTitle();
     }
     $tpl->addCss("./Modules/DataCollection/css/dcl_reference_hover.css");
     $list = new ilDataCollectionRecordListTableGUI($this, "listRecords", $this->table_obj, $this->mode);
     $list->setExternalSegmentation(true);
     $list->setExternalSorting(true);
     $list->determineLimit();
     $list->determineOffsetAndOrder();
     $data = $this->table_obj->getPartialRecords($list->getOrderField(), $list->getOrderDirection(), $list->getLimit(), $list->getOffset(), $list->getFilter());
     $records = $data['records'];
     $total = $data['total'];
     $list->setMaxCount($total);
     $list->setRecordData($records);
     if (count($options) > 0) {
         include_once './Services/Form/classes/class.ilSelectInputGUI.php';
         $table_selection = new ilSelectInputGUI('', 'table_id');
         $table_selection->setOptions($options);
         $table_selection->setValue($this->table_id);
         $ilToolbar->setFormAction($this->ctrl->getFormActionByClass("ilDataCollectionRecordListGUI", "doTableSwitch"));
         $ilToolbar->addText($lng->txt("dcl_table"));
         $ilToolbar->addInputItem($table_selection);
         $ilToolbar->addFormButton($lng->txt('change'), 'doTableSwitch');
         $ilToolbar->addSeparator();
     }
     $permission_to_add_or_import = $this->table_obj->hasPermissionToAddRecord($this->parent_obj->ref_id) and $this->table_obj->hasCustomFields();
     if ($permission_to_add_or_import) {
         $this->ctrl->setParameterByClass("ildatacollectionrecordeditgui", "record_id", NULL);
         $add_new = ilLinkButton::getInstance();
         $add_new->setCaption("dcl_add_new_record");
         $add_new->setUrl($this->ctrl->getFormActionByClass("ildatacollectionrecordeditgui", "create"));
         //			$add_new->addCSSClass('emphsubmit');
         $ilToolbar->addButtonInstance($add_new);
     }
     if ($this->table_obj->getExportEnabled() or $this->table_obj->hasPermissionToFields($this->parent_obj->ref_id)) {
         $export = ilDataCollectionLinkButton::getInstance();
         $export->setCaption("dcl_export_table_excel");
         $export->setUrl($this->ctrl->getFormActionByClass("ildatacollectionrecordlistgui", "exportExcel"));
         if (count($this->table_obj->getExportableFields()) == 0 or $total == 0) {
             $export->setUseWrapper(true);
             $export->setDisabled(true);
             $export->addAttribute('data-toggle', 'datacollection-tooltip', true);
             $export->addAttribute('data-placement', 'bottom', true);
             $export->addAttribute('title', $lng->txt('dcl_no_exportable_fields_or_no_data'), true);
         }
         $ilToolbar->addButtonInstance($export);
     }
     if ($permission_to_add_or_import) {
         $this->ctrl->setParameterByClass("ildatacollectionrecordeditgui", "record_id", NULL);
         $import = ilLinkButton::getInstance();
         $import->setCaption("dcl_import_records .xls");
         $import->setUrl($this->ctrl->getFormActionByClass("ildatacollectionrecordlistgui", "showImportExcel"));
         $ilToolbar->addButtonInstance($import);
     }
     // requested not to implement this way...
     //$tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js");
     if (count($this->table_obj->getRecordFields()) == 0) {
         ilUtil::sendInfo($lng->txt("dcl_no_fields_yet") . " " . ($this->table_obj->hasPermissionToFields($this->parent_obj->ref_id) ? $lng->txt("dcl_create_fields") : ""));
     }
     $tpl->getStandardTemplate();
     $tpl->setPermanentLink("dcl", $this->parent_obj->ref_id);
     if ($desc = $this->table_obj->getDescription()) {
         $desc = "<div class='ilDclTableDescription'>{$desc}</div>";
     }
     $tpl->setContent($desc . $list->getHTML());
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:81,代码来源:class.ilDataCollectionRecordListGUI.php

示例12: doTableSwitch

 public function doTableSwitch()
 {
     $this->ctrl->setParameterByClass("ilObjDataCollectionGUI", "table_id", $_POST['table_id']);
     $this->ctrl->redirectByClass("ilDataCollectionFieldListGUI", "listFields");
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:5,代码来源:class.ilDataCollectionFieldListGUI.php

示例13: getPassDetailsOverview

 /**
  * Returns the pass details overview for a given active ID and pass
  *
  * @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult)
  * @param integer $active_id Active ID of the active user
  * @param integer $pass Test pass
  * @param string $targetclass The name of the ILIAS class for the "pass details" URL (optional)
  * @param string $targetcommand The name of the ILIAS command for the "pass details" URL (optional)
  * @param string $targetcommanddetails The name of the ILIAS command which should be called for the details of an answer (optional)
  * @param boolean $standard_header TRUE if the table headers should be plain text, FALSE if the table headers should be URL's for sortable columns
  * @return string HTML code of the pass details overview
  * @access public
  */
 function getPassDetailsOverview($result_array, $active_id, $pass, $targetclass = "", $targetcommandsort = "", $targetcommanddetails = "", $standard_header = TRUE)
 {
     global $ilUser;
     $testresults = $result_array["pass"];
     unset($result_array["test"]);
     $user_id = $this->object->_getUserIdFromActiveId($active_id);
     $sort = $_GET["sort"] ? $_GET["sort"] : "nr";
     $sortorder = $_GET["sortorder"] ? $_GET["sortorder"] : "asc";
     if (!$standard_header) {
         // change sortorder of result array
         usort($result_array, "sortResults");
     }
     $color_class = array("tblrow1top", "tblrow2top");
     $counter = 0;
     $template = new ilTemplate("tpl.il_as_tst_pass_details_overview.html", TRUE, TRUE, "Modules/Test");
     $this->ctrl->setParameterByClass($targetclass, "pass", "{$pass}");
     if (!$testresults["total_max_points"]) {
         $percentage = 0;
     } else {
         $percentage = $testresults["total_reached_points"] / $testresults["total_max_points"] * 100;
     }
     $total_max = $testresults["total_max_points"];
     $total_reached = $testresults["total_reached_points"];
     $totalRequestedHints = $testresults["total_requested_hints"];
     $img_title_percent = "";
     $img_title_nr = "";
     $hasSuggestedSolutions = FALSE;
     if ($this->object->getShowSolutionSuggested()) {
         foreach ($result_array as $key => $value) {
             if (strlen($value["solution"])) {
                 $hasSuggestedSolutions = TRUE;
             }
         }
     }
     foreach ($result_array as $key => $value) {
         if (preg_match("/\\d+/", $key)) {
             if (strlen($targetclass) && strlen($targetcommanddetails)) {
                 $template->setCurrentBlock("linked_title");
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
                 $this->ctrl->setParameterByClass($targetclass, "evaluation", $value["qid"]);
                 $this->ctrl->setParameterByClass($targetclass, "active_id", $active_id);
                 $template->setVariable("URL_QUESTION_TITLE", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommanddetails));
                 $template->parseCurrentBlock();
             } else {
                 $template->setCurrentBlock("plain_title");
                 $template->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->parseCurrentBlock();
             }
             if ($hasSuggestedSolutions) {
                 $template->setCurrentBlock("question_suggested_solution");
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->setVariable("SOLUTION_HINT", $this->object->prepareTextareaOutput($value["solution"], true));
                 $template->parseCurrentBlock();
             }
             $template->setCurrentBlock("question");
             $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
             $template->setVariable("VALUE_QUESTION_COUNTER", $value["nr"]);
             $template->setVariable("VALUE_MAX_POINTS", $value["max"]);
             $template->setVariable("VALUE_REACHED_POINTS", $value["reached"]);
             if ($this->object->isOfferingQuestionHintsEnabled()) {
                 $template->setVariable("VALUE_HINT_COUNT", $value["requested_hints"]);
             }
             $template->setVariable("VALUE_PERCENT_SOLVED", $value["percent"]);
             $template->parseCurrentBlock();
             $counter++;
         }
     }
     if ($hasSuggestedSolutions) {
         $template->touchBlock("footer_suggested_solution");
     }
     $template->setCurrentBlock("footer");
     $template->setVariable("VALUE_QUESTION_COUNTER", "<strong>" . $this->lng->txt("total") . "</strong>");
     $template->setVariable("VALUE_QUESTION_TITLE", "");
     $template->setVariable("VALUE_MAX_POINTS", "<strong>{$total_max}</strong>");
     $template->setVariable("VALUE_REACHED_POINTS", "<strong>{$total_reached}</strong>");
     if ($this->object->isOfferingQuestionHintsEnabled()) {
         $template->setVariable("VALUE_TOTAL_HINT_COUNT", "<strong>{$totalRequestedHints}</strong>");
     }
     $template->setVariable("VALUE_PERCENT_SOLVED", "<strong>" . sprintf("%2.2f", $percentage) . " %" . "</strong>");
     $template->parseCurrentBlock();
     if ($standard_header) {
         if ($hasSuggestedSolutions) {
             $template->setCurrentBlock("standard_header_suggested_solution");
             $template->setVariable("SOLUTION_HINT_HEADER", $this->lng->txt("solution_hint"));
             $template->parseCurrentBlock();
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilTestServiceGUI.php

示例14: getPassOverview

 /**
  * Returns the pass overview for a given active ID
  *
  * @return string HTML code of the pass overview
  * @access public
  * 
  * @deprecated
  */
 public function getPassOverview(ilTestSession $testSession, $targetclass = "", $targetcommand = "", $short = FALSE, $hide_details = FALSE)
 {
     $active_id = $testSession->getActiveId();
     require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
     require_once 'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php';
     $table = new ilTestPassOverviewTableGUI($this, '', $short ? ilTestPassOverviewTableGUI::CONTEXT_SHORT : ilTestPassOverviewTableGUI::CONTEXT_LONG, isset($_GET['pdf']) && $_GET['pdf'] == 1);
     $considerHiddenQuestions = true;
     if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
         $considerHiddenQuestions = false;
         $table->setObjectiveOrientedPresentationEnabled(true);
         require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
         $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
     }
     $table->init();
     $data = array();
     $counted_pass = $this->object->_getResultPass($active_id);
     $reached_pass = $this->object->_getPass($active_id);
     require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
     $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
     $testPassesSelector->setActiveId($active_id);
     $lastFinishedPass = $this->testSessionFactory->getSession($active_id)->getLastFinishedPass();
     $testPassesSelector->setLastFinishedPass($lastFinishedPass);
     foreach ($testPassesSelector->getReportablePasses() as $pass) {
         $row = array();
         $considerOptionalQuestions = true;
         if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
             $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
             $testSequence->loadFromDb();
             $testSequence->loadQuestions();
             if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
                 $considerOptionalQuestions = false;
             }
             $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
             $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
             $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
             $objectivesList->loadObjectivesTitles();
             $row['objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions());
         }
         if (!$short) {
             $result_array =& $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions, $considerOptionalQuestions);
             if (!$result_array['pass']['total_max_points']) {
                 $percentage = 0;
             } else {
                 $percentage = $result_array['pass']['total_reached_points'] / $result_array['pass']['total_max_points'] * 100;
             }
             $total_max = $result_array['pass']['total_max_points'];
             $total_reached = $result_array['pass']['total_reached_points'];
             $total_requested_hints = $result_array['pass']['total_requested_hints'];
         }
         if (!$hide_details) {
             if (strlen($targetclass) && strlen($targetcommand)) {
                 $this->ctrl->setParameterByClass($targetclass, 'active_id', $active_id);
                 $this->ctrl->setParameterByClass($targetclass, 'pass', $pass);
                 $aslgui = new ilAdvancedSelectionListGUI();
                 $aslgui->setListTitle($this->lng->txt('actions'));
                 $aslgui->setId($pass);
                 $aslgui->addItem($this->lng->txt('tst_pass_details'), 'tst_pass_details', $this->ctrl->getLinkTargetByClass($targetclass, $targetcommand));
                 if ($this->object->isPassDeletionAllowed() && $pass != $counted_pass) {
                     $aslgui->addItem($this->lng->txt('delete'), 'tst_pass_delete', $this->ctrl->getLinkTargetByClass($targetclass, 'confirmDeletePass'));
                 }
                 $row['pass_details'] = $aslgui->getHTML();
             }
         }
         if (!$short) {
             if ($pass == $counted_pass) {
                 $row['scored'] = '&otimes;';
             } else {
                 $row['scored'] = '';
             }
         }
         $row['pass'] = $pass + 1;
         $row['date'] = $this->object->getPassFinishDate($active_id, $pass);
         if (!$short) {
             $row['answered'] = $result_array['pass']['num_workedthrough'] . ' ' . strtolower($this->lng->txt('of')) . ' ' . (count($result_array) - 2);
             if ($this->object->isOfferingQuestionHintsEnabled()) {
                 $row['hints'] = $total_requested_hints;
             }
             $row['reached'] = $total_reached . ' ' . strtolower($this->lng->txt('of')) . ' ' . $total_max;
             $row['percentage'] = $percentage;
         }
         $data[] = $row;
     }
     $table->setData($data);
     return $table->getHTML();
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:93,代码来源:class.ilTestServiceGUI.php

示例15: setCtrlParametersForRow

 /**
  * @param $a_set
  */
 protected function setCtrlParametersForRow($a_set)
 {
     $this->ctrl->setParameterByClass(get_class($this->parent_obj), 'ar_id', self::domid_encode($a_set[$this->getFields()->getPrimaryField()->getName()]));
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:7,代码来源:class.arIndexTableGUI.php


注:本文中的ilCtrl::setParameterByClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。