Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
smeyer-ilias committed Aug 21, 2015
1 parent 7d3f424 commit 5810d11
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 9 deletions.
8 changes: 8 additions & 0 deletions Modules/Course/classes/Objectives/class.ilLOSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 36 additions & 3 deletions Modules/Course/classes/class.ilCourseObjectivesGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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");
Expand Down Expand Up @@ -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;
}
Expand Down
24 changes: 18 additions & 6 deletions Modules/Course/classes/class.ilCourseObjectivesTableGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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(
Expand Down

0 comments on commit 5810d11

Please sign in to comment.