ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCourseObjectivesGUI Class Reference

class ilobjcourseobjectivesgui More...

+ Inheritance diagram for ilCourseObjectivesGUI:
+ Collaboration diagram for ilCourseObjectivesGUI:

Public Member Functions

 ilCourseObjectivesGUI ($a_course_id)
executeCommand ()
 execute command
 getSettings ()
 Get settings.
 askDeleteObjective ()
 deleteObjectives ()
 __initCourseObject ()
 __initObjectivesObject ($a_id=0)
 __initLMObject ($a_objective_id=0)
 __initQuestionObject ($a_objective_id=0)
 setSubTabs ($a_active="")
 set sub tabs
 create ()
 create objective

Data Fields

const MODE_UNDEFINED = 0
const MODE_CREATE = 1
const MODE_UPDATE = 2
 $ctrl
 $ilias
 $ilErr
 $lng
 $tpl
 $course_obj
 $course_id

Protected Member Functions

 listObjectives ()
 list objectives
 saveSorting ()
 save position
 questionOverview ()
 question overiew
 saveQuestionOverview ()
 update question overview
 edit ()
 edit objective
 save ()
 save
 materialAssignment ()
 material assignment
 updateMaterialAssignment ()
 update material assignment
 selfAssessmentAssignment ()
 self assessment assignemnt
 updateSelfAssessmentAssignment ()
 update self assessment assignment
 selfAssessmentLimits ()
 self assessment limits
 updateSelfAssessmentLimits ()
 update self assessment limits
 finalTestAssignment ()
 final test assignment
 isRandomTestType ($a_tst_type=0)
 showRandomTestAssignment (ilPropertyFormGUI $form=null)
 initFormRandom ()
 show random test
 getRandomTestQplOptions ()
 saveRandom ()
 Save random test settings.
 updateFinalTestAssignment ()
 update self assessment assignment
 finalTestLimits ()
 self assessment limits
 updateFinalTestLimits ()
 update self assessment limits
 initFormLimits ($a_mode)
 init limit form
 initFormTitle ($a_mode, $a_step_number)
 init form title
 initWizard ($a_step_number)
 init wizard

Protected Attributes

 $settings
 $test_type = 0

Detailed Description

class ilobjcourseobjectivesgui

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilCourseObjectivesGUI.php 59480 2015-06-15 11:21:14Z gitmgr

Definition at line 36 of file class.ilCourseObjectivesGUI.php.

Member Function Documentation

ilCourseObjectivesGUI::__initCourseObject ( )

Definition at line 379 of file class.ilCourseObjectivesGUI.php.

References exit, and ilObjectFactory\getInstanceByRefId().

Referenced by ilCourseObjectivesGUI().

