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


PHP ilObjTest::getQuestionSetType方法代码示例

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


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

示例1: getSession

 /**
  * creates and returns an instance of a test sequence
  * that corresponds to the current test mode
  * 
  * @param integer $activeId
  * @return ilTestSession|ilTestSessionDynamicQuestionSet
  */
 public function getSession($activeId = null)
 {
     global $ilUser;
     if (self::$testSession === null) {
         switch ($this->testOBJ->getQuestionSetType()) {
             case ilObjTest::QUESTION_SET_TYPE_FIXED:
             case ilObjTest::QUESTION_SET_TYPE_RANDOM:
                 global $ilUser;
                 require_once 'Modules/Test/classes/class.ilTestSession.php';
                 self::$testSession = new ilTestSession();
                 break;
             case ilObjTest::QUESTION_SET_TYPE_DYNAMIC:
                 require_once 'Modules/Test/classes/class.ilTestSessionDynamicQuestionSet.php';
                 self::$testSession = new ilTestSessionDynamicQuestionSet();
                 break;
         }
         self::$testSession->setRefId($this->testOBJ->getRefId());
         self::$testSession->setTestId($this->testOBJ->getTestId());
         if ($activeId) {
             self::$testSession->loadFromDb($activeId);
         } else {
             self::$testSession->loadTestSession($this->testOBJ->getTestId(), $ilUser->getId(), $_SESSION["tst_access_code"][$this->testOBJ->getTestId()]);
         }
     }
     return self::$testSession;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:33,代码来源:class.ilTestSessionFactory.php

示例2: getSequenceByActiveIdAndPass

 /**
  * creates and returns an instance of a test sequence
  * that corresponds to the current test mode and given active/pass
  * 
  * @param integer $activeId
  * @param integer $pass
  * @return ilTestSequenceFixedQuestionSet|ilTestSequenceRandomQuestionSet|ilTestSequenceDynamicQuestionSet
  */
 public function getSequenceByActiveIdAndPass($activeId, $pass)
 {
     if ($this->testSequences[$activeId][$pass] === null) {
         switch ($this->testOBJ->getQuestionSetType()) {
             case ilObjTest::QUESTION_SET_TYPE_FIXED:
                 require_once 'Modules/Test/classes/class.ilTestSequenceFixedQuestionSet.php';
                 $this->testSequences[$activeId][$pass] = new ilTestSequenceFixedQuestionSet($activeId, $pass, $this->testOBJ->isRandomTest());
                 break;
             case ilObjTest::QUESTION_SET_TYPE_RANDOM:
                 require_once 'Modules/Test/classes/class.ilTestSequenceRandomQuestionSet.php';
                 $this->testSequences[$activeId][$pass] = new ilTestSequenceRandomQuestionSet($activeId, $pass, $this->testOBJ->isRandomTest());
                 break;
             case ilObjTest::QUESTION_SET_TYPE_DYNAMIC:
                 require_once 'Modules/Test/classes/class.ilTestSequenceDynamicQuestionSet.php';
                 require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSet.php';
                 $questionSet = new ilTestDynamicQuestionSet($this->db, $this->lng, $this->pluginAdmin, $this->testOBJ);
                 $this->testSequences[$activeId][$pass] = new ilTestSequenceDynamicQuestionSet($this->db, $questionSet, $activeId);
                 #$this->testSequence->setPreventCheckedQuestionsFromComingUpEnabled(
                 #	$this->testOBJ->isInstantFeedbackAnswerFixationEnabled()
                 #); // checked questions now has to come up any time, so they can be set to unchecked right at this moment
                 break;
         }
     }
     return $this->testSequences[$activeId][$pass];
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:33,代码来源:class.ilTestSequenceFactory.php

示例3: getPlayerGUI

 /**
  * creates and returns an instance of a player gui
  * that corresponds to the current test mode
  * 
  * @return ilTestPlayerAbstractGUI
  */
 public function getPlayerGUI()
 {
     switch ($this->testOBJ->getQuestionSetType()) {
         case ilObjTest::QUESTION_SET_TYPE_FIXED:
         case ilObjTest::QUESTION_SET_TYPE_RANDOM:
             require_once 'Modules/Test/classes/class.ilTestOutputGUI.php';
             return new ilTestOutputGUI($this->testOBJ);
         case ilObjTest::QUESTION_SET_TYPE_DYNAMIC:
             require_once 'Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php';
             return new ilTestPlayerDynamicQuestionSetGUI($this->testOBJ);
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:18,代码来源:class.ilTestPlayerFactory.php

示例4: getNewTestSessionObject

 /**
  * @return ilTestSession|ilTestSessionDynamicQuestionSet
  */
 private function getNewTestSessionObject()
 {
     switch ($this->testOBJ->getQuestionSetType()) {
         case ilObjTest::QUESTION_SET_TYPE_FIXED:
         case ilObjTest::QUESTION_SET_TYPE_RANDOM:
             require_once 'Modules/Test/classes/class.ilTestSession.php';
             $testSession = new ilTestSession();
             break;
         case ilObjTest::QUESTION_SET_TYPE_DYNAMIC:
             require_once 'Modules/Test/classes/class.ilTestSessionDynamicQuestionSet.php';
             $testSession = new ilTestSessionDynamicQuestionSet();
             break;
     }
     return $testSession;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:18,代码来源:class.ilTestSessionFactory.php

示例5: getSequenceByPass

 /**
  * creates and returns an instance of a test sequence
  * that corresponds to the current test mode and given pass
  * 
  * @param ilTestSession|ilTestSessionDynamicQuestionSet $testSession
  * @param integer $pass
  * @return ilTestSequence|ilTestSequenceDynamicQuestionSet
  */
 public function getSequenceByPass($testSession, $pass)
 {
     if ($this->testSequence === null) {
         switch ($this->testOBJ->getQuestionSetType()) {
             case ilObjTest::QUESTION_SET_TYPE_FIXED:
                 require_once 'Modules/Test/classes/class.ilTestSequence.php';
                 $this->testSequence = new ilTestSequence($testSession->getActiveId(), $pass, $this->testOBJ->isRandomTest());
                 break;
             case ilObjTest::QUESTION_SET_TYPE_RANDOM:
                 require_once 'Modules/Test/classes/class.ilTestSequenceRandomQuestionSet.php';
                 $this->testSequence = new ilTestSequenceRandomQuestionSet($testSession->getActiveId(), $pass, $this->testOBJ->isRandomTest());
                 break;
             case ilObjTest::QUESTION_SET_TYPE_DYNAMIC:
                 require_once 'Modules/Test/classes/class.ilTestSequenceDynamicQuestionSet.php';
                 require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSet.php';
                 $questionSet = new ilTestDynamicQuestionSet($this->db, $this->lng, $this->pluginAdmin, $this->testOBJ);
                 $this->testSequence = new ilTestSequenceDynamicQuestionSet($this->db, $questionSet, $testSession->getActiveId());
                 break;
         }
     }
     return $this->testSequence;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:30,代码来源:class.ilTestSequenceFactory.php

示例6: buildForm

 private function buildForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
     $form->setTableWidth("100%");
     $form->setId("test_properties");
     if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_general_properties"));
         $form->addItem($header);
     }
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // anonymity
     $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
     if ($this->testOBJ->participantDataExist()) {
         $anonymity->setDisabled(true);
     }
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
     $anonymity->addOption($rb);
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
     $anonymity->addOption($rb);
     $anonymity->setValue((int) $this->testOBJ->getAnonymity());
     $form->addItem($anonymity);
     // test mode (question set type)
     $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
     $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
     $questSetType->addOption($questSetTypeFixed);
     $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
     $questSetType->addOption($questSetTypeRandom);
     $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
     $questSetType->addOption($questSetTypeContinues);
     $questSetType->setValue($this->testOBJ->getQuestionSetType());
     if ($this->testOBJ->participantDataExist()) {
         $questSetType->setDisabled(true);
     }
     $form->addItem($questSetType);
     // pool usage
     $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
     $pool_usage->setValue(1);
     $pool_usage->setChecked($this->testOBJ->getPoolUsage());
     $form->addItem($pool_usage);
     // enable_archiving
     $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
     $enable_archiving->setValue(1);
     $enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
     $form->addItem($enable_archiving);
     // activation/availability  (no template support yet)
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setChecked($this->testOBJ->isOnline());
     $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
     $form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setInfo($act_ref_info);
     $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
     $opt->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI("", "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $opt->addSubItem($dur);
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilObjTestSettingsGeneralGUI.php

示例7: getTabs


//.........这里部分代码省略.........
         case "addDefaults":
         case "applyDefaults":
         case "inviteParticipants":
         case "searchParticipants":
             if ($curUserHasWriteAccess && in_array($this->ctrl->getCmdClass(), array('ilobjtestgui', 'ilcertificategui'))) {
                 $this->getSettingsSubTabs($hidden_tabs);
             }
             break;
         case "export":
         case "print":
             break;
         case "statistics":
         case "eval_a":
         case "detailedEvaluation":
         case "outEvaluation":
         case "singleResults":
         case "exportEvaluation":
         case "evalUserDetail":
         case "passDetails":
         case "outStatisticsResultsOverview":
         case "statisticsPassDetails":
             $this->getStatisticsSubTabs();
             break;
     }
     if (strcmp(strtolower(get_class($this->object)), "ilobjtest") == 0) {
         // questions tab
         if ($ilAccess->checkAccess("write", "", $this->ref_id) && !in_array('assQuestions', $hidden_tabs)) {
             $force_active = $_GET["up"] != "" || $_GET["down"] != "" ? true : false;
             if (!$force_active) {
                 if ($_GET["browse"] == 1) {
                     $force_active = true;
                 }
             }
             switch ($this->object->getQuestionSetType()) {
                 case ilObjTest::QUESTION_SET_TYPE_FIXED:
                     $target = $this->ctrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'showPage');
                     break;
                 case ilObjTest::QUESTION_SET_TYPE_RANDOM:
                     $target = $this->ctrl->getLinkTargetByClass('ilTestRandomQuestionSetConfigGUI');
                     break;
                 case ilObjTest::QUESTION_SET_TYPE_DYNAMIC:
                     $target = $this->ctrl->getLinkTargetByClass('ilObjTestDynamicQuestionSetConfigGUI');
                     break;
             }
             $tabs_gui->addTarget("assQuestions", $target, array("questions", "createQuestion", "randomselect", "back", "createRandomSelection", "cancelRandomSelect", "insertRandomSelection", "removeQuestions", "moveQuestions", "insertQuestionsBefore", "insertQuestionsAfter", "confirmRemoveQuestions", "cancelRemoveQuestions", "executeCreateQuestion", "cancelCreateQuestion", "addQuestionpool", "saveRandomQuestions", "saveQuestionSelectionMode", "print", "addsource", "removesource", "randomQuestions"), "", "", $force_active);
         }
         // info tab
         if ($ilAccess->checkAccess("read", "", $this->ref_id) && !in_array('info_short', $hidden_tabs)) {
             $tabs_gui->addTarget("info_short", $this->ctrl->getLinkTarget($this, 'infoScreen'), array("infoScreen", "outIntroductionPage", "showSummary", "setAnonymousId", "outUserListOfAnswerPasses", "redirectToInfoScreen"));
         }
         // settings tab
         if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
             if (!in_array('settings', $hidden_tabs)) {
                 $settingsCommands = array("marks", "showMarkSchema", "addMarkStep", "deleteMarkSteps", "addSimpleMarkSchema", "saveMarks", "certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave", "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport", "scoring", "defaults", "addDefaults", "deleteDefaults", "applyDefaults", "inviteParticipants", "saveFixedParticipantsStatus", "searchParticipants", "addParticipants");
                 require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
                 $reflection = new ReflectionClass('ilObjTestSettingsGeneralGUI');
                 foreach ($reflection->getConstants() as $name => $value) {
                     if (substr($name, 0, 4) == 'CMD_') {
                         $settingsCommands[] = $value;
                     }
                 }
                 require_once 'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php';
                 $reflection = new ReflectionClass('ilObjTestSettingsScoringResultsGUI');
                 foreach ($reflection->getConstants() as $name => $value) {
                     if (substr($name, 0, 4) == 'CMD_') {
                         $settingsCommands[] = $value;
开发者ID:bheyser,项目名称:qplskl,代码行数:67,代码来源:class.ilObjTestGUI.php

示例8: getQuestionSetConfig

 /**
  * creates and returns an instance of a test question set config
  * that corresponds to the test's current question set type (test mode)
  * 
  * @return ilTestQuestionSetConfig
  */
 public function getQuestionSetConfig()
 {
     return $this->getQuestionSetConfigByType($this->testOBJ->getQuestionSetType());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:10,代码来源:class.ilTestQuestionSetConfigFactory.php


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