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


PHP ilObjTest::isRandomTest方法代码示例

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


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

示例1: 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

示例2: getQuestionsSubTabs

 function getQuestionsSubTabs()
 {
     global $ilTabs, $ilCtrl;
     $ilTabs->activateTab('assQuestions');
     $a_cmd = $ilCtrl->getCmd();
     if (!$this->object->isRandomTest()) {
         #if (in_array($this->object->getEnabledViewMode(), array('both', 'express'))) {
         $questions_per_page = $a_cmd == 'questions_per_page' || $a_cmd == 'removeQuestions' && $_REQUEST['test_express_mode'] ? true : false;
         $this->tabs_gui->addSubTabTarget("questions_per_page_view", $this->ctrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'showPage'), "", "", "", $questions_per_page);
         #}
     }
     include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
     $template = new ilSettingsTemplate($this->object->getTemplate(), ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
     if (!in_array('questions', $template->getHiddenTabs())) {
         // questions subtab
         $ilTabs->addSubTabTarget("edit_test_questions", $this->ctrl->getLinkTarget($this, 'questions'), array("questions", "createQuestion", "randomselect", "back", "createRandomSelection", "cancelRandomSelect", "insertRandomSelection", "removeQuestions", "moveQuestions", "insertQuestionsBefore", "insertQuestionsAfter", "confirmRemoveQuestions", "cancelRemoveQuestions", "executeCreateQuestion", "cancelCreateQuestion", "addQuestionpool", "saveRandomQuestions", "saveQuestionSelectionMode"), "");
         if (in_array($a_cmd, array('questions', 'createQuestion')) || $a_cmd == 'removeQuestions' && !$_REQUEST['test_express_mode']) {
             $this->tabs_gui->activateSubTab('edit_test_questions');
         }
     }
     #}
     // print view subtab
     if (!$this->object->isRandomTest()) {
         $ilTabs->addSubTabTarget("print_view", $this->ctrl->getLinkTarget($this, 'print'), "print", "", "", $this->ctrl->getCmd() == 'print');
         $ilTabs->addSubTabTarget('review_view', $this->ctrl->getLinkTarget($this, 'review'), 'review', '', '', $this->ctrl->getCmd() == 'review');
     }
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:27,代码来源:class.ilObjTestGUI.php

示例3: 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

示例4: buildAssignmentConfigurationInPoolHintMessage

 private function buildAssignmentConfigurationInPoolHintMessage()
 {
     switch (true) {
         case $this->testOBJ->isRandomTest():
             $testMode = $this->lng->txt('tst_question_set_type_random');
             break;
         case $this->testOBJ->isDynamicTest():
             $testMode = $this->lng->txt('tst_question_set_type_dynamic');
             break;
         default:
             return '';
     }
     return sprintf($this->lng->txt('tst_qst_skl_config_in_pool_hint_msg'), $testMode);
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:14,代码来源:class.ilTestSkillAdministrationGUI.php

示例5: buildVirtualSequence

 public function buildVirtualSequence(ilTestSession $testSession)
 {
     global $ilDB, $lng, $ilPluginAdmin;
     require_once 'Modules/Test/classes/class.ilTestVirtualSequence.php';
     $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
     if ($this->object->isRandomTest()) {
         require_once 'Modules/Test/classes/class.ilTestVirtualSequenceRandomQuestionSet.php';
         $virtualSequence = new ilTestVirtualSequenceRandomQuestionSet($ilDB, $this->object, $testSequenceFactory);
     } else {
         require_once 'Modules/Test/classes/class.ilTestVirtualSequence.php';
         $virtualSequence = new ilTestVirtualSequence($ilDB, $this->object, $testSequenceFactory);
     }
     $virtualSequence->setActiveId($testSession->getActiveId());
     $virtualSequence->init();
     return $virtualSequence;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:16,代码来源:class.ilTestService.php

示例6: exportToCSV


//.........这里部分代码省略.........
                 foreach ($additionalFields as $fieldname) {
                     if (strcmp($fieldname, "gender") == 0) {
                         array_push($datarow2, $this->lng->txt("gender_" . $userfields[$fieldname]));
                     } else {
                         array_push($datarow2, $userfields[$fieldname]);
                     }
                 }
             }
             array_push($datarow2, $data->getParticipant($active_id)->getReached());
             array_push($datarow2, $data->getParticipant($active_id)->getMaxpoints());
             array_push($datarow2, $data->getParticipant($active_id)->getMark());
             if ($this->test_obj->getECTSOutput()) {
                 array_push($datarow2, $data->getParticipant($active_id)->getECTSMark());
             }
             array_push($datarow2, $data->getParticipant($active_id)->getQuestionsWorkedThrough());
             array_push($datarow2, $data->getParticipant($active_id)->getNumberOfQuestions());
             array_push($datarow2, $data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent() / 100.0);
             $time = $data->getParticipant($active_id)->getTimeOfWork();
             $time_seconds = $time;
             $time_hours = floor($time_seconds / 3600);
             $time_seconds -= $time_hours * 3600;
             $time_minutes = floor($time_seconds / 60);
             $time_seconds -= $time_minutes * 60;
             array_push($datarow2, sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
             $time = $data->getParticipant($active_id)->getQuestionsWorkedThrough() ? $data->getParticipant($active_id)->getTimeOfWork() / $data->getParticipant($active_id)->getQuestionsWorkedThrough() : 0;
             $time_seconds = $time;
             $time_hours = floor($time_seconds / 3600);
             $time_seconds -= $time_hours * 3600;
             $time_minutes = floor($time_seconds / 60);
             $time_seconds -= $time_minutes * 60;
             array_push($datarow2, sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
             $fv = $data->getParticipant($active_id)->getFirstVisit();
             $lv = $data->getParticipant($active_id)->getLastVisit();
             foreach (array($fv, $lv) as $ts) {
                 if ($ts) {
                     $visit = ilFormat::formatDate(date('Y-m-d H:i:s', $ts), "datetime", false, false);
                     array_push($datarow2, $visit);
                 } else {
                     array_push($datarow2, "");
                 }
             }
             $median = $data->getStatistics()->getStatistics()->median();
             $pct = $data->getParticipant($active_id)->getMaxpoints() ? $median / $data->getParticipant($active_id)->getMaxpoints() * 100.0 : 0;
             $mark = $this->test_obj->mark_schema->getMatchingMark($pct);
             $mark_short_name = "";
             if (is_object($mark)) {
                 $mark_short_name = $mark->getShortName();
             }
             array_push($datarow2, $mark_short_name);
             array_push($datarow2, $data->getStatistics()->getStatistics()->rank($data->getParticipant($active_id)->getReached()));
             array_push($datarow2, $data->getStatistics()->getStatistics()->rank_median());
             array_push($datarow2, $data->getStatistics()->getStatistics()->count());
             array_push($datarow2, $median);
             if ($this->test_obj->getPassScoring() == SCORE_BEST_PASS) {
                 array_push($datarow2, $data->getParticipant($active_id)->getBestPass() + 1);
             } else {
                 array_push($datarow2, $data->getParticipant($active_id)->getLastPass() + 1);
             }
             for ($pass = 0; $pass <= $data->getParticipant($active_id)->getLastPass(); $pass++) {
                 $finishdate = $this->test_obj->getPassFinishDate($active_id, $pass);
                 if ($finishdate > 0) {
                     if ($pass > 0) {
                         for ($i = 1; $i < $col - 1; $i++) {
                             array_push($datarow2, "");
                             array_push($datarow, "");
                         }
                         array_push($datarow, "");
                     }
                     array_push($datarow2, $pass + 1);
                     if (is_object($data->getParticipant($active_id)) && is_array($data->getParticipant($active_id)->getQuestions($pass))) {
                         foreach ($data->getParticipant($active_id)->getQuestions($pass) as $question) {
                             $question_data = $data->getParticipant($active_id)->getPass($pass)->getAnsweredQuestionByQuestionId($question["id"]);
                             array_push($datarow2, $question_data["reached"]);
                             array_push($datarow, preg_replace("/<.*?>/", "", $data->getQuestionTitle($question["id"])));
                         }
                     }
                     if ($this->test_obj->isRandomTest() || $this->test_obj->getShuffleQuestions() || $counter == 1 && $pass == 0) {
                         array_push($rows, $datarow);
                     }
                     $datarow = array();
                     array_push($rows, $datarow2);
                     $datarow2 = array();
                 }
             }
             $counter++;
         }
     }
     $csv = "";
     $separator = ";";
     foreach ($rows as $evalrow) {
         $csvrow =& $this->test_obj->processCSVRow($evalrow, TRUE, $separator);
         $csv .= join($csvrow, $separator) . "\n";
     }
     if ($deliver) {
         ilUtil::deliverData($csv, ilUtil::getASCIIFilename($this->test_obj->getTitle() . "_results.csv"));
         exit;
     } else {
         return $csv;
     }
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:101,代码来源:class.ilTestExport.php

示例7: isRandomTestSettingSwitched

 private function isRandomTestSettingSwitched($random_test)
 {
     return $random_test != $this->object->isRandomTest();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:4,代码来源:class.ilObjTestGUI.php

示例8: 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


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