From 5810d11fd28bc79a4a8980b1e694609b7bdcff96 Mon Sep 17 00:00:00 2001 From: smeyer-ilias Date: Fri, 21 Aug 2015 09:42:38 +0200 Subject: [PATCH] lok3 #9 --- .../classes/Objectives/class.ilLOSettings.php | 8 ++++ .../classes/class.ilCourseObjectivesGUI.php | 39 +++++++++++++++++-- .../class.ilCourseObjectivesTableGUI.php | 24 +++++++++--- 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/Modules/Course/classes/Objectives/class.ilLOSettings.php b/Modules/Course/classes/Objectives/class.ilLOSettings.php index 3825421a7e15..cabc3b279e66 100644 --- a/Modules/Course/classes/Objectives/class.ilLOSettings.php +++ b/Modules/Course/classes/Objectives/class.ilLOSettings.php @@ -162,6 +162,14 @@ public function hasSeparateInitialTests() return $this->getInitialTestType() == self::TYPE_INITIAL_PLACEMENT_SELECTED || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED; } + /** + * Check if separate qualified tests are configured + */ + public function hasSeparateQualifiedTests() + { + return $this->getQualifyingTestType() == self::TYPE_QUALIFYING_SELECTED; + } + /** * Check if test ref_id is used in an objective course * @param int ref_id diff --git a/Modules/Course/classes/class.ilCourseObjectivesGUI.php b/Modules/Course/classes/class.ilCourseObjectivesGUI.php index 5f983780063d..eb4642858f7f 100644 --- a/Modules/Course/classes/class.ilCourseObjectivesGUI.php +++ b/Modules/Course/classes/class.ilCourseObjectivesGUI.php @@ -1212,6 +1212,31 @@ protected function updateFinalTestAssignment() $this->finalTestLimits(); } + /** + * Show test assignment form + * @param ilPropertyFormGUI $form + */ + protected function finalSeparatedTestAssignment(ilPropertyFormGUI $form = null) + { + global $ilAccess, $ilErr; + + if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId())) + { + $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING); + } + if(!$_GET['objective_id']) + { + ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true); + $this->ctrl->returnToParent($this); + } + $this->ctrl->saveParameter($this,'objective_id'); + $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']); + + $this->initWizard(6); + $form = $this->initFormTestAssignment(); + $GLOBALS['tpl']->setContent($form->getHtml()); + } + /** * self assessment limits * @@ -1230,7 +1255,7 @@ protected function finalTestLimits() if(!$_GET['objective_id']) { ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true); - $this->ctrl->redirect($this,'listObjectives'); + $this->ctrl->returnToParent($this); } $this->setSubTabs("final_test_limits"); @@ -1512,11 +1537,19 @@ protected function initWizard($a_step_number) // checklist gui end // begin-patch lok - if($step == 3 and !$this->getSettings()->worksWithInitialTest()) + if($step == 3 and (!$this->getSettings()->worksWithInitialTest() or $this->getSettings()->hasSeparateInitialTests())) + { + continue; + } + if($step == 4 and (!$this->getSettings()->worksWithInitialTest() or $this->getSettings()->hasSeparateInitialTests())) + { + continue; + } + if($step == 5 and $this->getSettings()->hasSeparateQualifiedTests()) { continue; } - if($step == 4 and !$this->getSettings()->worksWithInitialTest()) + if($step == 6 and $this->getSettings()->hasSeparateQualifiedTests()) { continue; } diff --git a/Modules/Course/classes/class.ilCourseObjectivesTableGUI.php b/Modules/Course/classes/class.ilCourseObjectivesTableGUI.php index 7b1df6489e4b..687a391c8ed5 100644 --- a/Modules/Course/classes/class.ilCourseObjectivesTableGUI.php +++ b/Modules/Course/classes/class.ilCourseObjectivesTableGUI.php @@ -313,7 +313,7 @@ protected function fillRow($a_set) $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'materialAssignment') ); // itest - if($this->getSettings()->worksWithInitialTest()) + if($this->getSettings()->worksWithInitialTest() && !$this->getSettings()->hasSeparateInitialTests()) { $alist->addItem( $this->lng->txt('crs_objective_action_itest'), @@ -322,11 +322,23 @@ protected function fillRow($a_set) ); } // qtest - $alist->addItem( - $this->lng->txt('crs_objective_action_qtest'), - '', - $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalTestAssignment') - ); + if($this->getSettings()->hasSeparateQualifiedTests()) + { + #$alist->addItem( + # $this->lng->txt('crs_objective_action_qtest_sep'), + # '', + # $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalSeparatedTestAssignment') + #); + } + else + { + $alist->addItem( + $this->lng->txt('crs_objective_action_qtest'), + '', + $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalTestAssignment') + ); + + } $this->ctrl->setParameterByClass('illopagegui','objective_id',$a_set['id']); $alist->addItem(