From c2975d50a165dc71d2a52ee6d613848f4f6c2cac Mon Sep 17 00:00:00 2001 From: nmatuschek Date: Fri, 9 Feb 2018 10:45:49 +0100 Subject: [PATCH 01/10] Publish Release_5.x --- README.md | 2 +- README.txt | 11 --- .../class.ilFatImageMapQuestionAdapter.php | 3 +- classes/class.ilFormATestExporter.php | 3 +- classes/class.ilFormATestImporter.php | 12 +-- .../class.ilFormATestLPSummaryTableGUI.php | 13 ++-- classes/class.ilFormATestLPUsersTableGUI.php | 17 ++--- classes/class.ilFormATestPlugin.php | 6 +- classes/class.ilObjFormATest.php | 59 +++++++-------- classes/class.ilObjFormATestAccess.php | 8 +- classes/class.ilObjFormATestGUI.php | 75 ++++++++----------- classes/class.ilObjFormATestListGUI.php | 6 +- ...class.ilObjFormATestQuestionSetPoolGUI.php | 17 +++-- .../abstract.ilXTSFControllerGUI.php | 27 +++---- .../class.ilFormATestOutputGUI.php | 12 +-- .../class.ilFormATestPlayerControllerGUI.php | 4 +- .../class.ilFormATestPropertiesGUI.php | 6 +- .../controllers/class.ilFormATestSetsGUI.php | 4 +- ...lass.ilFormATestSkillAdministrationGUI.php | 4 +- classes/models/abstract.ilXTSFModelList.php | 4 +- .../models/class.ilFormATestResultList.php | 4 +- classes/models/class.ilFormATestSession.php | 26 +++---- .../models/class.ilFormATestSessionSet.php | 6 +- classes/models/class.ilFormATestSetList.php | 4 +- ...stract.ilXTSFTableDatabaseDataProvider.php | 4 +- classes/tables/abstract.ilXTSFTableGUI.php | 5 +- .../class.ilFormATestExportTableGUI.php | 6 +- .../tables/class.ilFormATestSetsTableGUI.php | 4 +- .../utils/class.ilFormATestAccordionGUI.php | 11 +-- ...ass.ilFormATestDominantScoringReworker.php | 4 +- .../utils/class.ilFormATestInfoScreenGUI.php | 6 +- .../class.ilFormATestSkillLevelHelper.php | 10 +-- classes/utils/class.ilObjTestGateway.php | 16 ++-- plugin.php | 6 +- 34 files changed, 190 insertions(+), 215 deletions(-) delete mode 100644 README.txt diff --git a/README.md b/README.md index 9c0560c..4415220 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ILIAS FormATest -* For ILIAS versions: 5.2.0 - 5.2.999 +* For ILIAS versions: 5.3.0 - 5.3.999 ## Installation Instructions 1. Clone this repository to /Customizing/global/plugins/Services/Repository/RepositoryObject/FormATest diff --git a/README.txt b/README.txt deleted file mode 100644 index f82932d..0000000 --- a/README.txt +++ /dev/null @@ -1,11 +0,0 @@ -****************************************************************************** -INSTALLATION INSTRUCTIONS (You need at least ILIAS 5.1.0) -****************************************************************************** - -1. Clone this repository to /Customizing/global/plugins/Services/Repository/RepositoryObject/AdobeConnect -2. Login to ILIAS with an administrator account (e.g. root) -3. Select **Plugins** from the **Administration** main menu drop down. -4. Search the **AdobeConnect** plugin in the list of plugin and choose **Activate** from the **Actions** drop down. -5. Choose **Configure** from the **Actions** drop down and enter the required data. - -* The FormATest plugin is only usable with the QuestionSetPool plugin. \ No newline at end of file diff --git a/classes/adapter/class.ilFatImageMapQuestionAdapter.php b/classes/adapter/class.ilFatImageMapQuestionAdapter.php index f67a020..2cc5262 100644 --- a/classes/adapter/class.ilFatImageMapQuestionAdapter.php +++ b/classes/adapter/class.ilFatImageMapQuestionAdapter.php @@ -11,7 +11,8 @@ class ilFatImageMapQuestionAdapter extends assImagemapQuestion { public function saveWorkingData($active_id, $pass = NULL, $authorized = true) { - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); if (is_null($pass)) { diff --git a/classes/class.ilFormATestExporter.php b/classes/class.ilFormATestExporter.php index 6091966..9e7588a 100755 --- a/classes/class.ilFormATestExporter.php +++ b/classes/class.ilFormATestExporter.php @@ -110,7 +110,8 @@ class ilFormATestExporter extends ilXmlExporter */ public function exportPagesXML() { - global $ilBench; + global $DIC; + $ilBench = $DIC['ilBench']; $this->mob_ids = array(); $this->file_ids = array(); diff --git a/classes/class.ilFormATestImporter.php b/classes/class.ilFormATestImporter.php index ff1cfbd..4c3e1db 100644 --- a/classes/class.ilFormATestImporter.php +++ b/classes/class.ilFormATestImporter.php @@ -131,7 +131,8 @@ class ilFormATestImporter extends ilXmlImporter */ public function createImportDirectory() { - global $ilErr; + global $DIC; + $ilErr = $DIC['ilErr']; include_once "./Services/Utilities/classes/class.ilUtil.php"; @@ -453,10 +454,8 @@ class ilFormATestImporter extends ilXmlImporter */ function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping) { - /** - * @var $tree ilTree - */ - global $tree; + global $DIC; + $tree = $DIC->repositoryTree(); $this->plugin_object->includeClass('class.ilObjFormATest.php'); $this->plugin_object->includeClass('class.ilObjFormATestXMLParser.php'); @@ -574,7 +573,8 @@ class ilFormATestImporter extends ilXmlImporter */ protected function setNewOriginalSetIds($set_mapping = array()) { - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); foreach($set_mapping as $xtsf_set_id => $xqsp_set_id) { diff --git a/classes/class.ilFormATestLPSummaryTableGUI.php b/classes/class.ilFormATestLPSummaryTableGUI.php index df07f30..de5f9e9 100644 --- a/classes/class.ilFormATestLPSummaryTableGUI.php +++ b/classes/class.ilFormATestLPSummaryTableGUI.php @@ -13,12 +13,10 @@ class ilFormATestLPSummaryTableGUI extends ilTrSummaryTableGUI */ protected function parseTitle($a_obj_id, $action, $a_user_id = false) { - /** - * @var $lng ilLanguage - * @var $ilObjDataCache ilObjectDataCache - * @var $ilUser ilObjUser - */ - global $lng, $ilObjDataCache, $ilUser; + global $DIC; + $lng = $DIC->language(); + $ilObjDataCache = $DIC['ilObjDataCache']; + $ilUser = $DIC->user(); $user = ''; if($a_user_id) @@ -115,7 +113,8 @@ class ilFormATestLPSummaryTableGUI extends ilTrSummaryTableGUI */ protected function fillRow($a_set) { - global $lng, $ilCtrl; + global $DIC; + $lng = $DIC->language(); $this->tpl->setVariable("ICON", ilObject::_getIcon("", "tiny", $a_set["type"])); $this->tpl->setVariable("ICON_ALT", $lng->txt($a_set["type"])); diff --git a/classes/class.ilFormATestLPUsersTableGUI.php b/classes/class.ilFormATestLPUsersTableGUI.php index 515fdd7..0b40fb0 100644 --- a/classes/class.ilFormATestLPUsersTableGUI.php +++ b/classes/class.ilFormATestLPUsersTableGUI.php @@ -25,12 +25,10 @@ class ilFormATestLPUsersTableGUI extends ilTrObjectUsersPropsTableGUI */ protected function parseTitle($a_obj_id, $action, $a_user_id = false) { - /** - * @var $lng ilLanguage - * @var $ilObjDataCache ilObjectDataCache - * @var $ilUser ilObjUser - */ - global $lng, $ilObjDataCache, $ilUser; + global $DIC; + $lng = $DIC->language(); + $ilObjDataCache = $DIC['ilObjDataCache']; + $ilUser = $DIC->user(); $user = ''; if($a_user_id) @@ -135,11 +133,8 @@ class ilFormATestLPUsersTableGUI extends ilTrObjectUsersPropsTableGUI */ protected function fillRow($data) { - /** - * @var $ilCtrl ilCtrl - * @var $lng ilLanguage - */ - global $ilCtrl, $lng; + global $DIC; + $lng = $DIC->language(); foreach ($this->getSelectedColumns() as $c) { diff --git a/classes/class.ilFormATestPlugin.php b/classes/class.ilFormATestPlugin.php index 115ecf4..5537a93 100644 --- a/classes/class.ilFormATestPlugin.php +++ b/classes/class.ilFormATestPlugin.php @@ -76,10 +76,8 @@ class ilFormATestPlugin extends ilRepositoryObjectPlugin protected function uninstallCustom() { - /** - * @var $ilDB ilDB - */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); if($ilDB->tableExists('rep_robj_xtsf_data')) { diff --git a/classes/class.ilObjFormATest.php b/classes/class.ilObjFormATest.php index a0e0e34..de46481 100644 --- a/classes/class.ilObjFormATest.php +++ b/classes/class.ilObjFormATest.php @@ -221,17 +221,12 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public function __construct($ref_id = 0) { - /** - * @var $ilDB ilDB - * @var $ilLog ilLog - * @var $ilUser ilObjUser - * @var $lng ilLanguage - */ - global $ilDB, $ilLog, $ilUser, $lng; - - $this->db = $ilDB; - $this->log = $ilLog; - $this->user = $ilUser; + global $DIC; + + $this->db = $DIC->database(); + $this->log = $DIC->logger(); + $this->user = $DIC->user(); + $lng = $DIC->language(); $this->score_reporting = self::SCORE_REPORTING_ALWAYS; $this->max_passes = 0; @@ -267,10 +262,8 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public function getQuestionEditingFormBackTarget($context) { - /** - * @var $ilCtrl ilCtrl - */ - global $ilCtrl; + global $DIC; + $ilCtrl = $DIC->ctrl(); $params = @json_decode(base64_decode($context), true); $ilCtrl->setParameterByClass('ilObjPluginDispatchGUI', 'ref_id', $this->getRefId()); @@ -765,10 +758,7 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public function getPercentageForUser($a_user_id) { - /** - * @var $ilDB iLDB - */ - global $ilDB; + $ilDB = $this->db; $set = $ilDB->query( "SELECT tst_result_cache.*, tst_active.user_fi FROM " . @@ -1222,6 +1212,9 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public function bindForm(ilPropertyFormGUI $form) { + global $DIC; + $ilSetting = $DIC->settings(); + if($form->getItemByPostVar("title")) { $this->setTitle($form->getInput('title')); @@ -1238,7 +1231,6 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface $this->setSkillServiceEnabled((bool)$form->getInput('skill_service')); // Selector for uicode characters - global $ilSetting; if($ilSetting->get('char_selector_availability') > 0) { require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php'; @@ -1338,10 +1330,8 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public static function preloadDataForLists(array $obj_ids, array $ref_ids = array()) { - /** - * @var $ilDB iLDB - */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); if(count($obj_ids) == 1) { @@ -1369,7 +1359,7 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface { if(ilObjAssessmentFolder::_enabledAssessmentLogging()) { - global $ilUser; + $ilUser = $this->user; $original_id = ""; if(strcmp($set_id, "") != 0) @@ -1605,7 +1595,8 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface public static function deleteFeedback($node_index, $set_id, $session_id) { - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $ilDB->manipulateF('DELETE FROM rep_robj_xtsf_fbt WHERE step >= %s @@ -1619,7 +1610,8 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public static function updateConditionEvaluation(array $data) { - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $node = $data['node']; $node_index = $data['node_index']; @@ -1690,7 +1682,8 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public function getNodeFeedbacks($session_id, $set_id, $node_id, $step) { - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $feedbacks = array(); @@ -1748,7 +1741,10 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public function isFeedbackEnabled() { - global $ilDB, $ilUser, $ilAccess; + global $DIC; + $ilDB = $DIC->database(); + $ilUser = $DIC->user(); + $ilAccess = $DIC->access(); $res = $ilDB->queryF('SELECT node_fb_part FROM rep_robj_xtsf_data WHERE id = %s', array('integer'), array($this->getId())); @@ -1771,7 +1767,10 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface */ public function isResultFeedbackEnabled() { - global $ilDB, $ilUser, $ilAccess; + global $DIC; + $ilDB = $DIC->database(); + $ilUser = $DIC->user(); + $ilAccess = $DIC->access(); $res = $ilDB->queryF('SELECT node_fb_author, node_fb_part, node_fb_part_res FROM rep_robj_xtsf_data WHERE id = %s', array('integer'), array($this->getId())); diff --git a/classes/class.ilObjFormATestAccess.php b/classes/class.ilObjFormATestAccess.php index 30bf9c8..07063a0 100644 --- a/classes/class.ilObjFormATestAccess.php +++ b/classes/class.ilObjFormATestAccess.php @@ -19,11 +19,9 @@ class ilObjFormATestAccess extends ilObjectPluginAccess */ public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = '') { - /** - * @var $ilUser ilObjUser - * @var $ilAccess ilAccessHandler - */ - global $ilUser, $ilAccess; + global $DIC; + $ilUser = $DIC->user(); + $ilAccess = $DIC->access(); if(!$a_user_id) { diff --git a/classes/class.ilObjFormATestGUI.php b/classes/class.ilObjFormATestGUI.php index 3e51533..30640bc 100644 --- a/classes/class.ilObjFormATestGUI.php +++ b/classes/class.ilObjFormATestGUI.php @@ -86,12 +86,12 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ public function performCommand($cmd) { - /** - * @var $ilTabs ilTabsGUI - * @var $tpl ilTemplate - * @var $lng ilLanguage - */ - global $ilTabs, $tpl, $lng, $ilDB, $ilPluginAdmin; + global $DIC; + $ilTabs = $DIC->tabs(); + $tpl = $DIC->ui()->mainTemplate(); + $lng = $DIC->language(); + $ilDB = $DIC->database(); + $ilPluginAdmin = $DIC['ilPluginAdmin']; require_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/FormATest/classes/dispatcher/class.ilXTSFPluginDispatcher.php"; @@ -250,12 +250,10 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ protected function setTabs() { - /** - * @var $ilTabs ilTabsGUI - * @var $ilCtrl ilCtrl - * @var $lng ilLanguage - */ - global $ilTabs, $ilCtrl, $lng; + global $DIC; + $ilTabs = $DIC->tabs(); + $ilCtrl = $DIC->ctrl(); + $lng = $DIC->language(); $ilTabs->clearTargets(); @@ -267,7 +265,6 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli if($this->checkPermissionBool("read")) { - global $lng; $ilTabs->addTab("info_short", $lng->txt("info_short"), $ilCtrl->getLinkTarget($this, "ilFormATestInfoScreenControllerGUI.show")); } @@ -387,10 +384,8 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ protected function initHeaderAction($a_sub_type = null, $a_sub_id = null) { - /** - * @var $ilUser ilObjUser - */ - global $ilUser; + global $DIC; + $ilUser = $DIC->user(); $lg = parent::initHeaderAction(); if($lg instanceof ilObjFormATestListGUI) @@ -409,11 +404,9 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ public function addToDeskObject() { - /** - * @var $ilSetting ilSetting - * @var $lng ilLanguage - */ - global $ilSetting, $lng; + global $DIC; + $ilSetting = $DIC->settings(); + $lng = $DIC->language(); if((int)$ilSetting->get('disable_my_offers')) { @@ -432,7 +425,9 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ public function removeFromDeskObject() { - global $ilSetting, $lng; + global $DIC; + $ilSetting = $DIC->settings(); + $lng = $DIC->language(); if((int)$ilSetting->get('disable_my_offers')) { @@ -554,15 +549,12 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ protected function editProperties() { - /** - * @var $tpl ilTemplate - */ - global $tpl; + global $DIC; $this->initPropertiesForm(); $this->getPropertiesValues(); - $tpl->setContent($this->form->getHTML()); + $DIC->ui()->mainTemplate()->setContent($this->form->getHTML()); } /** @@ -570,10 +562,8 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ protected function initPropertiesForm() { - /** - * @var $ilCtrl ilCtrl - */ - global $ilCtrl; + global $DIC; + $ilCtrl = $DIC->ctrl(); $this->form = new ilPropertyFormGUI(); $this->form->setTitle($this->txt('edit_properties')); @@ -609,12 +599,10 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ protected function updateProperties() { - /** - * @var $tpl ilTemplate - * @var $lng ilLanguage - * @var $ilCtrl ilCtrl - */ - global $tpl, $lng, $ilCtrl; + global $DIC; + $tpl = $DIC->ui()->mainTemplate(); + $lng = $DIC->language(); + $ilCtrl = $DIC->ctrl(); $this->initPropertiesForm(); if($this->form->checkInput()) @@ -646,10 +634,8 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli */ public function saveObject() { - /** - * @var $ilCtrl ilCtrl - */ - global $ilCtrl; + global $DIC; + $ilCtrl = $DIC->ctrl(); try { @@ -674,7 +660,10 @@ class ilObjFormATestGUI extends ilObjectPluginGUI implements ilDesktopItemHandli public static function _goto($a_target, $a_thread = 0, $a_posting = 0) { - global $ilCtrl, $ilAccess, $lng; + global $DIC; + $ilCtrl = $DIC->ctrl(); + $ilAccess = $DIC->access(); + $lng = $DIC->language(); $t = explode("_", $a_target[0]); $ref_id = (int) $t[0]; diff --git a/classes/class.ilObjFormATestListGUI.php b/classes/class.ilObjFormATestListGUI.php index c370cfa..f5c5fb8 100644 --- a/classes/class.ilObjFormATestListGUI.php +++ b/classes/class.ilObjFormATestListGUI.php @@ -66,10 +66,8 @@ class ilObjFormATestListGUI extends ilObjectPluginListGUI */ public function getProperties() { - /** - * @var $lng ilLanguage - */ - global $lng; + global $DIC; + $lng = $DIC->language(); $props = array(); include_once "class.ilObjFormATestAccess.php"; diff --git a/classes/class.ilObjFormATestQuestionSetPoolGUI.php b/classes/class.ilObjFormATestQuestionSetPoolGUI.php index d2b8167..746391d 100644 --- a/classes/class.ilObjFormATestQuestionSetPoolGUI.php +++ b/classes/class.ilObjFormATestQuestionSetPoolGUI.php @@ -18,7 +18,13 @@ class ilObjFormATestQuestionSetPoolGUI extends ilObjQuestionSetPoolGUI */ function &executeCommand() { - global $ilCtrl, $tpl, $lng, $ilTabs, $ilLocator, $ilToolbar; + global $DIC; + $ilCtrl = $DIC->ctrl(); + $tpl = $DIC->ui()->mainTemplate(); + $lng = $DIC->language(); + $ilTabs = $DIC->tabs(); + $ilLocator = $DIC['ilLocator']; + $ilToolbar = $DIC->toolbar(); $available_pools = array_keys(ilObjQuestionSetPool::getAvailableQuestionSetPools()); @@ -124,10 +130,8 @@ class ilObjFormATestQuestionSetPoolGUI extends ilObjQuestionSetPoolGUI public function setTabs() { - /** - * @var ilTabsGUI $ilTabs - */ - global $ilTabs; + global $DIC; + $ilTabs = $DIC->tabs(); $ilTabs->clearTargets(); @@ -144,7 +148,8 @@ class ilObjFormATestQuestionSetPoolGUI extends ilObjQuestionSetPoolGUI */ function addLocatorItems() { - global $ilLocator; + global $DIC; + $ilLocator = $DIC['ilLocator']; if (!$this->getCreationMode()) { diff --git a/classes/controllers/abstract.ilXTSFControllerGUI.php b/classes/controllers/abstract.ilXTSFControllerGUI.php index b7d82c9..c4f5d2e 100644 --- a/classes/controllers/abstract.ilXTSFControllerGUI.php +++ b/classes/controllers/abstract.ilXTSFControllerGUI.php @@ -58,24 +58,16 @@ abstract class ilXTSFControllerGUI { */ public function __construct(ilObjFormATestGUI $controller) { - /** - * @var $ilCtrl ilCtrl - * @var $tpl ilTemplate - * @var $lng ilLanguage - * @var $ilToolbar ilToolbarGUI - * @var $ilTabs ilTabsGUI - * @var $ilUser ilObjUser - */ - global $ilCtrl, $tpl, $lng, $ilToolbar, $ilTabs, $ilUser; - + global $DIC; + $this->controller = $controller; - $this->ctrl = $ilCtrl; - $this->tpl = $tpl; + $this->ctrl = $DIC->ctrl(); + $this->tpl = $DIC->ui()->mainTemplate(); $this->plugin = $this->controller->plugin; - $this->lng = $lng; - $this->toolbar = $ilToolbar; - $this->tabs = $ilTabs; - $this->user = $ilUser; + $this->lng = $DIC->language(); + $this->toolbar = $DIC->toolbar(); + $this->tabs = $DIC->tabs(); + $this->user = $DIC->user(); $this->activateTab(); $this->includeRequirements(); } @@ -112,11 +104,10 @@ abstract class ilXTSFControllerGUI { */ private function activateTab() { - global $ilTabs; if($this->getCurrentTab() != "") { - $ilTabs->activateTab($this->getCurrentTab()); + $this->tabs->activateTab($this->getCurrentTab()); } } diff --git a/classes/controllers/class.ilFormATestOutputGUI.php b/classes/controllers/class.ilFormATestOutputGUI.php index f428153..353aac7 100644 --- a/classes/controllers/class.ilFormATestOutputGUI.php +++ b/classes/controllers/class.ilFormATestOutputGUI.php @@ -27,7 +27,9 @@ class ilFormATestOutputGUI extends ilXTSFControllerGUI protected function populateCharSelector() { - global $ilSetting; + global $DIC; + $ilSetting = $DIC->settings(); + if ($ilSetting->get('char_selector_availability') > 0) { require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php'; @@ -163,8 +165,8 @@ class ilFormATestOutputGUI extends ilXTSFControllerGUI private function showFeedbackButton() { - global $tpl, $lng; - + $tpl = $this->tpl; + $lng = $this->lng; $tpl->setCurrentBlock("direct_feedback"); $tpl->setVariable("CMD_SHOW_INSTANT_RESPONSE", 'showInstantResponse'); $tpl->setVariable("TEXT_SHOW_INSTANT_RESPONSE", $lng->txt("check")); @@ -215,8 +217,8 @@ class ilFormATestOutputGUI extends ilXTSFControllerGUI protected function fillQuestionRelatedNavigation(assQuestionGUI $questionGUI) { - global $tpl; - + $tpl = $this->tpl; + $parseQuestionRelatedNavigation = false; switch( 1 ) diff --git a/classes/controllers/class.ilFormATestPlayerControllerGUI.php b/classes/controllers/class.ilFormATestPlayerControllerGUI.php index f8992f0..dc14bb9 100644 --- a/classes/controllers/class.ilFormATestPlayerControllerGUI.php +++ b/classes/controllers/class.ilFormATestPlayerControllerGUI.php @@ -291,7 +291,9 @@ class ilFormATestPlayerControllerGUI extends ilXTSFControllerGUI public function finishTest() { - global $tpl, $ilCtrl, $lng; + $tpl = $this->tpl; + $ilCtrl = $this->ctrl; + $lng = $this->lng; $this->controller->ensurePermission("read"); diff --git a/classes/controllers/class.ilFormATestPropertiesGUI.php b/classes/controllers/class.ilFormATestPropertiesGUI.php index e241de2..29d85f3 100644 --- a/classes/controllers/class.ilFormATestPropertiesGUI.php +++ b/classes/controllers/class.ilFormATestPropertiesGUI.php @@ -104,7 +104,8 @@ class ilFormATestPropertiesGUI extends ilXTSFControllerFormGUI $allow_interruption->setValue(1); $skill_service = new ilCheckboxInputGUI($this->plugin->txt("skill_service_setting"), "skill_service"); - global $ilSetting; + global $DIC; + $ilSetting = $DIC->settings(); $skill_setting_enabled = $ilSetting->_lookupValue('skmg','enable_skmg'); $skill_service->setDisabled($this->controller->object->getParticipants()->hasParticipants() || $skill_setting_enabled == false); @@ -221,7 +222,8 @@ class ilFormATestPropertiesGUI extends ilXTSFControllerFormGUI $this->form->addItem($node_feedback); // selector for unicode characters - global $ilSetting; + global $DIC; + $ilSetting = $DIC->settings(); if($ilSetting->get('char_selector_availability') > 0) { // If there will be more presentation settings in future, move this header creation diff --git a/classes/controllers/class.ilFormATestSetsGUI.php b/classes/controllers/class.ilFormATestSetsGUI.php index 6218f51..f42019e 100644 --- a/classes/controllers/class.ilFormATestSetsGUI.php +++ b/classes/controllers/class.ilFormATestSetsGUI.php @@ -39,7 +39,7 @@ class ilFormATestSetsGUI extends ilXTSFControllerTableGUI } else { - $table->addMultiCommand("ilFormATestSetsGUI.removeSets", $table->lng->txt("remove")); + $table->addMultiCommand("ilFormATestSetsGUI.removeSets", $this->lng->txt("remove")); $table->addCommandButton("ilFormATestSetsGUI.saveSorting", $this->plugin->txt("save_sorting")); } @@ -60,7 +60,7 @@ class ilFormATestSetsGUI extends ilXTSFControllerTableGUI $table = new ilFormATestSetsTableGUI($this->controller, $this->plugin, "ilFormATestSetsGUI.browseForSets"); $modellist = new ilFormATestQuestionSetPoolSetList($this->controller->object); $table->setModelList($modellist); - $table->addMultiCommand("ilFormATestSetsGUI.insertSets", $table->lng->txt("insert")); + $table->addMultiCommand("ilFormATestSetsGUI.insertSets", $this->lng->txt("insert")); $table->populate(); $data = $modellist->getData(); diff --git a/classes/controllers/class.ilFormATestSkillAdministrationGUI.php b/classes/controllers/class.ilFormATestSkillAdministrationGUI.php index 5e78ff5..0d5f208 100644 --- a/classes/controllers/class.ilFormATestSkillAdministrationGUI.php +++ b/classes/controllers/class.ilFormATestSkillAdministrationGUI.php @@ -29,7 +29,9 @@ class ilFormATestSkillAdministrationGUI extends ilXTSFControllerGUI public function executeCommand() { - global $ilDB, $ilPluginAdmin, $ilAccess; + global $DIC; + $ilDB = $DIC->database(); + $ilAccess = $DIC->access(); if( $this->isAccessDenied() ) { diff --git a/classes/models/abstract.ilXTSFModelList.php b/classes/models/abstract.ilXTSFModelList.php index b858926..c993764 100644 --- a/classes/models/abstract.ilXTSFModelList.php +++ b/classes/models/abstract.ilXTSFModelList.php @@ -32,10 +32,10 @@ abstract class ilXTSFModelList public function __construct(ilObjFormATest $form_a_test) { - global $ilDB; + global $DIC; $this->form_a_test = $form_a_test; - $this->db = $ilDB; + $this->db = $DIC->database(); } /** diff --git a/classes/models/class.ilFormATestResultList.php b/classes/models/class.ilFormATestResultList.php index c23cbde..33eb0e4 100644 --- a/classes/models/class.ilFormATestResultList.php +++ b/classes/models/class.ilFormATestResultList.php @@ -33,10 +33,10 @@ class ilFormATestResultList extends ilXTSFModelList */ public function __construct($active_id) { - global $ilDB; + global $DIC; $this->active_id = $active_id; - $this->db = $ilDB; + $this->db = $DIC->database(); } /** diff --git a/classes/models/class.ilFormATestSession.php b/classes/models/class.ilFormATestSession.php index 7cee9ce..02778f1 100644 --- a/classes/models/class.ilFormATestSession.php +++ b/classes/models/class.ilFormATestSession.php @@ -92,10 +92,10 @@ class ilFormATestSession */ public function __construct($test) { - global $ilDB, $ilUser; + global $DIC; - $this->db = $ilDB; - $this->user_id = $ilUser->getId(); + $this->db = $DIC->database(); + $this->user_id = $DIC->user()->getId(); $this->test_id = $test->getTestId(); $this->obj_id = $test->getId(); $this->ref_id = $test->getRefId(); @@ -775,8 +775,8 @@ class ilFormATestSession */ public static function getUserIdByActiveId($active_id) { - /** @var ilDB $ilDB */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $result = $ilDB->queryF( "SELECT user_fi FROM tst_active WHERE active_id = %s", @@ -795,8 +795,8 @@ class ilFormATestSession */ public static function getUserIdBySessionId($session_id) { - /** @var ilDB $ilDB */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); // $ilDB->setLimit(1, 0); $result = $ilDB->queryF( @@ -818,8 +818,8 @@ class ilFormATestSession */ public static function getActiveIdBySessionId($session_id) { - /** @var ilDB $ilDB */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); // $ilDB->setLimit(1, 0); $result = $ilDB->queryF( @@ -839,8 +839,8 @@ class ilFormATestSession */ public static function getPassBySessionId($session_id) { - /** @var ilDB $ilDB */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); // $ilDB->setLimit(1, 0); $result = $ilDB->queryF( @@ -861,8 +861,8 @@ class ilFormATestSession */ public static function getSessionIdByActiveIdAndPass($active_id, $pass) { - /** @var ilDB $ilDB */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $result = $ilDB->queryF( "SELECT session_id FROM rep_robj_xtsf_session WHERE active_id = %s and current_pass = %s", diff --git a/classes/models/class.ilFormATestSessionSet.php b/classes/models/class.ilFormATestSessionSet.php index 37ba7d7..7e0a193 100644 --- a/classes/models/class.ilFormATestSessionSet.php +++ b/classes/models/class.ilFormATestSessionSet.php @@ -67,7 +67,8 @@ class ilFormATestSessionSet */ public function __construct($set_id) { - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $this->set_id = $set_id; $this->db = $ilDB; @@ -213,7 +214,8 @@ class ilFormATestSessionSet */ public function getStepByNodeId($node_id) { - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $res = $ilDB->queryF('SELECT node_index FROM rep_robj_xqsp_node WHERE id = %s', array('integer'), array($node_id)); diff --git a/classes/models/class.ilFormATestSetList.php b/classes/models/class.ilFormATestSetList.php index dd0dbbd..f6c1884 100644 --- a/classes/models/class.ilFormATestSetList.php +++ b/classes/models/class.ilFormATestSetList.php @@ -20,9 +20,9 @@ class ilFormATestSetList extends ilXTSFModelList public function __construct(ilObjFormATest $form_a_test) { - global $lng; + global $DIC; - $this->lng = $lng; + $this->lng = $DIC->language(); parent::__construct($form_a_test); } diff --git a/classes/providers/abstract.ilXTSFTableDatabaseDataProvider.php b/classes/providers/abstract.ilXTSFTableDatabaseDataProvider.php index 66d7adb..b0a02bc 100644 --- a/classes/providers/abstract.ilXTSFTableDatabaseDataProvider.php +++ b/classes/providers/abstract.ilXTSFTableDatabaseDataProvider.php @@ -36,9 +36,9 @@ abstract class ilXTSFTableDatabaseDataProvider implements ilXTSFTableDataProvide */ public function __construct() { - global $ilDB; + global $DIC; - $this->db = $ilDB; + $this->db = $DIC->database(); } /** diff --git a/classes/tables/abstract.ilXTSFTableGUI.php b/classes/tables/abstract.ilXTSFTableGUI.php index c019d78..b6558d6 100644 --- a/classes/tables/abstract.ilXTSFTableGUI.php +++ b/classes/tables/abstract.ilXTSFTableGUI.php @@ -51,10 +51,9 @@ abstract class ilXTSFTableGUI extends ilTable2GUI public function __construct($a_parent_obj, $a_parent_cmd = "", $plugin) { - /** @var ilCtrl $ilCtrl */ - global $ilCtrl; + global $DIC; - $this->ctrl = $ilCtrl; + $this->ctrl = $DIC->ctrl(); $this->plugin = $plugin; parent::__construct($a_parent_obj, $a_parent_cmd); diff --git a/classes/tables/class.ilFormATestExportTableGUI.php b/classes/tables/class.ilFormATestExportTableGUI.php index 562260b..06c246a 100755 --- a/classes/tables/class.ilFormATestExportTableGUI.php +++ b/classes/tables/class.ilFormATestExportTableGUI.php @@ -32,10 +32,8 @@ class ilFormATestExportTableGUI extends ilExportTableGUI */ protected function formatActionsList($type, $filename) { - /** - * @var $ilCtrl ilCtrl - */ - global $ilCtrl; + global $DIC; + $ilCtrl = $DIC->ctrl(); $list = new ilAdvancedSelectionListGUI(); $list->setListTitle($this->lng->txt('actions')); diff --git a/classes/tables/class.ilFormATestSetsTableGUI.php b/classes/tables/class.ilFormATestSetsTableGUI.php index 5f51c80..a8bc69a 100644 --- a/classes/tables/class.ilFormATestSetsTableGUI.php +++ b/classes/tables/class.ilFormATestSetsTableGUI.php @@ -24,9 +24,9 @@ class ilFormATestSetsTableGUI extends ilXTSFTableGUI public function __construct($controller, $plugin, $action = "", $show_sorting = false, $has_participants = false) { - global $ilCtrl; + global $DIC; - $this->ctrl = $ilCtrl; + $this->ctrl = $DIC->ctrl(); $this->has_participants = $has_participants; $this->show_sorting = $show_sorting; diff --git a/classes/utils/class.ilFormATestAccordionGUI.php b/classes/utils/class.ilFormATestAccordionGUI.php index 90c1650..2ca56a7 100644 --- a/classes/utils/class.ilFormATestAccordionGUI.php +++ b/classes/utils/class.ilFormATestAccordionGUI.php @@ -236,14 +236,14 @@ class ilFormATestAccordionGUI */ static function addJavaScript() { - global $tpl; + global $DIC; include_once("./Services/YUI/classes/class.ilYuiUtil.php"); ilYuiUtil::initEvent(); ilYuiUtil::initDom(); ilYuiUtil::initAnimation(); ilYuiUtil::initConnection(); - $tpl->addJavaScript("./Customizing/global/plugins/Services/Repository/RepositoryObject/FormATest/templates/default/accordion.js", true, 3); + $DIC->ui()->mainTemplate()->addJavaScript("./Customizing/global/plugins/Services/Repository/RepositoryObject/FormATest/templates/default/accordion.js", true, 3); } /** @@ -251,9 +251,9 @@ class ilFormATestAccordionGUI */ static function addCss() { - global $tpl; + global $DIC; - $tpl->addCss("./Services/Accordion/css/accordion.css"); + $DIC->ui()->mainTemplate()->addCss("./Services/Accordion/css/accordion.css"); } /** @@ -280,7 +280,8 @@ class ilFormATestAccordionGUI function getHTML() { - global $ilUser; + global $DIC; + $ilUser = $DIC->user(); self::$accordion_cnt++; diff --git a/classes/utils/class.ilFormATestDominantScoringReworker.php b/classes/utils/class.ilFormATestDominantScoringReworker.php index a710f08..19bfe1d 100644 --- a/classes/utils/class.ilFormATestDominantScoringReworker.php +++ b/classes/utils/class.ilFormATestDominantScoringReworker.php @@ -74,8 +74,8 @@ class ilFormATestDominantScoringReworker */ protected function updateTstTestResult($points) { - /** @var ilDB $ilDB */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $ilDB->update( "tst_test_result", diff --git a/classes/utils/class.ilFormATestInfoScreenGUI.php b/classes/utils/class.ilFormATestInfoScreenGUI.php index c76a249..98ce17c 100644 --- a/classes/utils/class.ilFormATestInfoScreenGUI.php +++ b/classes/utils/class.ilFormATestInfoScreenGUI.php @@ -32,7 +32,11 @@ class ilFormATestInfoScreenGUI extends ilInfoScreenGUI { */ function getHTML() { - global $lng, $ilSetting, $tree, $ilAccess, $ilCtrl, $ilUser; + global $DIC; + $lng = $DIC->language(); + $ilSetting = $DIC->settings(); + $ilCtrl = $DIC->ctrl(); + $ilUser = $DIC->user(); $tpl= new ilTemplate("tpl.infoscreen.html", true, true, "Customizing/global/plugins/Services/Repository/RepositoryObject/FormATest"); diff --git a/classes/utils/class.ilFormATestSkillLevelHelper.php b/classes/utils/class.ilFormATestSkillLevelHelper.php index b9cd266..9418c12 100644 --- a/classes/utils/class.ilFormATestSkillLevelHelper.php +++ b/classes/utils/class.ilFormATestSkillLevelHelper.php @@ -51,12 +51,12 @@ class ilFormATestSkillLevelHelper public function __construct() { - global $ilDB, $lng, $ilPluginAdmin, $ilSetting; + global $DIC; - $this->db = $ilDB; - $this->lng = $lng; - $this->pluginAdmin = $ilPluginAdmin; - $this->ilSetting = $ilSetting; + $this->db = $DIC->database(); + $this->lng = $DIC->language(); + $this->pluginAdmin = $DIC['ilPluginAdmin']; + $this->ilSetting = $DIC->settings(); } /** diff --git a/classes/utils/class.ilObjTestGateway.php b/classes/utils/class.ilObjTestGateway.php index 004bb7c..ca8b143 100644 --- a/classes/utils/class.ilObjTestGateway.php +++ b/classes/utils/class.ilObjTestGateway.php @@ -17,8 +17,8 @@ class ilObjTestGateway { */ public function getQuestionCountAndPointsForPassOfParticipant($active_id, $pass) { - /** @var ilDB $ilDB */ - global $ilDB; + global $DIC; + $ilDB = $DIC->database(); $data = array("count" => 0, "points" => 0); $points = $this->getMaxPointsPerSet($active_id); @@ -48,9 +48,9 @@ class ilObjTestGateway { public function getWorkingTimeOfParticipantForPass($active_id, $pass) { - /** @var ilDB $ilDB */ - global $ilDB; - + global $DIC; + $ilDB = $DIC->database(); + $result = $ilDB->queryF( "SELECT start_date FROM rep_robj_xtsf_session WHERE active_id = %s AND current_pass = %s", array("integer", "integer"), @@ -66,9 +66,9 @@ class ilObjTestGateway { public function getMaxPointsPerSet($active_id) { - /** @var ilDB $ilDB */ - global $ilDB; - + global $DIC; + $ilDB = $DIC->database(); + $points = array(); $result = $ilDB->queryF( diff --git a/plugin.php b/plugin.php index b62e5b6..f831bff 100644 --- a/plugin.php +++ b/plugin.php @@ -3,12 +3,12 @@ $id = 'xtsf'; // code version; must be changed for all code changes -$version = '4.0.0'; +$version = '5.0.0'; // ilias min and max version; must always reflect the versions that should // run with the plugin -$ilias_min_version = '5.2.0'; -$ilias_max_version = '5.2.999'; +$ilias_min_version = '5.3.0'; +$ilias_max_version = '5.3.999'; // optional, but useful: Add one or more responsible persons and a contact email $responsible = 'Thomas Joussen / Michael Jansen'; -- GitLab From 9bc2e9a8bef0433cf730174721ade5359511c6ad Mon Sep 17 00:00:00 2001 From: nmatuschek Date: Thu, 22 Mar 2018 09:39:58 +0100 Subject: [PATCH 02/10] Fixed logging --- classes/class.ilObjFormATest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/class.ilObjFormATest.php b/classes/class.ilObjFormATest.php index de46481..544ad27 100644 --- a/classes/class.ilObjFormATest.php +++ b/classes/class.ilObjFormATest.php @@ -224,7 +224,7 @@ class ilObjFormATest extends ilObjectPlugin implements ilLPStatusPluginInterface global $DIC; $this->db = $DIC->database(); - $this->log = $DIC->logger(); + $this->log = $DIC->logger()->root(); $this->user = $DIC->user(); $lng = $DIC->language(); $this->score_reporting = self::SCORE_REPORTING_ALWAYS; -- GitLab From f790d4f1cb4eedfd84c9effeccfcd924bc7b39ec Mon Sep 17 00:00:00 2001 From: mjansen Date: Tue, 8 May 2018 17:44:24 +0200 Subject: [PATCH 03/10] Fixed #23032 --- classes/controllers/class.ilFormATestResultOuputGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/controllers/class.ilFormATestResultOuputGUI.php b/classes/controllers/class.ilFormATestResultOuputGUI.php index 7a99769..5aa2913 100644 --- a/classes/controllers/class.ilFormATestResultOuputGUI.php +++ b/classes/controllers/class.ilFormATestResultOuputGUI.php @@ -311,7 +311,7 @@ class ilFormATestResultOuputGUI extends ilXTSFControllerGUI if($feedback !== NULL && strlen(trim($feedback)) > 0) { $this->template->setCurrentBlock('node_feedback'); - $this->template->setVariable('NODE_FEEDBACK', ilUtil::insertLatexImages($feedback)); + $this->template->setVariable('NODE_FEEDBACK', ilUtil::prepareTextareaOutput($feedback, true)); $this->template->parseCurrentBlock(); } } -- GitLab From ed452e42318f428077477b233990e4dd0ed3f704 Mon Sep 17 00:00:00 2001 From: mjansen Date: Tue, 8 May 2018 17:49:50 +0200 Subject: [PATCH 04/10] Incremented plugin version number --- plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.php b/plugin.php index f831bff..d9e69dd 100644 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ $id = 'xtsf'; // code version; must be changed for all code changes -$version = '5.0.0'; +$version = '5.0.1'; // ilias min and max version; must always reflect the versions that should // run with the plugin -- GitLab From ca125056521e76def850062c1e78fbdd6ae5cb52 Mon Sep 17 00:00:00 2001 From: Niels Theen Date: Tue, 12 Jun 2018 10:23:18 +0200 Subject: [PATCH 05/10] Use incremental steps from the test instead of question pool --- classes/controllers/abstract.ilXTSFControllerGUI.php | 4 +++- classes/controllers/class.ilFormATestOutputGUI.php | 9 +++++++-- .../controllers/class.ilFormATestPlayerControllerGUI.php | 7 ++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/classes/controllers/abstract.ilXTSFControllerGUI.php b/classes/controllers/abstract.ilXTSFControllerGUI.php index c4f5d2e..861ff84 100644 --- a/classes/controllers/abstract.ilXTSFControllerGUI.php +++ b/classes/controllers/abstract.ilXTSFControllerGUI.php @@ -260,9 +260,11 @@ abstract class ilXTSFControllerGUI { * * @return string */ - protected function generateJumpToNodeLink($finish_set, $node, $params = array()) + protected function generateJumpToNodeLink($finish_set, $node, $params = array(), $step = 0) { $this->ctrl->setParameter($this->controller, "node_id", $node["id"]); + $this->ctrl->setParameter($this->controller, "node_step", $step); + if ($finish_set) { $this->ctrl->setParameter($this->controller, "finished", 1); diff --git a/classes/controllers/class.ilFormATestOutputGUI.php b/classes/controllers/class.ilFormATestOutputGUI.php index 353aac7..359f0da 100644 --- a/classes/controllers/class.ilFormATestOutputGUI.php +++ b/classes/controllers/class.ilFormATestOutputGUI.php @@ -402,7 +402,13 @@ class ilFormATestOutputGUI extends ilXTSFControllerGUI else { $left_template->setCurrentBlock("linked_line"); - $left_template->setVariable("LINK", $this->generateJumpToNodeLink($finish_set, $node, array("xtsf_token" => $this->session->getToken()))); + $left_template->setVariable("LINK", $this->generateJumpToNodeLink( + $finish_set, + $node, + array("xtsf_token" => $this->session->getToken()), + $step + )); + //$template->setVariable("QUESTION_INDEX", $node["question_index"]); $left_template->setVariable("QUESTION_TITLE", $title); $left_template->parseCurrentBlock(); @@ -484,4 +490,3 @@ class ilFormATestOutputGUI extends ilXTSFControllerGUI return $show_question_inline_score; } } - \ No newline at end of file diff --git a/classes/controllers/class.ilFormATestPlayerControllerGUI.php b/classes/controllers/class.ilFormATestPlayerControllerGUI.php index dc14bb9..3daf01d 100644 --- a/classes/controllers/class.ilFormATestPlayerControllerGUI.php +++ b/classes/controllers/class.ilFormATestPlayerControllerGUI.php @@ -416,14 +416,19 @@ class ilFormATestPlayerControllerGUI extends ilXTSFControllerGUI } else { + $inTestStep = 0; + if (isset($_GET["node_step"])) { + $inTestStep = $_GET["node_step"]; + } $steps = $this->session->getStepsToDelete($node); $items = array(); foreach($steps as $step) { + $inTestStep++; $items[] = array( "name" => "n_id[]", "id" => $step["id"], - "text" => $this->plugin->txt("header_step"). ": ". $step["step"] + "text" => $this->plugin->txt("header_step"). ": ". $inTestStep ); } $cancel = "ilFormATestPlayerControllerGUI.back"; -- GitLab From 54d0bf150169125877bb686ecb5363d538ed72dd Mon Sep 17 00:00:00 2001 From: Niels Theen Date: Tue, 12 Jun 2018 10:51:28 +0200 Subject: [PATCH 06/10] Default values if GET parameter is not set --- .../controllers/class.ilFormATestPlayerControllerGUI.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/controllers/class.ilFormATestPlayerControllerGUI.php b/classes/controllers/class.ilFormATestPlayerControllerGUI.php index 3daf01d..0e91895 100644 --- a/classes/controllers/class.ilFormATestPlayerControllerGUI.php +++ b/classes/controllers/class.ilFormATestPlayerControllerGUI.php @@ -417,13 +417,18 @@ class ilFormATestPlayerControllerGUI extends ilXTSFControllerGUI else { $inTestStep = 0; - if (isset($_GET["node_step"])) { + if (true === isset($_GET["node_step"])) { $inTestStep = $_GET["node_step"]; } + $steps = $this->session->getStepsToDelete($node); $items = array(); foreach($steps as $step) { + if (false === isset($_GET["node_step"])) { + $inTestStep = $step["step"]; + } + $inTestStep++; $items[] = array( "name" => "n_id[]", -- GitLab From 3184b2e9a5d3b39ac8225f919b8fade3dcd32a63 Mon Sep 17 00:00:00 2001 From: Niels Theen Date: Thu, 28 Jun 2018 11:25:13 +0200 Subject: [PATCH 07/10] Remove unneeded default value in loop --- .../controllers/class.ilFormATestPlayerControllerGUI.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/controllers/class.ilFormATestPlayerControllerGUI.php b/classes/controllers/class.ilFormATestPlayerControllerGUI.php index 0e91895..ebff34a 100644 --- a/classes/controllers/class.ilFormATestPlayerControllerGUI.php +++ b/classes/controllers/class.ilFormATestPlayerControllerGUI.php @@ -419,16 +419,16 @@ class ilFormATestPlayerControllerGUI extends ilXTSFControllerGUI $inTestStep = 0; if (true === isset($_GET["node_step"])) { $inTestStep = $_GET["node_step"]; + $int = (int) $inTestStep; + if ((string) $int !== (string) $inTestStep) { + throw new ilException('"node_step" MUST be an integer value', 403); + } } $steps = $this->session->getStepsToDelete($node); $items = array(); foreach($steps as $step) { - if (false === isset($_GET["node_step"])) { - $inTestStep = $step["step"]; - } - $inTestStep++; $items[] = array( "name" => "n_id[]", -- GitLab From ae03bde0fb647f08e1266a5529928da54b4c3e23 Mon Sep 17 00:00:00 2001 From: Niels Theen Date: Thu, 28 Jun 2018 11:57:57 +0200 Subject: [PATCH 08/10] Incremental steps in history --- classes/controllers/class.ilFormATestResultOuputGUI.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/controllers/class.ilFormATestResultOuputGUI.php b/classes/controllers/class.ilFormATestResultOuputGUI.php index 5aa2913..7404904 100644 --- a/classes/controllers/class.ilFormATestResultOuputGUI.php +++ b/classes/controllers/class.ilFormATestResultOuputGUI.php @@ -154,8 +154,8 @@ class ilFormATestResultOuputGUI extends ilXTSFControllerGUI $this->template->setCurrentBlock('path_overview_question'); $this->template->parseCurrentBlock(); } - // - + + $step = 1; foreach($data as $item) { if($current_node_id == null || $current_node_id != $item["id"]) @@ -177,7 +177,8 @@ class ilFormATestResultOuputGUI extends ilXTSFControllerGUI $question_title = "(Q ". $item["question_index"]. ") ". $item["question_title"]; if($this->modus == self::MODUS_PARTICIPANTS) { - $question_title = $set["title"] . " - " . $this->plugin->txt("header_step"). ": ". $item["step"]; + $question_title = $set["title"] . " - " . $this->plugin->txt("header_step"). ": ". $step; + $step++; } $gui = assQuestion::instantiateQuestionGUI($item["question_fi"]); @@ -317,4 +318,3 @@ class ilFormATestResultOuputGUI extends ilXTSFControllerGUI } } } - \ No newline at end of file -- GitLab From ac87dc653d761de9588a3b83edcddcd226ceb331 Mon Sep 17 00:00:00 2001 From: Niels Theen Date: Thu, 28 Jun 2018 12:04:22 +0200 Subject: [PATCH 09/10] Correct steps for backbutton --- .../class.ilFormATestPlayerControllerGUI.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/controllers/class.ilFormATestPlayerControllerGUI.php b/classes/controllers/class.ilFormATestPlayerControllerGUI.php index ebff34a..ebbab8e 100644 --- a/classes/controllers/class.ilFormATestPlayerControllerGUI.php +++ b/classes/controllers/class.ilFormATestPlayerControllerGUI.php @@ -198,6 +198,17 @@ class ilFormATestPlayerControllerGUI extends ilXTSFControllerGUI } else { + $inTestStep = 1; + if (true === isset($_GET["node_step"])) { + $inTestStep = $_GET["node_step"]; + $int = (int) $inTestStep; + if ((string) $int !== (string) $inTestStep) { + throw new ilException('"node_step" MUST be an integer value', 403); + } + + $inTestStep = $inTestStep + 1; + } + $this->renderConfirmationScreen( "ilFormATestPlayerControllerGUI.resumeTest", "ilFormATestPlayerControllerGUI.prev", @@ -205,7 +216,7 @@ class ilFormATestPlayerControllerGUI extends ilXTSFControllerGUI array( "name" => "n_id[]", "id" => $this->session->getNodeId(), - "text" => $this->plugin->txt("header_step"). ": ". $this->session->getStep() + "text" => $this->plugin->txt("header_step"). ": ". $inTestStep ) ), $this->plugin->txt("confirm_walk_back"), -- GitLab From 7459caf89a0683497ba868bac121802a87f7f05e Mon Sep 17 00:00:00 2001 From: Niels Theen Date: Thu, 28 Jun 2018 15:57:02 +0200 Subject: [PATCH 10/10] Update plugin version(release-5) --- plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.php b/plugin.php index d9e69dd..4b60473 100644 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ $id = 'xtsf'; // code version; must be changed for all code changes -$version = '5.0.1'; +$version = '5.0.2'; // ilias min and max version; must always reflect the versions that should // run with the plugin @@ -15,4 +15,4 @@ $responsible = 'Thomas Joussen / Michael Jansen'; $responsible_mail = 'tjoussen@databay.de / mjansen@databay.de'; $learning_progress = true; -$supports_export = true; \ No newline at end of file +$supports_export = true; -- GitLab