{
if(!$this->course_obj =& ilObjectFactory::getInstanceByRefId($this->course_id,false))
{
$this->ilErr->raiseError("ilCourseObjectivesGUI: cannot create course object",$this->ilErr->MESSAGE);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::__initLMObject (   $a_objective_id = 0)

Definition at line 394 of file class.ilCourseObjectivesGUI.php.

Referenced by updateMaterialAssignment().

{
include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
$this->objectives_lm_obj =& new ilCourseObjectiveMaterials($a_objective_id);
return true;
}

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::__initObjectivesObject (   $a_id = 0)

Definition at line 389 of file class.ilCourseObjectivesGUI.php.

Referenced by askDeleteObjective(), and deleteObjectives().

{
return $this->objectives_obj = new ilCourseObjective($this->course_obj,$a_id);
}

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::__initQuestionObject (   $a_objective_id = 0)
Parameters
type$a_objective_id
Returns
ilCourseObjectiveQuestion

Definition at line 408 of file class.ilCourseObjectivesGUI.php.

Referenced by create(), edit(), finalTestAssignment(), finalTestLimits(), materialAssignment(), saveRandom(), selfAssessmentAssignment(), selfAssessmentLimits(), showRandomTestAssignment(), updateFinalTestAssignment(), updateFinalTestLimits(), updateSelfAssessmentAssignment(), and updateSelfAssessmentLimits().

{
include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
$this->objectives_qst_obj =& new ilCourseObjectiveQuestion($a_objective_id);
return $this->objectives_qst_obj;
}

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::askDeleteObjective ( )

Definition at line 171 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_POST, $_SESSION, $tpl, __initObjectivesObject(), ilUtil\getImagePath(), listObjectives(), ilUtil\sendFailure(), ilUtil\sendQuestion(), and ilUtil\switchColor().

{
global $rbacsystem;
// MINIMUM ACCESS LEVEL = 'write'
if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
}
if(!count($_POST['objective']))
{
ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
$this->listObjectives();
return true;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html",'Modules/Course');
ilUtil::sendQuestion($this->lng->txt('crs_delete_objectve_sure'));
$tpl =& new ilTemplate("tpl.table.html", true, true);
$tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_delete_row.html",'Modules/Course');
$counter = 0;
foreach($_POST['objective'] as $objective_id)
{
$objective_obj = $this->__initObjectivesObject($objective_id);
$tpl->setCurrentBlock("tbl_content");
$tpl->setVariable("ROWCOL",ilUtil::switchColor(++$counter,"tblrow2","tblrow1"));
$tpl->setVariable("TITLE",$objective_obj->getTitle());
$tpl->setVariable("DESCRIPTION",$objective_obj->getDescription());
$tpl->parseCurrentBlock();
}
$tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
// Show action row
$tpl->setCurrentBlock("tbl_action_btn");
$tpl->setVariable("BTN_NAME",'deleteObjectives');
$tpl->setVariable("BTN_VALUE",$this->lng->txt('delete'));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_btn");
$tpl->setVariable("BTN_NAME",'listObjectives');
$tpl->setVariable("BTN_VALUE",$this->lng->txt('cancel'));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setVariable("COLUMN_COUNTS",1);
$tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.svg'));
$tpl->parseCurrentBlock();
// create table
$tbl = new ilTableGUI();
$tbl->setStyle('table','std');
// title & header columns
$tbl->setTitle($this->lng->txt("crs_objectives"),"",$this->lng->txt("crs_objectives"));
$tbl->setHeaderNames(array($this->lng->txt("title")));
$tbl->setHeaderVars(array("title"),
array("ref_id" => $this->course_obj->getRefId(),
"cmdClass" => "ilcourseobjectivesgui",
"cmdNode" => $_GET["cmdNode"]));
$tbl->setColumnWidth(array("50%"));
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount(count($_POST['objective']));
// footer
$tbl->disable("footer");
$tbl->disable('sort');
// render table
$tbl->setTemplate($tpl);
$tbl->render();
$this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get());
// Save marked objectives
$_SESSION['crs_delete_objectives'] = $_POST['objective'];
return true;
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::create ( )

create objective

public

Parameters
@return

Definition at line 465 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_SESSION, $GLOBALS, $tpl, __initQuestionObject(), initFormTitle(), initWizard(), MODE_CREATE, and setSubTabs().

{
global $tpl;
$this->setSubTabs("create_obj");
$_SESSION['objective_mode'] = self::MODE_CREATE;
$this->ctrl->saveParameter($this,'objective_id');
if(!is_object($this->objective))
{
$this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
}
$this->__initQuestionObject((int) $_GET['objective_id']);
$this->initWizard(1);
$this->initFormTitle('create',1);
$GLOBALS['tpl']->setContent($this->form->getHtml());
#$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
#$tpl->setContent($w_tpl->get());
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::deleteObjectives ( )

Definition at line 261 of file class.ilCourseObjectivesGUI.php.

References $_SESSION, __initObjectivesObject(), listObjectives(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $rbacsystem;
// MINIMUM ACCESS LEVEL = 'write'
if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
}
if(!count($_SESSION['crs_delete_objectives']))
{
ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
$this->listObjectives();
return true;
}
foreach($_SESSION['crs_delete_objectives'] as $objective_id)
{
$objective_obj =& $this->__initObjectivesObject($objective_id);
$objective_obj->delete();
}
ilUtil::sendSuccess($this->lng->txt('crs_objectives_deleted'));
$this->listObjectives();
return true;
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::edit ( )
protected

edit objective

protected

Returns

Definition at line 494 of file class.ilCourseObjectivesGUI.php.

References $_REQUEST, $_SESSION, $GLOBALS, $tpl, __initQuestionObject(), initFormTitle(), initWizard(), MODE_UPDATE, ilUtil\sendFailure(), and setSubTabs().

Referenced by save().

{
global $tpl;
$_SESSION['objective_mode'] = self::MODE_UPDATE;
$this->setSubTabs("edit_obj");
$this->ctrl->setParameter($this,'objective_id',(int) $_REQUEST['objective_id']);
if(!$_REQUEST['objective_id'])
{
ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
$this->ctrl->redirect($this,'listObjectives');
}
if(!is_object($this->objective))
{
$this->objective = new ilCourseObjective($this->course_obj,(int) $_REQUEST['objective_id']);
}
$this->__initQuestionObject((int) $_REQUEST['objective_id']);
$this->initWizard(1);
$this->initFormTitle('create',1);
$GLOBALS['tpl']->setContent($this->form->getHtml());
#$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
#$tpl->setContent($w_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilCourseObjectivesGUI::executeCommand ( )

execute command

Definition at line 85 of file class.ilCourseObjectivesGUI.php.

References $cmd.

{
global $ilTabs;
$ilTabs->setTabActive('crs_objectives');
$cmd = $this->ctrl->getCmd();
if (!$cmd = $this->ctrl->getCmd())
{
$cmd = "list";
}
$this->$cmd();
}
ilCourseObjectivesGUI::finalTestAssignment ( )
protected

final test assignment

protected

Parameters
@return

Definition at line 905 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_REQUEST, $GLOBALS, $ilErr, $tpl, __initQuestionObject(), ilCourseObjectiveQuestion\_getAssignableTests(), initWizard(), isRandomTestType(), ilUtil\sendFailure(), setSubTabs(), showRandomTestAssignment(), ilCourseObjectiveQuestion\TYPE_FINAL_TEST, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by updateMaterialAssignment(), updateSelfAssessmentAssignment(), and updateSelfAssessmentLimits().

{
global $ilAccess,$ilErr,$tpl;
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->redirect($this,'listObjectives');
}
$this->setSubTabs("final_test_assign");
$this->ctrl->saveParameter($this,'objective_id');
$this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
// begin-patch lok
$this->ctrl->setParameter($this,'tt',ilLOSettings::TYPE_TEST_QUALIFIED);
$this->test_type = $_REQUEST['tt'] = ilLOSettings::TYPE_TEST_QUALIFIED;
{
return $this->showRandomTestAssignment();
}
// end-patch lok
include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
$this->course_obj,
(int) $_GET['objective_id'],
$table->setTitle($this->lng->txt('crs_objective_wiz_final'),
'',$this->lng->txt('crs_objective'));
$table->parse(ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()));
$this->__initQuestionObject((int) $_GET['objective_id']);
$this->initWizard(5);
$GLOBALS['tpl']->setContent($table->getHTML());
#$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
#$tpl->setContent($w_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::finalTestLimits ( )
protected

self assessment limits

protected

Parameters
@return

Definition at line 1222 of file class.ilCourseObjectivesGUI.php.

References $_GET, $GLOBALS, $ilErr, $tpl, __initQuestionObject(), initFormLimits(), initWizard(), ilUtil\sendFailure(), and setSubTabs().

Referenced by updateFinalTestAssignment(), and updateFinalTestLimits().

{
global $ilAccess,$ilErr,$tpl;
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->redirect($this,'listObjectives');
}
$this->setSubTabs("final_test_limits");
$this->ctrl->saveParameter($this,'objective_id');
$this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
$this->__initQuestionObject((int) $_GET['objective_id']);
$this->initWizard(6);
$this->initFormLimits('final');
$GLOBALS['tpl']->setContent($this->form->getHtml());
#$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
#$tpl->setContent($w_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::getRandomTestQplOptions ( )
protected

Definition at line 1053 of file class.ilCourseObjectivesGUI.php.

References $GLOBALS, $options, ilObjectFactory\getInstanceByRefId(), and getSettings().

Referenced by initFormRandom().

{
include_once './Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
include_once './Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
$tst_ref_id = $this->getSettings()->getTestByType($this->test_type);
if($tst_ref_id)
{
$tst = ilObjectFactory::getInstanceByRefId($tst_ref_id,false);
}
if(!$tst instanceof ilObjTest)
{
return array();
}
$GLOBALS['ilDB'],
$tst,
$GLOBALS['ilDB'],
$tst
)
);
$list->loadDefinitions();
include_once './Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
$translater = new ilTestTaxonomyFilterLabelTranslater($GLOBALS['ilDB']);
$translater->loadLabels($list);
$options[0] = $this->lng->txt('select_one');
foreach ($list as $definition)
{
$title = $definition->getPoolTitle();
$tax_id = $definition->getMappedFilterTaxId();
if($tax_id)
{
$title .= (' -> '. $translater->getTaxonomyTreeLabel($tax_id));
}
$tax_node = $definition->getMappedFilterTaxNodeId();
if($tax_node)
{
$title .= (' -> ' .$translater->getTaxonomyNodeLabel($tax_node));
}
$options[$definition->getId()] = $title;
}
return $options;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::getSettings ( )

Get settings.

Returns
ilLOSettings

Definition at line 107 of file class.ilCourseObjectivesGUI.php.

References $settings.

Referenced by getRandomTestQplOptions(), initWizard(), isRandomTestType(), saveRandom(), and updateMaterialAssignment().

{
}

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::ilCourseObjectivesGUI (   $a_course_id)

Definition at line 57 of file class.ilCourseObjectivesGUI.php.

References $ilCtrl, $ilErr, $ilias, $lng, $tpl, __initCourseObject(), and ilLOSettings\getInstanceByObjId().

{
include_once './Modules/Course/classes/class.ilCourseObjective.php';
global $ilCtrl,$lng,$ilErr,$ilias,$tpl,$tree,$ilTabs;
$this->ctrl =& $ilCtrl;
$this->ctrl->saveParameter($this,array("ref_id"));
$this->ilErr =& $ilErr;
$this->lng =& $lng;
$this->lng->loadLanguageModule('crs');
$this->tpl =& $tpl;
$this->tree =& $tree;
$this->tabs_gui =& $ilTabs;
$this->course_id = $a_course_id;
// begin-patch lok
$this->settings = ilLOSettings::getInstanceByObjId($this->course_obj->getId());
// end-patch lok
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::initFormLimits (   $a_mode)
protected

init limit form

protected

Parameters
stringmode selfAssessment or final
Returns

Definition at line 1306 of file class.ilCourseObjectivesGUI.php.

References $GLOBALS, $test, $tests, $tpl, ilObject\_lookupDescription(), ilObject\_lookupTitle(), ilUtil\getTypeIconPath(), ilCustomInputGUI\setHtml(), and ilNumberInputGUI\setValue().

Referenced by finalTestLimits(), and selfAssessmentLimits().

{
if(!is_object($this->form))
{
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form = new ilPropertyFormGUI();
}
$this->form->setFormAction($this->ctrl->getFormAction($this));
$this->form->setTableWidth('100%');
//$this->form->setTitleIcon(ilUtil::getImagePath('icon_lobj.svg'),$this->lng->txt('crs_objective'));
switch($a_mode)
{
case 'selfAssessment':
$this->form->setTitle($this->lng->txt('crs_objective_wiz_self_limit'));
$this->form->addCommandButton('updateSelfAssessmentLimits',$this->lng->txt('crs_wiz_next'));
$this->form->addCommandButton('selfAssessmentAssignment',$this->lng->txt('crs_wiz_back'));
$tests = $this->objectives_qst_obj->getSelfAssessmentTests();
$max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
break;
case 'final':
$this->form->setTitle($this->lng->txt('crs_objective_wiz_final_limit'));
$this->form->addCommandButton('updateFinalTestLimits',$this->lng->txt('crs_wiz_next'));
$this->form->addCommandButton('finalTestAssignment',$this->lng->txt('crs_wiz_back'));
$tests = $this->objectives_qst_obj->getFinalTests();
$max_points = $this->objectives_qst_obj->getFinalTestPoints();
break;
}
$over = new ilCustomInputGUI($this->lng->txt('crs_objective_qst_summary'),'');
$tpl = new ilTemplate('tpl.crs_objective_qst_summary.html',true,true,'Modules/Course');
$limit = 0;
foreach($tests as $test)
{
$GLOBALS['ilLog']->write(__METHOD__.': '.print_r($test,TRUE));
$limit = $test['limit'];
foreach($this->objectives_qst_obj->getQuestionsOfTest($test['obj_id']) as $question)
{
$tpl->setCurrentBlock('qst');
$tpl->setVariable('QST_TITLE',$question['title']);
if(strlen($question['description']))
{
$tpl->setVariable('QST_DESCRIPTION',$question['description']);
}
$tpl->setVariable('QST_POINTS',$question['points'].' '.
$this->lng->txt('crs_objective_points'));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('tst');
$tpl->setVariable('TST_TITLE',ilObject::_lookupTitle($test['obj_id']));
if($desc = ilObject::_lookupDescription($test['obj_id']))
{
$tpl->setVariable('TST_DESC',$desc);
}
$tpl->setVariable('TST_TYPE_IMG',ilUtil::getTypeIconPath('tst',$test['obj_id'],'tiny'));
$tpl->setVariable('TST_ALT_IMG',$this->lng->txt('obj_tst'));
$tpl->parseCurrentBlock();
}
$tpl->setVariable('TXT_ALL_POINTS',$this->lng->txt('crs_objective_all_points'));
$tpl->setVariable('TXT_POINTS',$this->lng->txt('crs_objective_points'));
$tpl->setVariable('POINTS',$max_points);
$over->setHtml($tpl->get());
$this->form->addItem($over);
// points
$req = new ilNumberInputGUI($this->lng->txt('crs_loc_perc'),'limit');
$req->setValue($limit);
$req->setSize(3);
$req->setMinValue(1);
$req->setMaxValue(100);
$req->setRequired(true);
switch($a_mode)
{
case 'selfAssessment':
$req->setInfo($this->lng->txt('crs_obj_initial_req_info'));
break;
case 'final':
$req->setInfo($this->lng->txt('crs_obj_final_req_info'));
break;
}
$this->form->addItem($req);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::initFormRandom ( )
protected

show random test

Definition at line 997 of file class.ilCourseObjectivesGUI.php.

References $_REQUEST, $options, getRandomTestQplOptions(), ilSelectInputGUI\setOptions(), ilNumberInputGUI\setValue(), and ilLOSettings\TYPE_TEST_INITIAL.

Referenced by saveRandom(), and showRandomTestAssignment().

{
include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
$this->course_obj->getId(),
(int) $_REQUEST['objective_id'],
$this->test_type
);
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
if($this->test_type == ilLOSettings::TYPE_TEST_INITIAL)
{
$form->setTitle($this->lng->txt('crs_loc_form_random_limits_it'));
}
else
{
$form->setTitle($this->lng->txt('crs_loc_form_random_limits_qt'));
}
$form->addCommandButton('saveRandom', $this->lng->txt('save'));
$options = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_rand_assign_qpl'),'type');
$options->setValue(1);
$options->setRequired(true);
$ass_qpl = new ilRadioOption($this->lng->txt('crs_loc_rand_assign_qpl'),1);
$options->addOption($ass_qpl);
$qpl = new ilSelectInputGUI($this->lng->txt('crs_loc_rand_qpl'),'qpl');
$qpl->setValue($rnd->getQplSequence());
$ass_qpl->addSubItem($qpl);
#$num = new ilNumberInputGUI($this->lng->txt('crs_loc_num_qst'),'num_qst');
#$num->setSize(3);
#$num->setMinValue(1);
#$num->setRequired(true);
#$ass_qpl->addSubItem($num);
// points
$per = new ilNumberInputGUI($this->lng->txt('crs_loc_perc'),'per');
$per->setValue($rnd->getLimit());
$per->setSize(3);
$per->setMinValue(1);
$per->setMaxValue(100);
$per->setRequired(true);
$ass_qpl->addSubItem($per);
$form->addItem($options);
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::initFormTitle (   $a_mode,
  $a_step_number 
)
protected

init form title

protected

Returns

Definition at line 1410 of file class.ilCourseObjectivesGUI.php.

References ilTextInputGUI\setValue(), and ilTextAreaInputGUI\setValue().

Referenced by create(), edit(), and save().

{
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
if($this->form instanceof ilPropertyFormGUI)
{
return;
}
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
//$this->form->setTitleIcon(ilUtil::getImagePath('icon_lobj.svg'),$this->lng->txt('crs_objective'));
switch($a_mode)
{
case 'create':
$this->form->setTitle($this->lng->txt('crs_objective_wiz_title'));
$this->form->addCommandButton('save',$this->lng->txt('crs_wiz_next'));
// begin-patch lok
#$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel'));
// end-patch lok
break;
case 'update':
break;
}
$title = new ilTextInputGUI($this->lng->txt('title'),'title');
$title->setValue($this->objective->getTitle());
$title->setRequired(true);
$title->setSize(40);
$title->setMaxLength(70);
$this->form->addItem($title);
$desc = new ilTextAreaInputGUI($this->lng->txt('description'),'description');
$desc->setValue($this->objective->getDescription());
$desc->setCols(40);
$desc->setRows(5);
$this->form->addItem($desc);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::initWizard (   $a_step_number)
protected

init wizard

protected

Parameters
stringmode 'create' or 'edit'
Returns

Definition at line 1459 of file class.ilCourseObjectivesGUI.php.

References $_SESSION, $GLOBALS, $options, getSettings(), isRandomTestType(), ilChecklistGUI\STATUS_NO_STATUS, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by create(), edit(), finalTestAssignment(), finalTestLimits(), materialAssignment(), selfAssessmentAssignment(), selfAssessmentLimits(), and showRandomTestAssignment().

{
$options = array(
1 => $this->lng->txt('crs_objective_wiz_title'),
2 => $this->lng->txt('crs_objective_wiz_materials'),
3 => $this->lng->txt('crs_objective_wiz_self'),
4 => $this->lng->txt('crs_objective_wiz_self_limit'),
5 => $this->lng->txt('crs_objective_wiz_final'),
6 => $this->lng->txt('crs_objective_wiz_final_limit'));
$info = array(
1 => $this->lng->txt('crs_objective_wiz_title_info'),
2 => $this->lng->txt('crs_objective_wiz_materials_info'),
3 => $this->lng->txt('crs_objective_wiz_self_info'),
4 => $this->lng->txt('crs_objective_wiz_self_limit_info'),
5 => $this->lng->txt('crs_objective_wiz_final_info'),
6 => $this->lng->txt('crs_objective_wiz_final_limit_info'));
$links = array(
1 => $this->ctrl->getLinkTarget($this,'edit'),
2 => $this->ctrl->getLinkTarget($this,'materialAssignment'),
3 => $this->ctrl->getLinkTarget($this,'selfAssessmentAssignment'),
4 => $this->ctrl->getLinkTarget($this,'selfAssessmentLimits'),
5 => $this->ctrl->getLinkTarget($this,'finalTestAssignment'),
6 => $this->ctrl->getLinkTarget($this,'finalTestLimits'));
// checklist gui start
include_once("./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
$check_list = new ilChecklistGUI();
// checklist gui end
if($_SESSION['objective_mode'] == self::MODE_CREATE)
{
// checklist gui start
$check_list->setHeading($this->lng->txt('crs_add_objective'));
// checklist gui end
}
else
{
// checklist gui start
$check_list->setHeading($this->lng->txt('crs_update_objective'));
// checklist gui end
}
// end-patch lok
$num = 0;
foreach($options as $step => $title)
{
// checklist gui start
$item_link = "";
// checklist gui end
// begin-patch lok
if($step == 3 and !$this->getSettings()->worksWithInitialTest())
{
continue;
}
if($step == 4 and !$this->getSettings()->worksWithInitialTest())
{
continue;
}
{
continue;
}
{
continue;
}
$num++;
// end-patch lok
if($_SESSION['objective_mode'] == self::MODE_UPDATE)
{
$hide_link = false;
if($step == 4 and !count($this->objectives_qst_obj->getSelfAssessmentQuestions()))
{
$hide_link = true;
}
if($step == 6 and !count($this->objectives_qst_obj->getFinalTestQuestions()))
{
$hide_link = true;
}
// begin-patch lok
if($step == 3 and !$this->getSettings()->worksWithInitialTest())
{
$hide_link = true;
}
if($step == 4 and !$this->getSettings()->worksWithInitialTest())
{
$hide_link = true;
}
if(!$hide_link)
{
// checklist gui start
$item_link = $links[$step];
// checklist gui end
}
}
// checklist gui start
$check_list->addEntry($title, $item_link, ilChecklistGUI::STATUS_NO_STATUS, ($step == $a_step_number));
// checklist gui end
}
// checklist gui start
$GLOBALS["tpl"]->setRightContent($check_list->getHTML());
// checklist gui end
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::isRandomTestType (   $a_tst_type = 0)
protected

Definition at line 951 of file class.ilCourseObjectivesGUI.php.

References $test_type, ilObject\_lookupObjId(), ilObjTest\_lookupRandomTest(), and getSettings().

Referenced by finalTestAssignment(), initWizard(), and selfAssessmentAssignment().

{
if(!$a_tst_type)
{
$a_tst_type = $this->test_type;
}
$tst_ref_id = $this->getSettings()->getTestByType($a_tst_type);
if(!$tst_ref_id)
{
return false;
}
include_once './Modules/Test/classes/class.ilObjTest.php';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::listObjectives ( )
protected

list objectives

protected

Parameters
@return

Definition at line 121 of file class.ilCourseObjectivesGUI.php.

References $_SESSION, $ilErr, ilCourseObjective\_getObjectiveIds(), and MODE_UNDEFINED.

Referenced by askDeleteObjective(), deleteObjectives(), and saveSorting().

{
global $ilAccess,$ilErr,$ilObjDataCache,$ilToolbar;
$_SESSION['objective_mode'] = self::MODE_UNDEFINED;
if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
{
$this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
}
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_objectives.html','Modules/Course');
$ilToolbar->addButton($this->lng->txt('crs_add_objective'),
$this->ctrl->getLinkTarget($this, "'create"));
include_once('./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
$table = new ilCourseObjectivesTableGUI($this,$this->course_obj);
$table->setTitle($this->lng->txt('crs_objectives'),'',$this->lng->txt('crs_objectives'));
$table->parse(ilCourseObjective::_getObjectiveIds($this->course_obj->getId(),false));
$this->tpl->setVariable('OBJECTIVES_TABLE',$table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::materialAssignment ( )
protected

material assignment

protected

Returns

Definition at line 582 of file class.ilCourseObjectivesGUI.php.

References $_GET, $GLOBALS, $ilErr, $tpl, __initQuestionObject(), ilCourseObjectiveMaterials\_getAssignableMaterials(), initWizard(), ilUtil\sendFailure(), and setSubTabs().

{
global $ilAccess,$ilErr,$tpl;
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->redirect($this,'listObjectives');
}
$this->setSubTabs("materials");
$this->ctrl->saveParameter($this,'objective_id');
$this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
$table = new ilCourseObjectiveMaterialAssignmentTableGUI($this,$this->course_obj,(int) $_GET['objective_id']);
$table->setTitle($this->lng->txt('crs_objective_wiz_materials'),
'',$this->lng->txt('crs_objectives'));
include_once('Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
$table->parse(ilCourseObjectiveMaterials::_getAssignableMaterials($this->course_obj->getRefId()));
$this->__initQuestionObject((int) $_GET['objective_id']);
$this->initWizard(2);
#$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
$GLOBALS['tpl']->setContent($table->getHTML());
#$tpl->setContent($w_tpl->get());
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::questionOverview ( )
protected

question overiew

protected

Returns

Definition at line 296 of file class.ilCourseObjectivesGUI.php.

References $ilErr, and ilCourseObjective\_getObjectiveIds().

Referenced by saveQuestionOverview().

{
global $ilAccess,$ilErr,$ilTabs;
$ilTabs->setSubTabActive('crs_objective_overview_question_assignment');
if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
}
include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
$table = new ilCourseObjectiveQuestionsTableGUI($this,$this->course_obj);
$table->setTitle($this->lng->txt('crs_objectives_edit_question_assignments'),'',$this->lng->txt('crs_objectives'));
// begin-patch lok
$table->parse(ilCourseObjective::_getObjectiveIds($this->course_obj->getId(),false));
// end-patch lok
$this->tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::save ( )
protected

save

protected

Returns

Definition at line 529 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_REQUEST, $_SESSION, $ilErr, edit(), initFormTitle(), and ilUtil\sendSuccess().

{
global $ilAccess,$ilErr;
if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
}
$this->ctrl->saveParameter($this,'objective_id');
$this->objective = new ilCourseObjective($this->course_obj,(int) $_REQUEST['objective_id']);
$this->initFormTitle('create', 1);
if($this->form->checkInput())
{
$this->objective->setTitle($this->form->getInput('title'));
$this->objective->setDescription($this->form->getInput('description'));
$this->objective->setPasses(0);
if(!$_GET['objective_id'])
{
$objective_id = $this->objective->add();
ilUtil::sendSuccess($this->lng->txt('crs_added_objective'),true);
}
else
{
$this->objective->update();
ilUtil::sendSuccess($this->lng->txt('crs_objective_modified'),true);
$objective_id = $_GET['objective_id'];
}
}
else
{
$this->form->setValuesByPost();
return $this->edit();
}
if($_SESSION['objective_mode'] != self::MODE_CREATE)
{
$this->ctrl->returnToParent($this);
}
$this->ctrl->setParameter($this,'objective_id',$objective_id);
$this->ctrl->redirect($this,'materialAssignment');
return true;
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::saveQuestionOverview ( )
protected

update question overview

protected

Returns

Definition at line 323 of file class.ilCourseObjectivesGUI.php.

References $_POST, $ilErr, ilCourseObjectiveQuestion\_updateTestLimits(), questionOverview(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilCourseObjectiveQuestion\TYPE_FINAL_TEST, and ilCourseObjectiveQuestion\TYPE_SELF_ASSESSMENT.

{
include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
global $ilAccess,$ilErr;
if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
}
$error = false;
$_POST['self'] = $_POST['self'] ? $_POST['self'] : array();
$_POST['final'] = $_POST['final'] ? $_POST['final'] : array();
foreach($_POST['self'] as $objective_id => $limit)
{
$qst = new ilCourseObjectiveQuestion($objective_id);
$max_points = $qst->getSelfAssessmentPoints();
if($limit < 0 or $limit > $max_points)
{
ilUtil::sendFailure($this->lng->txt('crs_objective_limit_err'));
$this->questionOverview();
return false;
}
}
foreach($_POST['final'] as $objective_id => $limit)
{
$qst = new ilCourseObjectiveQuestion($objective_id);
$max_points = $qst->getFinalTestPoints();
if($limit < 0 or $limit > $max_points)
{
ilUtil::sendFailure($this->lng->txt('crs_objective_limit_err'));
$this->questionOverview();
return false;
}
}
foreach($_POST['self'] as $objective_id => $limit)
{
}
foreach($_POST['final'] as $objective_id => $limit)
{
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->questionOverview();
return true;
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::saveRandom ( )
protected

Save random test settings.

Definition at line 1104 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_REQUEST, $ref_id, __initQuestionObject(), ilObject\_lookupObjId(), getSettings(), initFormRandom(), ilUtil\sendFailure(), ilUtil\sendSuccess(), showRandomTestAssignment(), ilCourseObjectiveQuestion\TYPE_FINAL_TEST, ilCourseObjectiveQuestion\TYPE_SELF_ASSESSMENT, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

{
$this->ctrl->saveParameter($this,'objective_id');
$this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
$this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
$this->test_type = (int) $_REQUEST['tt'];
$form = $this->initFormRandom();
if($form->checkInput())
{
$qst = $this->__initQuestionObject((int) $_GET['objective_id']);
$qst->deleteByTestType(
($this->test_type == ilLOSettings::TYPE_TEST_INITIAL) ?
);
$ref_id = $this->getSettings()->getTestByType($this->test_type);
include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
$this->course_obj->getId(),
(int) $_REQUEST['objective_id'],
$this->test_type
);
$rnd->delete();
$rnd->setLimit($form->getInput('per'));
$rnd->setQplSequence($form->getInput('qpl'));
$rnd->setTestId(ilObject::_lookupObjId($ref_id));
$rnd->create();
}
else
{
$form->setValuesByPost();
ilUtil::sendFailure($this->lng->txt('err_check_input'));
return $this->showRandomTestAssignment();
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
if($this->test_type == ilLOSettings::TYPE_TEST_QUALIFIED)
{
$this->ctrl->returnToParent($this);
}
else
{
$this->ctrl->redirect($this,'finalTestAssignment');
}
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::saveSorting ( )
protected

save position

protected

Returns

Definition at line 150 of file class.ilCourseObjectivesGUI.php.

References $_POST, $ilErr, listObjectives(), and ilUtil\sendSuccess().

{
global $ilAccess,$ilErr,$ilObjDataCache;
if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
{
$this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
}
asort($_POST['position'],SORT_NUMERIC);
$counter = 1;
foreach($_POST['position'] as $objective_id => $position)
{
$objective = new ilCourseObjective($this->course_obj,$objective_id);
$objective->writePosition($counter++);
}
ilUtil::sendSuccess($this->lng->txt('crs_objective_saved_sorting'));
$this->listObjectives();
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::selfAssessmentAssignment ( )
protected

self assessment assignemnt

protected

Returns

Definition at line 695 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_REQUEST, $GLOBALS, $ilErr, $tpl, __initQuestionObject(), ilCourseObjectiveQuestion\_getAssignableTests(), initWizard(), isRandomTestType(), ilUtil\sendFailure(), setSubTabs(), showRandomTestAssignment(), ilCourseObjectiveQuestion\TYPE_SELF_ASSESSMENT, and ilLOSettings\TYPE_TEST_INITIAL.

Referenced by updateMaterialAssignment(), and updateSelfAssessmentAssignment().

{
global $ilAccess,$ilErr,$tpl;
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->redirect($this,'listObjectives');
}
$this->setSubTabs("self_ass_assign");
$this->ctrl->saveParameter($this,'objective_id');
$this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
// begin-patch lok
$this->ctrl->setParameter($this,'tt',ilLOSettings::TYPE_TEST_INITIAL);
$this->test_type = $_REQUEST['tt'] = ilLOSettings::TYPE_TEST_INITIAL;
{
return $this->showRandomTestAssignment();
}
// end-patch lok
include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
$this->course_obj,
(int) $_GET['objective_id'],
$table->setTitle($this->lng->txt('crs_objective_wiz_self'),
'',$this->lng->txt('crs_objective'));
$table->parse(ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()));
$this->__initQuestionObject((int) $_GET['objective_id']);
$this->initWizard(3);
$GLOBALS['tpl']->setContent($table->getHTML());
#$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
#$tpl->setContent($w_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::selfAssessmentLimits ( )
protected

self assessment limits

protected

Parameters
@return

Definition at line 827 of file class.ilCourseObjectivesGUI.php.

References $_GET, $GLOBALS, $ilErr, $tpl, __initQuestionObject(), initFormLimits(), initWizard(), ilUtil\sendFailure(), and setSubTabs().

Referenced by updateSelfAssessmentAssignment(), and updateSelfAssessmentLimits().

{
global $ilAccess,$ilErr,$tpl;
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->redirect($this,'listObjectives');
}
$this->setSubTabs("self_ass_limits");
$this->ctrl->saveParameter($this,'objective_id');
$this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
$this->__initQuestionObject((int) $_GET['objective_id']);
$this->initWizard(4);
$this->initFormLimits('selfAssessment');
$GLOBALS['tpl']->setContent($this->form->getHtml());
#$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
#$tpl->setContent($w_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::setSubTabs (   $a_active = "")

set sub tabs

Definition at line 420 of file class.ilCourseObjectivesGUI.php.

References ilCourseObjectiveQuestion\_hasTests().

Referenced by create(), edit(), finalTestAssignment(), finalTestLimits(), materialAssignment(), selfAssessmentAssignment(), selfAssessmentLimits(), and showRandomTestAssignment().

{
global $ilTabs, $ilHelp;
if ($a_active != "")
{
$ilHelp->setScreenIdComponent("crs");
$ilHelp->setScreenId("crs_objective");
$ilHelp->setSubScreenId($a_active);
}
// begin-patch lok
// no subtabs here
return true;
// end-patch lok
$ilTabs->addSubTabTarget("crs_objective_overview_objectives",
$this->ctrl->getLinkTarget($this, "listObjectives"),
array("listObjectives", "moveObjectiveUp", "moveObjectiveDown", "listAssignedLM"),
array(),
'',
true);
include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
if(ilCourseObjectiveQuestion::_hasTests($this->course_obj->getId()))
{
$ilTabs->addSubTabTarget("crs_objective_overview_question_assignment",
$this->ctrl->getLinkTarget($this, "questionOverview"),
"editQuestionAssignment",
array(),
'',
false);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::showRandomTestAssignment ( ilPropertyFormGUI  $form = null)
protected
Parameters
ilPropertyFormGUI$form

Definition at line 971 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_REQUEST, $GLOBALS, __initQuestionObject(), initFormRandom(), initWizard(), and setSubTabs().

Referenced by finalTestAssignment(), saveRandom(), and selfAssessmentAssignment().

{
$this->ctrl->saveParameter($this,'objective_id');
$this->ctrl->setParameter($this,'tt', (int) $_REQUEST['tt']);
$this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
$this->test_type = (int) $_REQUEST['tt'];
$this->setSubTabs("rand_test_assign");
if(!$form instanceof ilPropertyFormGUI)
{
$form = $this->initFormRandom();
}
$this->__initQuestionObject((int) $_GET['objective_id']);
$this->initWizard(5);
$GLOBALS['tpl']->setContent($form->getHTML());
#$w_tpl->setVariable('WIZ_CONTENT',$form->getHTML());
#$GLOBALS['tpl']->setContent($w_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseObjectivesGUI::updateFinalTestAssignment ( )
protected

update self assessment assignment

protected

Parameters
@return

Definition at line 1159 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_POST, $ilErr, __initQuestionObject(), finalTestLimits(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilCourseObjectiveQuestion\TYPE_FINAL_TEST.

{
global $ilAccess,$ilErr,$ilObjDataCache;
$checked_questions = $_POST['questions'] ? $_POST['questions'] : array();
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->redirect($this,'listObjectives');
}
$this->__initQuestionObject((int) $_GET['objective_id']);
// Delete unchecked
foreach($this->objectives_qst_obj->getFinalTestQuestions() as $question)
{
$id = $question['ref_id'].'_'.$question['question_id'];
if(!in_array($id,$checked_questions))
{
$this->objectives_qst_obj->delete($question['qst_ass_id']);
}
}
// Add checked
foreach($checked_questions as $question_id)
{
list($test_ref_id,$qst_id) = explode('_',$question_id);
$test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
if($this->objectives_qst_obj->isFinalTestQuestion($qst_id))
{
continue;
}
$this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_FINAL_TEST);
$this->objectives_qst_obj->setTestRefId($test_ref_id);
$this->objectives_qst_obj->setTestObjId($test_obj_id);
$this->objectives_qst_obj->setQuestionId($qst_id);
$this->objectives_qst_obj->add();
}
// TODO: not nice
include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
$this->questions = new ilCourseObjectiveQuestion((int) $_GET['objective_id']);
// not required due to percentages
//$this->questions->updateLimits();
ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
$this->finalTestLimits();
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::updateFinalTestLimits ( )
protected

update self assessment limits

protected

Parameters
@return

Definition at line 1258 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_POST, $_SESSION, $ilErr, $test, __initQuestionObject(), finalTestLimits(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilCourseObjectiveQuestion\TYPE_FINAL_TEST.

{
global $ilAccess,$ilErr,$ilObjDataCache;
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->redirect($this,'listObjectives');
}
$this->__initQuestionObject((int) $_GET['objective_id']);
if((int) $_POST['limit'] < 1 or (int) $_POST['limit'] > 100)
{
ilUtil::sendFailure($this->lng->txt('crs_objective_err_limit'));
$this->finalTestLimits();
return false;
}
foreach($this->objectives_qst_obj->getFinalTests() as $test)
{
$this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_FINAL_TEST);
$this->objectives_qst_obj->setTestSuggestedLimit((int) $_POST['limit']);
$this->objectives_qst_obj->updateTest($test['test_objective_id']);
}
if($_SESSION['objective_mode'] != self::MODE_CREATE)
{
ilUtil::sendSuccess($this->lng->txt('settings_saved'), TRUE);
}
else
{
ilUtil::sendSuccess($this->lng->txt('crs_added_objective'),TRUE);
}
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::updateMaterialAssignment ( )
protected

update material assignment

protected

Parameters
@return

Definition at line 624 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_POST, $_SESSION, $ilErr, $ref_id, __initLMObject(), ilLMObject\_lookupType(), finalTestAssignment(), getSettings(), selfAssessmentAssignment(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilAccess,$ilErr,$ilObjDataCache;
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->redirect($this,'listObjectives');
}
$this->__initLMObject((int) $_GET['objective_id']);
$this->objectives_lm_obj->deleteAll();
if(is_array($_POST['materials']))
{
foreach($_POST['materials'] as $node_id)
{
$obj_id = $ilObjDataCache->lookupObjId($node_id);
$type = $ilObjDataCache->lookupType($obj_id);
$this->objectives_lm_obj->setLMRefId($node_id);
$this->objectives_lm_obj->setLMObjId($obj_id);
$this->objectives_lm_obj->setType($type);
$this->objectives_lm_obj->add();
}
}
if(is_array($_POST['chapters']))
{
foreach($_POST['chapters'] as $chapter)
{
include_once('./Modules/LearningModule/classes/class.ilLMObject.php');
list($ref_id,$chapter_id) = explode('_',$chapter);
$this->objectives_lm_obj->setLMRefId($ref_id);
$this->objectives_lm_obj->setLMObjId($chapter_id);
$this->objectives_lm_obj->setType(ilLMObject::_lookupType($chapter_id));
$this->objectives_lm_obj->add();
}
}
ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
if($_SESSION['objective_mode'] != self::MODE_CREATE)
{
ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'),true);
$this->ctrl->returnToParent($this);
}
// begin-patch lok
if($this->getSettings()->worksWithInitialTest())
{
}
else
{
}
// end-patch lok
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::updateSelfAssessmentAssignment ( )
protected

update self assessment assignment

protected

Parameters
@return

Definition at line 747 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_POST, $_SESSION, $ilErr, __initQuestionObject(), finalTestAssignment(), selfAssessmentAssignment(), selfAssessmentLimits(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilCourseObjectiveQuestion\TYPE_SELF_ASSESSMENT.

{
global $ilAccess,$ilErr,$ilObjDataCache;
$checked_questions = $_POST['questions'] ? $_POST['questions'] : array();
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->redirect($this,'listObjectives');
}
$this->__initQuestionObject((int) $_GET['objective_id']);
// Delete unchecked
foreach($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question)
{
$id = $question['ref_id'].'_'.$question['question_id'];
if(!in_array($id,$checked_questions))
{
$this->objectives_qst_obj->delete($question['qst_ass_id']);
}
}
// Add checked
foreach($checked_questions as $question_id)
{
list($test_ref_id,$qst_id) = explode('_',$question_id);
$test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
if($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id))
{
continue;
}
$this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT);
$this->objectives_qst_obj->setTestRefId($test_ref_id);
$this->objectives_qst_obj->setTestObjId($test_obj_id);
$this->objectives_qst_obj->setQuestionId($qst_id);
$this->objectives_qst_obj->add();
}
// TODO: not nice
include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
$this->questions = new ilCourseObjectiveQuestion((int) $_GET['objective_id']);
// not required due to percentages
//$this->questions->updateLimits();
if($checked_questions)
{
ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
return true;
}
else
{
switch($_SESSION['objective_mode'])
{
case self::MODE_CREATE:
return true;
case self::MODE_UPDATE:
ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
return true;
}
}
}

+ Here is the call graph for this function:

ilCourseObjectivesGUI::updateSelfAssessmentLimits ( )
protected

update self assessment limits

protected

Parameters
@return

Definition at line 862 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_POST, $ilErr, $test, __initQuestionObject(), finalTestAssignment(), selfAssessmentLimits(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilCourseObjectiveQuestion\TYPE_SELF_ASSESSMENT.

{
global $ilAccess,$ilErr,$ilObjDataCache;
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->redirect($this,'listObjectives');
}
$this->__initQuestionObject((int) $_GET['objective_id']);
if((int) $_POST['limit'] < 1 or (int) $_POST['limit'] > 100)
{
ilUtil::sendFailure($this->lng->txt('crs_objective_err_limit'));
return false;
}
foreach($this->objectives_qst_obj->getSelfAssessmentTests() as $test)
{
$this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT);
$this->objectives_qst_obj->setTestSuggestedLimit((int) $_POST['limit']);
$this->objectives_qst_obj->updateTest($test['test_objective_id']);
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
}

+ Here is the call graph for this function:

Field Documentation

ilCourseObjectivesGUI::$course_id

Definition at line 50 of file class.ilCourseObjectivesGUI.php.

ilCourseObjectivesGUI::$course_obj

Definition at line 49 of file class.ilCourseObjectivesGUI.php.

ilCourseObjectivesGUI::$ctrl

Definition at line 43 of file class.ilCourseObjectivesGUI.php.

ilCourseObjectivesGUI::$ilias

Definition at line 44 of file class.ilCourseObjectivesGUI.php.

Referenced by ilCourseObjectivesGUI().

ilCourseObjectivesGUI::$lng

Definition at line 46 of file class.ilCourseObjectivesGUI.php.

Referenced by ilCourseObjectivesGUI().

ilCourseObjectivesGUI::$settings
protected

Definition at line 53 of file class.ilCourseObjectivesGUI.php.

Referenced by getSettings().

ilCourseObjectivesGUI::$test_type = 0
protected

Definition at line 54 of file class.ilCourseObjectivesGUI.php.

Referenced by isRandomTestType().

const ilCourseObjectivesGUI::MODE_CREATE = 1

Definition at line 39 of file class.ilCourseObjectivesGUI.php.

Referenced by create().

const ilCourseObjectivesGUI::MODE_UNDEFINED = 0

Definition at line 38 of file class.ilCourseObjectivesGUI.php.

Referenced by listObjectives().

const ilCourseObjectivesGUI::MODE_UPDATE = 2

Definition at line 40 of file class.ilCourseObjectivesGUI.php.

Referenced by edit().


The documentation for this class was generated from the following file: