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


PHP ilObjTest::getInvitedUsers方法代码示例

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


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

示例1: getResultsHeadUserAndPass

 /**
  * Returns the user and pass data for a test results output
  *
  * @param integer $active_id The active ID of the user
  * @return string HTML code of the user data for the test results
  * @access public
  */
 function getResultsHeadUserAndPass($active_id, $pass)
 {
     $template = new ilTemplate("tpl.il_as_tst_results_head_user_pass.html", TRUE, TRUE, "Modules/Test");
     include_once './Services/User/classes/class.ilObjUser.php';
     $user_id = $this->object->_getUserIdFromActiveId($active_id);
     if (strlen(ilObjUser::_lookupLogin($user_id)) > 0) {
         $user = new ilObjUser($user_id);
     } else {
         $user = new ilObjUser();
         $user->setLastname($this->lng->txt("deleted_user"));
     }
     $title_matric = "";
     if (strlen($user->getMatriculation()) && $this->object->getAnonymity() == FALSE) {
         $template->setCurrentBlock("user_matric");
         $template->setVariable("TXT_USR_MATRIC", $this->lng->txt("matriculation"));
         $template->parseCurrentBlock();
         $template->setCurrentBlock("user_matric_value");
         $template->setVariable("VALUE_USR_MATRIC", $user->getMatriculation());
         $template->parseCurrentBlock();
         $template->touchBlock("user_matric_separator");
         $title_matric = " - " . $this->lng->txt("matriculation") . ": " . $user->getMatriculation();
     }
     $invited_user = array_pop($this->object->getInvitedUsers($user_id));
     if (strlen($invited_user["clientip"])) {
         $template->setCurrentBlock("user_clientip");
         $template->setVariable("TXT_CLIENT_IP", $this->lng->txt("client_ip"));
         $template->parseCurrentBlock();
         $template->setCurrentBlock("user_clientip_value");
         $template->setVariable("VALUE_CLIENT_IP", $invited_user["clientip"]);
         $template->parseCurrentBlock();
         $template->touchBlock("user_clientip_separator");
         $title_client = " - " . $this->lng->txt("clientip") . ": " . $invited_user["clientip"];
     }
     $template->setVariable("TXT_USR_NAME", $this->lng->txt("name"));
     $uname = $this->object->userLookupFullName($user_id, FALSE);
     $template->setVariable("VALUE_USR_NAME", $uname);
     $template->setVariable("TXT_PASS", $this->lng->txt("scored_pass"));
     $template->setVariable("VALUE_PASS", $pass);
     return $template->get();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:47,代码来源:class.ilTestServiceGUI.php

示例2: buildForm


//.........这里部分代码省略.........
     $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable());
     $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description"));
     $highscore->addSubItem($highscore_top_table);
     $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
     $highscore_top_num->setSize(4);
     $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
     $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum());
     $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
     $highscore->addSubItem($highscore_top_num);
     if (!$this->settingsTemplate || $this->formShowTestExecutionSection($this->settingsTemplate->getSettings())) {
         $testExecution = new ilFormSectionHeaderGUI();
         $testExecution->setTitle($this->lng->txt("tst_test_execution"));
         $form->addItem($testExecution);
     }
     // kiosk mode
     $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
     $kiosk->setValue(1);
     $kiosk->setChecked($this->testOBJ->getKioskMode());
     $kiosk->setInfo($this->lng->txt("kiosk_description"));
     // kiosk mode options
     $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options");
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt('examid_in_kiosk'), 'examid_in_kiosk'));
     $values = array();
     if ($this->testOBJ->getShowKioskModeTitle()) {
         array_push($values, 'kiosk_title');
     }
     if ($this->testOBJ->getShowKioskModeParticipant()) {
         array_push($values, 'kiosk_participant');
     }
     if ($this->testOBJ->getExamidInKiosk()) {
         array_push($values, 'examid_in_kiosk');
     }
     $kiosktitle->setValue($values);
     $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
     $kiosk->addSubItem($kiosktitle);
     $form->addItem($kiosk);
     $redirection_mode = $this->testOBJ->getRedirectionMode();
     $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
     $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
     $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_mode');
     $always = new ilRadioOption($this->lng->txt('tst_results_access_always'), REDIRECT_ALWAYS);
     $radio_rm->addOption($always);
     $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK);
     $radio_rm->addOption($kiosk);
     $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS);
     $rm_enabled->addSubItem($radio_rm);
     $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url');
     $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl());
     $redirection_url->setRequired(true);
     $rm_enabled->addSubItem($redirection_url);
     $form->addItem($rm_enabled);
     // Sign submission
     $sign_submission = $this->testOBJ->getSignSubmission();
     $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission');
     $sign_submission_enabled->setChecked($sign_submission);
     $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info'));
     $form->addItem($sign_submission_enabled);
     if (!$this->settingsTemplate || $this->formShowParticipantSection($this->settingsTemplate->getSettings())) {
         // participants properties
         $restrictions = new ilFormSectionHeaderGUI();
         $restrictions->setTitle($this->lng->txt("tst_max_allowed_users"));
         $form->addItem($restrictions);
     }
     $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants");
     $fixedparticipants->setValue(1);
     $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
     $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants"));
     $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
     $invited_users = $this->testOBJ->getInvitedUsers();
     if ($total && count($invited_users) == 0) {
         $fixedparticipants->setDisabled(true);
     }
     $form->addItem($fixedparticipants);
     // simultaneous users
     $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers");
     $simul->setSize(3);
     $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : '');
     $form->addItem($simul);
     // idle time
     $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap");
     $idle->setSize(4);
     $idle->setSuffix($this->lng->txt("seconds"));
     $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : '');
     $form->addItem($idle);
     // Edit ecs export settings
     include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
     $ecs = new ilECSTestSettings($this->testOBJ);
     $ecs->addSettingsToForm($form, 'tst');
     // remove items when using template
     if ($this->settingsTemplate) {
         foreach ($this->settingsTemplate->getSettings() as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilObjTestSettingsGeneralGUI.php

示例3: participantsObject

 /**
  * Creates the output of the test participants
  *
  * @access    public
  */
 function participantsObject()
 {
     global $ilAccess, $ilToolbar, $lng;
     $this->getParticipantsSubTabs();
     if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
         // allow only write access
         ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
         $this->ctrl->redirect($this, "infoScreen");
     }
     if ($this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken($this->tree)) {
         ilUtil::sendFailure($this->testQuestionSetConfigFactory->getQuestionSetConfig()->getDepenciesBrokenMessage($this->lng));
     } elseif ($this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesInVulnerableState($this->tree)) {
         ilUtil::sendInfo($this->questionSetConfig->getDepenciesInVulnerableStateMessage($this->lng));
     }
     if ($this->object->getFixedParticipants()) {
         // search button
         include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
         ilRepositorySearchGUI::fillAutoCompleteToolbar($this, $tb, array('auto_complete_name' => $lng->txt('user'), 'submit_name' => $lng->txt('add')));
         // search button
         $ilToolbar->addButton($this->lng->txt("tst_search_users"), $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start'));
         $participants =& $this->object->getInvitedUsers();
         $rows = array();
         foreach ($participants as $data) {
             $maxpass = $this->object->_getMaxPass($data["active_id"]);
             if (!is_null($maxpass)) {
                 $maxpass += 1;
             }
             $access = "";
             if (strlen($data["active_id"])) {
                 $last_access = $this->object->_getLastAccess($data["active_id"]);
                 $access = $last_access;
             }
             $this->ctrl->setParameterByClass('iltestevaluationgui', 'active_id', $data['active_id']);
             if ($data['active_id'] == null) {
                 if (strlen($data["firstname"] . $data["lastname"]) == 0) {
                     $fullname = $lng->txt("deleted_user");
                 } else {
                     if ($this->object->getAnonymity()) {
                         $fullname = $lng->txt('anonymous');
                     } else {
                         $fullname = trim($data["lastname"] . ", " . $data["firstname"] . " " . $data["title"]);
                     }
                 }
             } else {
                 include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
                 $fullname = ilObjTestAccess::_getParticipantData($data['active_id']);
             }
             array_push($rows, array('usr_id' => $data["usr_id"], 'active_id' => $data['active_id'], 'login' => $data["login"], 'clientip' => $data["clientip"], 'firstname' => $data["firstname"], 'lastname' => $data["lastname"], 'name' => $fullname, 'started' => $data["active_id"] > 0 ? 1 : 0, 'finished' => $data["test_finished"] == 1 ? 1 : 0, 'access' => $access, 'maxpass' => $maxpass, 'result' => $this->ctrl->getLinkTargetByClass('iltestevaluationgui', 'outParticipantsResultsOverview')));
         }
         include_once "./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php";
         $table_gui = new ilTestFixedParticipantsTableGUI($this, 'participants', $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken(), $this->object->getAnonymity(), count($rows));
         $table_gui->setFilterCommand('fpSetFilter');
         $table_gui->setResetCommand('fpResetFiler');
         $rows = $this->applyFilterCriteria($rows);
         $table_gui->setData($rows);
         $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
     } else {
         $participants =& $this->object->getTestParticipants();
         $rows = array();
         foreach ($participants as $data) {
             $maxpass = $this->object->_getMaxPass($data["active_id"]);
             if (!is_null($maxpass)) {
                 $maxpass += 1;
             }
             $access = "";
             if (strlen($data["active_id"])) {
                 $last_access = $this->object->_getLastAccess($data["active_id"]);
                 $access = $last_access;
             }
             $this->ctrl->setParameterByClass('iltestevaluationgui', 'active_id', $data['active_id']);
             include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
             $fullname = ilObjTestAccess::_getParticipantData($data['active_id']);
             array_push($rows, array('usr_id' => $data["active_id"], 'active_id' => $data['active_id'], 'login' => $data["login"], 'name' => $fullname, 'firstname' => $data["firstname"], 'lastname' => $data["lastname"], 'started' => $data["active_id"] > 0 ? 1 : 0, 'finished' => $data["test_finished"] == 1 ? 1 : 0, 'access' => $access, 'maxpass' => $maxpass, 'result' => $this->ctrl->getLinkTargetByClass('iltestevaluationgui', 'outParticipantsResultsOverview')));
         }
         include_once "./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php";
         $table_gui = new ilTestParticipantsTableGUI($this, 'participants', $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken(), $this->object->getAnonymity(), count($rows));
         $table_gui->setFilterCommand('npSetFilter');
         $table_gui->setResetCommand('npResetFilter');
         $rows = $this->applyFilterCriteria($rows);
         $table_gui->setData($rows);
         $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
     }
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:88,代码来源:class.ilObjTestGUI.php


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