ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules 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 More...
 
 askDeleteObjective ()
 
 deleteObjectives ()
 
 __initCourseObject ()
 
 __initObjectivesObject ($a_id=0)
 
 __initLMObject ($a_objective_id=0)
 
 __initQuestionObject ($a_objective_id=0)
 
 setSubTabs ()
 set sub tabs More...
 
 create ()
 create objective More...
 

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 More...
 
 saveSorting ()
 save position More...
 
 questionOverview ()
 question overiew More...
 
 saveQuestionOverview ()
 update question overview More...
 
 edit ()
 edit objective More...
 
 save ()
 save More...
 
 materialAssignment ()
 material assignment More...
 
 updateMaterialAssignment ()
 update material assignment More...
 
 selfAssessmentAssignment ()
 self assessment assignemnt More...
 
 updateSelfAssessmentAssignment ()
 update self assessment assignment More...
 
 selfAssessmentLimits ()
 self assessment limits More...
 
 updateSelfAssessmentLimits ()
 update self assessment limits More...
 
 finalTestAssignment ()
 final test assignment More...
 
 updateFinalTestAssignment ()
 update self assessment assignment More...
 
 finalTestLimits ()
 self assessment limits More...
 
 updateFinalTestLimits ()
 update self assessment limits More...
 
 initFormLimits ($a_mode)
 init limit form More...
 
 initFormTitle ($a_mode, $a_step_number)
 init form title More...
 
 initWizard ($a_step_number)
 init wizard More...
 

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$

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

Member Function Documentation

◆ __initCourseObject()

ilCourseObjectivesGUI::__initCourseObject ( )

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

References exit, and ilObjectFactory\getInstanceByRefId().

Referenced by ilCourseObjectivesGUI().

355  {
356  if(!$this->course_obj =& ilObjectFactory::getInstanceByRefId($this->course_id,false))
357  {
358  $this->ilErr->raiseError("ilCourseObjectivesGUI: cannot create course object",$this->ilErr->MESSAGE);
359  exit;
360  }
361  return true;
362  }
exit
Definition: login.php:54
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __initLMObject()

ilCourseObjectivesGUI::__initLMObject (   $a_objective_id = 0)

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

Referenced by updateMaterialAssignment().

370  {
371  include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
372  $this->objectives_lm_obj =& new ilCourseObjectiveMaterials($a_objective_id);
373 
374  return true;
375  }
class ilCourseObjectiveMaterials
+ Here is the caller graph for this function:

◆ __initObjectivesObject()

ilCourseObjectivesGUI::__initObjectivesObject (   $a_id = 0)

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

Referenced by askDeleteObjective(), and deleteObjectives().

365  {
366  return $this->objectives_obj = new ilCourseObjective($this->course_obj,$a_id);
367  }
class ilcourseobjective
+ Here is the caller graph for this function:

◆ __initQuestionObject()

ilCourseObjectivesGUI::__initQuestionObject (   $a_objective_id = 0)

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

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

378  {
379  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
380  $this->objectives_qst_obj =& new ilCourseObjectiveQuestion($a_objective_id);
381 
382  return true;
383  }
class ilcourseobjectiveQuestion
+ Here is the caller graph for this function:

◆ askDeleteObjective()

ilCourseObjectivesGUI::askDeleteObjective ( )

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

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

149  {
150  global $rbacsystem;
151 
152  // MINIMUM ACCESS LEVEL = 'write'
153  if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
154  {
155  $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
156  }
157  if(!count($_POST['objective']))
158  {
159  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
160  $this->listObjectives();
161 
162  return true;
163  }
164 
165  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html",'Modules/Course');
166 
167  ilUtil::sendQuestion($this->lng->txt('crs_delete_objectve_sure'));
168 
169  $tpl =& new ilTemplate("tpl.table.html", true, true);
170  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_delete_row.html",'Modules/Course');
171 
172  $counter = 0;
173  foreach($_POST['objective'] as $objective_id)
174  {
175  $objective_obj = $this->__initObjectivesObject($objective_id);
176 
177  $tpl->setCurrentBlock("tbl_content");
178  $tpl->setVariable("ROWCOL",ilUtil::switchColor(++$counter,"tblrow2","tblrow1"));
179  $tpl->setVariable("TITLE",$objective_obj->getTitle());
180  $tpl->setVariable("DESCRIPTION",$objective_obj->getDescription());
181  $tpl->parseCurrentBlock();
182  }
183 
184  $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
185 
186  // Show action row
187  $tpl->setCurrentBlock("tbl_action_btn");
188  $tpl->setVariable("BTN_NAME",'deleteObjectives');
189  $tpl->setVariable("BTN_VALUE",$this->lng->txt('delete'));
190  $tpl->parseCurrentBlock();
191 
192  $tpl->setCurrentBlock("tbl_action_btn");
193  $tpl->setVariable("BTN_NAME",'listObjectives');
194  $tpl->setVariable("BTN_VALUE",$this->lng->txt('cancel'));
195  $tpl->parseCurrentBlock();
196 
197  $tpl->setCurrentBlock("tbl_action_row");
198  $tpl->setVariable("COLUMN_COUNTS",1);
199  $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.png'));
200  $tpl->parseCurrentBlock();
201 
202 
203  // create table
204  $tbl = new ilTableGUI();
205  $tbl->setStyle('table','std');
206 
207  // title & header columns
208  $tbl->setTitle($this->lng->txt("crs_objectives"),"icon_lobj.png",$this->lng->txt("crs_objectives"));
209 
210  $tbl->setHeaderNames(array($this->lng->txt("title")));
211  $tbl->setHeaderVars(array("title"),
212  array("ref_id" => $this->course_obj->getRefId(),
213  "cmdClass" => "ilcourseobjectivesgui",
214  "cmdNode" => $_GET["cmdNode"]));
215  $tbl->setColumnWidth(array("50%"));
216 
217  $tbl->setLimit($_GET["limit"]);
218  $tbl->setOffset($_GET["offset"]);
219  $tbl->setMaxCount(count($_POST['objective']));
220 
221  // footer
222  $tbl->disable("footer");
223  $tbl->disable('sort');
224 
225  // render table
226  $tbl->setTemplate($tpl);
227  $tbl->render();
228 
229  $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get());
230 
231 
232  // Save marked objectives
233  $_SESSION['crs_delete_objectives'] = $_POST['objective'];
234 
235  return true;
236  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
Class ilTableGUI.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
+ Here is the call graph for this function:

◆ create()

ilCourseObjectivesGUI::create ( )

create objective

public

Parameters

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

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

Referenced by save().

420  {
421  global $tpl;
422 
423  $_SESSION['objective_mode'] = self::MODE_CREATE;
424 
425  $this->ctrl->saveParameter($this,'objective_id');
426 
427  if(!is_object($this->objective))
428  {
429  $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
430  }
431  $this->__initQuestionObject((int) $_GET['objective_id']);
432  $w_tpl = $this->initWizard(1);
433 
434  $this->initFormTitle('create',1);
435  $w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
436  $tpl->setContent($w_tpl->get());
437  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
initFormTitle($a_mode, $a_step_number)
init form title
initWizard($a_step_number)
init wizard
$_GET["client_id"]
class ilcourseobjective
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteObjectives()

ilCourseObjectivesGUI::deleteObjectives ( )

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

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

239  {
240  global $rbacsystem;
241 
242  // MINIMUM ACCESS LEVEL = 'write'
243  if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
244  {
245  $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
246  }
247  if(!count($_SESSION['crs_delete_objectives']))
248  {
249  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
250  $this->listObjectives();
251 
252  return true;
253  }
254 
255  foreach($_SESSION['crs_delete_objectives'] as $objective_id)
256  {
257  $objective_obj =& $this->__initObjectivesObject($objective_id);
258  $objective_obj->delete();
259  }
260 
261  ilUtil::sendSuccess($this->lng->txt('crs_objectives_deleted'));
262  $this->listObjectives();
263 
264  return true;
265  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ edit()

ilCourseObjectivesGUI::edit ( )
protected

edit objective

protected

Returns

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

References $_GET, $_SESSION, $tpl, __initQuestionObject(), initFormTitle(), initWizard(), and ilUtil\sendFailure().

446  {
447  global $tpl;
448 
449  $_SESSION['objective_mode'] = self::MODE_UPDATE;
450 
451  $this->ctrl->saveParameter($this,'objective_id');
452 
453  if(!$_GET['objective_id'])
454  {
455  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
456  $this->ctrl->redirect($this,'listObjectives');
457  }
458 
459  if(!is_object($this->objective))
460  {
461  $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
462  }
463 
464  $this->__initQuestionObject((int) $_GET['objective_id']);
465  $w_tpl = $this->initWizard(1);
466  $this->initFormTitle('create',1);
467  $w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
468  $tpl->setContent($w_tpl->get());
469  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
initFormTitle($a_mode, $a_step_number)
init form title
initWizard($a_step_number)
init wizard
$_GET["client_id"]
class ilcourseobjective
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ executeCommand()

& ilCourseObjectivesGUI::executeCommand ( )

execute command

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

References $cmd, and setSubTabs().

74  {
75  global $ilTabs;
76 
77  $ilTabs->setTabActive('crs_objectives');
78 
79  $cmd = $this->ctrl->getCmd();
80 
81 
82  if (!$cmd = $this->ctrl->getCmd())
83  {
84  $cmd = "list";
85  }
86 
87  $this->setSubTabs();
88  $this->$cmd();
89  }
$cmd
Definition: sahs_server.php:35
+ Here is the call graph for this function:

◆ finalTestAssignment()

ilCourseObjectivesGUI::finalTestAssignment ( )
protected

final test assignment

protected

Parameters

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

References $_GET, $ilErr, $tpl, __initQuestionObject(), ilCourseObjectiveQuestion\_getAssignableTests(), initWizard(), ilUtil\sendFailure(), and ilCourseObjectiveQuestion\TYPE_FINAL_TEST.

Referenced by updateSelfAssessmentAssignment(), and updateSelfAssessmentLimits().

810  {
811  global $ilAccess,$ilErr,$tpl;
812 
813  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
814  {
815  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
816  }
817  if(!$_GET['objective_id'])
818  {
819  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
820  $this->ctrl->redirect($this,'listObjectives');
821  }
822 
823  $this->ctrl->saveParameter($this,'objective_id');
824 
825  $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
826 
827  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
829  $this->course_obj,
830  (int) $_GET['objective_id'],
832 
833  $table->setTitle($this->lng->txt('crs_objective_wiz_final'),
834  'icon_lobj.png',$this->lng->txt('crs_objective'));
835  $table->parse(ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()));
836 
837  $this->__initQuestionObject((int) $_GET['objective_id']);
838  $w_tpl = $this->initWizard(5);
839  $w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
840  $tpl->setContent($w_tpl->get());
841 
842  }
initWizard($a_step_number)
init wizard
$_GET["client_id"]
class ilcourseobjective
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
TableGUI for question assignments of course objectives.
static _getAssignableTests($a_container_ref_id)
Get assignable tests.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finalTestLimits()

ilCourseObjectivesGUI::finalTestLimits ( )
protected

self assessment limits

protected

Parameters

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

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

Referenced by updateFinalTestAssignment(), and updateFinalTestLimits().

914  {
915  global $ilAccess,$ilErr,$tpl;
916 
917  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
918  {
919  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
920  }
921  if(!$_GET['objective_id'])
922  {
923  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
924  $this->ctrl->redirect($this,'listObjectives');
925  }
926 
927  $this->ctrl->saveParameter($this,'objective_id');
928  $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
929 
930  $this->__initQuestionObject((int) $_GET['objective_id']);
931  $w_tpl = $this->initWizard(6);
932 
933  $this->initFormLimits('final');
934  $w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
935  $tpl->setContent($w_tpl->get());
936  }
initWizard($a_step_number)
init wizard
$_GET["client_id"]
class ilcourseobjective
initFormLimits($a_mode)
init limit form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilCourseObjectivesGUI()

ilCourseObjectivesGUI::ilCourseObjectivesGUI (   $a_course_id)

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

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

51  {
52  include_once './Modules/Course/classes/class.ilCourseObjective.php';
53 
54  global $ilCtrl,$lng,$ilErr,$ilias,$tpl,$tree,$ilTabs;
55 
56  $this->ctrl =& $ilCtrl;
57  $this->ctrl->saveParameter($this,array("ref_id"));
58 
59  $this->ilErr =& $ilErr;
60  $this->lng =& $lng;
61  $this->lng->loadLanguageModule('crs');
62  $this->tpl =& $tpl;
63  $this->tree =& $tree;
64  $this->tabs_gui =& $ilTabs;
65 
66  $this->course_id = $a_course_id;
67  $this->__initCourseObject();
68  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ initFormLimits()

ilCourseObjectivesGUI::initFormLimits (   $a_mode)
protected

init limit form

protected

Parameters
stringmode selfAssessment or final
Returns

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

References $test, $tests, ilObject\_lookupDescription(), ilObject\_lookupTitle(), ilUtil\getImagePath(), ilUtil\getTypeIconPath(), ilCustomInputGUI\setHtml(), and ilTextInputGUI\setValue().

Referenced by finalTestLimits(), and selfAssessmentLimits().

987  {
988  if(!is_object($this->form))
989  {
990  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
991  $this->form = new ilPropertyFormGUI();
992  }
993  $this->form->setFormAction($this->ctrl->getFormAction($this));
994  $this->form->setTableWidth('100%');
995  $this->form->setTitleIcon(ilUtil::getImagePath('icon_lobj.png'),$this->lng->txt('crs_objective'));
996 
997  switch($a_mode)
998  {
999  case 'selfAssessment':
1000  $this->form->setTitle($this->lng->txt('crs_objective_wiz_self_limit'));
1001  $this->form->addCommandButton('updateSelfAssessmentLimits',$this->lng->txt('crs_wiz_next'));
1002  $this->form->addCommandButton('selfAssessmentAssignment',$this->lng->txt('crs_wiz_back'));
1003 
1004  $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
1005  $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
1006 
1007  break;
1008 
1009  case 'final':
1010  $this->form->setTitle($this->lng->txt('crs_objective_wiz_final_limit'));
1011  $this->form->addCommandButton('updateFinalTestLimits',$this->lng->txt('crs_wiz_next'));
1012  $this->form->addCommandButton('finalTestAssignment',$this->lng->txt('crs_wiz_back'));
1013 
1014  $tests = $this->objectives_qst_obj->getFinalTests();
1015  $max_points = $this->objectives_qst_obj->getFinalTestPoints();
1016 
1017  break;
1018  }
1019 
1020  $over = new ilCustomInputGUI($this->lng->txt('crs_objective_qst_summary'),'');
1021 
1022  $tpl = new ilTemplate('tpl.crs_objective_qst_summary.html',true,true,'Modules/Course');
1023 
1024 
1025  $limit = 0;
1026 
1027  foreach($tests as $test)
1028  {
1029  $limit = $test['limit'];
1030 
1031  foreach($this->objectives_qst_obj->getQuestionsOfTest($test['obj_id']) as $question)
1032  {
1033  $tpl->setCurrentBlock('qst');
1034  $tpl->setVariable('QST_TITLE',$question['title']);
1035  if(strlen($question['description']))
1036  {
1037  $tpl->setVariable('QST_DESCRIPTION',$question['description']);
1038  }
1039  $tpl->setVariable('QST_POINTS',$question['points'].' '.
1040  $this->lng->txt('crs_objective_points'));
1041  $tpl->parseCurrentBlock();
1042  }
1043  $tpl->setCurrentBlock('tst');
1044  $tpl->setVariable('TST_TITLE',ilObject::_lookupTitle($test['obj_id']));
1045  if($desc = ilObject::_lookupDescription($test['obj_id']))
1046  {
1047  $tpl->setVariable('TST_DESC',$desc);
1048  }
1049  $tpl->setVariable('TST_TYPE_IMG',ilUtil::getTypeIconPath('tst',$test['obj_id'],'tiny'));
1050  $tpl->setVariable('TST_ALT_IMG',$this->lng->txt('obj_tst'));
1051  $tpl->parseCurrentBlock();
1052  }
1053 
1054  $tpl->setVariable('TXT_ALL_POINTS',$this->lng->txt('crs_objective_all_points'));
1055  $tpl->setVariable('TXT_POINTS',$this->lng->txt('crs_objective_points'));
1056  $tpl->setVariable('POINTS',$max_points);
1057 
1058  $over->setHtml($tpl->get());
1059  $this->form->addItem($over);
1060 
1061  $req = new ilTextInputGUI($this->lng->txt('crs_obj_required_points'),'limit');
1062  $req->setValue($limit);
1063  $req->setMaxLength(5);
1064  $req->setSize(3);
1065  $req->setRequired(true);
1066  switch($a_mode)
1067  {
1068  case 'selfAssessment':
1069  $req->setInfo($this->lng->txt('crs_obj_initial_req_info'));
1070  break;
1071 
1072  case 'final':
1073  $req->setInfo($this->lng->txt('crs_obj_final_req_info'));
1074  break;
1075  }
1076 
1077 
1078  $this->form->addItem($req);
1079 
1080  }
setHtml($a_html)
Set Html.
This class represents a property form user interface.
static _lookupTitle($a_id)
lookup object title
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupDescription($a_id)
lookup object description
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
This class represents a custom property in a property form.
setValue($a_value)
Set Value.
$test
Definition: Utf8Test.php:85
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormTitle()

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

init form title

protected

Returns

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

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

Referenced by create(), and edit().

1090  {
1091  if(!is_object($this->form))
1092  {
1093  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
1094  $this->form = new ilPropertyFormGUI();
1095  }
1096  $this->form->setFormAction($this->ctrl->getFormAction($this));
1097  $this->form->setTitleIcon(ilUtil::getImagePath('icon_lobj.png'),$this->lng->txt('crs_objective'));
1098 
1099  switch($a_mode)
1100  {
1101  case 'create':
1102  $this->form->setTitle($this->lng->txt('crs_objective_wiz_title'));
1103  $this->form->addCommandButton('save',$this->lng->txt('crs_wiz_next'));
1104  $this->form->addCommandButton('listObjectives',$this->lng->txt('cancel'));
1105  break;
1106 
1107  case 'update':
1108  break;
1109  }
1110 
1111  $title = new ilTextInputGUI($this->lng->txt('title'),'title');
1112  $title->setValue($this->objective->getTitle());
1113  $title->setRequired(true);
1114  $title->setSize(40);
1115  $title->setMaxLength(70);
1116  $this->form->addItem($title);
1117 
1118  $desc = new ilTextAreaInputGUI($this->lng->txt('description'),'description');
1119  $desc->setValue($this->objective->getDescription());
1120  $desc->setCols(40);
1121  $desc->setRows(5);
1122  $this->form->addItem($desc);
1123 
1124 
1125  }
This class represents a property form user interface.
setValue($a_value)
Set Value.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a text property in a property form.
This class represents a text area property in a property form.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initWizard()

ilCourseObjectivesGUI::initWizard (   $a_step_number)
protected

init wizard

protected

Parameters
stringmode 'create' or 'edit'
Returns

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

References $_SESSION, $options, $tpl, and ilUtil\getImagePath().

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

1136  {
1137  $options = array(
1138  1 => $this->lng->txt('crs_objective_wiz_title'),
1139  2 => $this->lng->txt('crs_objective_wiz_materials'),
1140  3 => $this->lng->txt('crs_objective_wiz_self'),
1141  4 => $this->lng->txt('crs_objective_wiz_self_limit'),
1142  5 => $this->lng->txt('crs_objective_wiz_final'),
1143  6 => $this->lng->txt('crs_objective_wiz_final_limit'));
1144 
1145  $info = array(
1146  1 => $this->lng->txt('crs_objective_wiz_title_info'),
1147  2 => $this->lng->txt('crs_objective_wiz_materials_info'),
1148  3 => $this->lng->txt('crs_objective_wiz_self_info'),
1149  4 => $this->lng->txt('crs_objective_wiz_self_limit_info'),
1150  5 => $this->lng->txt('crs_objective_wiz_final_info'),
1151  6 => $this->lng->txt('crs_objective_wiz_final_limit_info'));
1152 
1153  $links = array(
1154  1 => $this->ctrl->getLinkTarget($this,'edit'),
1155  2 => $this->ctrl->getLinkTarget($this,'materialAssignment'),
1156  3 => $this->ctrl->getLinkTarget($this,'selfAssessmentAssignment'),
1157  4 => $this->ctrl->getLinkTarget($this,'selfAssessmentLimits'),
1158  5 => $this->ctrl->getLinkTarget($this,'finalTestAssignment'),
1159  6 => $this->ctrl->getLinkTarget($this,'finalTestLimits'));
1160 
1161 
1162  $tpl = new ilTemplate('tpl.objective_wizard.html',true,true,'Modules/Course');
1163 
1164  if($_SESSION['objective_mode'] == self::MODE_CREATE or 1)
1165  {
1166  $tpl->setCurrentBlock('step_info');
1167 
1168  if(is_object($this->objective) and strlen($this->objective->getTitle()))
1169  {
1170  $tpl->setVariable('STEP_SEPARATOR','-');
1171  $tpl->setVariable('STEP_TITLE',$this->objective->getTitle());
1172  }
1173 
1174  $tpl->setVariable('STEP_INFO_STEP',$this->lng->txt('crs_objective_step'));
1175  $tpl->setVariable('STEP_INFO_NUM',$a_step_number);
1176  $tpl->setVariable('STEP_INFO_INFO',$info[$a_step_number]);
1177  $tpl->parseCurrentBlock();
1178  }
1179 
1180 
1181  $tpl->setVariable('WIZ_IMG',ilUtil::getImagePath('icon_lobj.png'));
1182  $tpl->setVariable('WIZ_IMG_ALT',$this->lng->txt('crs_objectives'));
1183 
1184  if($_SESSION['objective_mode'] == self::MODE_CREATE)
1185  {
1186  $tpl->setVariable('WIZ_NAV_TITLE',$this->lng->txt('crs_add_objective'));
1187  }
1188  else
1189  {
1190  $tpl->setVariable('WIZ_NAV_TITLE',$this->lng->txt('crs_update_objective'));
1191  }
1192 
1193  foreach($options as $step => $title)
1194  {
1195  if($_SESSION['objective_mode'] == self::MODE_UPDATE)
1196  {
1197  $hide_link = false;
1198  if($step == 4 and !count($this->objectives_qst_obj->getSelfAssessmentQuestions()))
1199  {
1200  $hide_link = true;
1201  }
1202  if($step == 6 and !count($this->objectives_qst_obj->getFinalTestQuestions()))
1203  {
1204  $hide_link = true;
1205  }
1206  if(!$hide_link)
1207  {
1208  $tpl->setCurrentBlock('begin_link_option');
1209  $tpl->setVariable('WIZ_OPTION_LINK',$links[$step]);
1210  $tpl->parseCurrentBlock();
1211 
1212  $tpl->touchBlock('end_link_option');
1213  }
1214  }
1215 
1216 
1217  $tpl->setCurrentBlock('nav_option');
1218  $tpl->setVariable('OPTION_CLASS',$step == $a_step_number ? 'option_value_details' : 'std');
1219  $tpl->setVariable('WIZ_NUM',$step.'.');
1220  $tpl->setVariable('WIZ_OPTION',$title);
1221  $tpl->parseCurrentBlock();
1222  }
1223 
1224 
1225  return $tpl;
1226  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
if(!is_array($argv)) $options
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listObjectives()

ilCourseObjectivesGUI::listObjectives ( )
protected

list objectives

protected

Parameters

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

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

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

99  {
100  global $ilAccess,$ilErr,$ilObjDataCache,$ilToolbar;
101 
102  $_SESSION['objective_mode'] = self::MODE_UNDEFINED;
103  if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
104  {
105  $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
106  }
107 
108  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_objectives.html','Modules/Course');
109 
110  $ilToolbar->addButton($this->lng->txt('crs_add_objective'),
111  $this->ctrl->getLinkTarget($this, "'create"));
112 
113  include_once('./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
114  $table = new ilCourseObjectivesTableGUI($this,$this->course_obj);
115  $table->setTitle($this->lng->txt('crs_objectives'),'icon_lobj.png',$this->lng->txt('crs_objectives'));
116  $table->parse(ilCourseObjective::_getObjectiveIds($this->course_obj->getId()));
117 
118  $this->tpl->setVariable('OBJECTIVES_TABLE',$table->getHTML());
119  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ materialAssignment()

ilCourseObjectivesGUI::materialAssignment ( )
protected

material assignment

protected

Returns

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

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

522  {
523  global $ilAccess,$ilErr,$tpl;
524 
525  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
526  {
527  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
528  }
529  if(!$_GET['objective_id'])
530  {
531  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
532  $this->ctrl->redirect($this,'listObjectives');
533  }
534 
535  $this->ctrl->saveParameter($this,'objective_id');
536 
537  $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
538 
539  include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
540  $table = new ilCourseObjectiveMaterialAssignmentTableGUI($this,$this->course_obj,(int) $_GET['objective_id']);
541  $table->setTitle($this->lng->txt('crs_objective_wiz_materials'),
542  'icon_lobj.png',$this->lng->txt('crs_objectives'));
543 
544  include_once('Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
545  $table->parse(ilCourseObjectiveMaterials::_getAssignableMaterials($this->course_obj->getRefId()));
546 
547  $this->__initQuestionObject((int) $_GET['objective_id']);
548  $w_tpl = $this->initWizard(2);
549  $w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
550  $tpl->setContent($w_tpl->get());
551  }
initWizard($a_step_number)
init wizard
$_GET["client_id"]
TableGUI for material assignments of course objectives.
class ilcourseobjective
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _getAssignableMaterials($a_container_id)
Get an array of course material ids that can be assigned to learning objectives No tst...
+ Here is the call graph for this function:

◆ questionOverview()

ilCourseObjectivesGUI::questionOverview ( )
protected

question overiew

protected

Returns

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

References $ilErr, and ilCourseObjective\_getObjectiveIds().

Referenced by saveQuestionOverview().

274  {
275  global $ilAccess,$ilErr,$ilTabs;
276 
277  $ilTabs->setSubTabActive('crs_objective_overview_question_assignment');
278 
279  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
280  {
281  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
282  }
283 
284  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
285  $table = new ilCourseObjectiveQuestionsTableGUI($this,$this->course_obj);
286  $table->setTitle($this->lng->txt('crs_objectives_edit_question_assignments'),'icon_lobj.png',$this->lng->txt('crs_objectives'));
287  $table->parse(ilCourseObjective::_getObjectiveIds($this->course_obj->getId()));
288 
289  $this->tpl->setContent($table->getHTML());
290  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilCourseObjectivesGUI::save ( )
protected

save

protected

Returns

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

References $_GET, $_POST, $ilErr, create(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

478  {
479  global $ilAccess,$ilErr;
480 
481  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
482  {
483  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
484  }
485 
486  $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
487  $this->objective->setTitle(ilUtil::stripSlashes($_POST['title']));
488  $this->objective->setDescription(ilUtil::stripSlashes($_POST['description']));
489 
490  if(!$this->objective->validate())
491  {
492  ilUtil::sendFailure($this->lng->txt('crs_no_title_given'));
493  $this->create();
494  return false;
495  }
496 
497  if(!$_GET['objective_id'])
498  {
499  $objective_id = $this->objective->add();
500  ilUtil::sendSuccess($this->lng->txt('crs_added_objective'),true);
501  }
502  else
503  {
504  $this->objective->update();
505  ilUtil::sendSuccess($this->lng->txt('crs_objective_modified'),true);
506  $objective_id = $_GET['objective_id'];
507  }
508 
509  $this->ctrl->saveParameter($this,'objective_id');
510  $this->ctrl->setParameter($this,'objective_id',$objective_id);
511  $this->ctrl->redirect($this,'materialAssignment');
512  return true;
513  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
class ilcourseobjective
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ saveQuestionOverview()

ilCourseObjectivesGUI::saveQuestionOverview ( )
protected

update question overview

protected

Returns

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

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

299  {
300  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
301 
302  global $ilAccess,$ilErr;
303 
304  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
305  {
306  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
307  }
308  $error = false;
309 
310  $_POST['self'] = $_POST['self'] ? $_POST['self'] : array();
311  $_POST['final'] = $_POST['final'] ? $_POST['final'] : array();
312 
313  foreach($_POST['self'] as $objective_id => $limit)
314  {
315  $qst = new ilCourseObjectiveQuestion($objective_id);
316  $max_points = $qst->getSelfAssessmentPoints();
317 
318  if($limit < 0 or $limit > $max_points)
319  {
320  ilUtil::sendFailure($this->lng->txt('crs_objective_limit_err'));
321  $this->questionOverview();
322  return false;
323  }
324  }
325  foreach($_POST['final'] as $objective_id => $limit)
326  {
327  $qst = new ilCourseObjectiveQuestion($objective_id);
328  $max_points = $qst->getFinalTestPoints();
329 
330  if($limit < 0 or $limit > $max_points)
331  {
332  ilUtil::sendFailure($this->lng->txt('crs_objective_limit_err'));
333  $this->questionOverview();
334  return false;
335  }
336  }
337 
338  foreach($_POST['self'] as $objective_id => $limit)
339  {
341  }
342 
343  foreach($_POST['final'] as $objective_id => $limit)
344  {
346  }
347 
348  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
349  $this->questionOverview();
350  return true;
351  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _updateTestLimits($a_objective_id, $a_status, $a_limit)
update test limits
class ilcourseobjectiveQuestion
+ Here is the call graph for this function:

◆ saveSorting()

ilCourseObjectivesGUI::saveSorting ( )
protected

save position

protected

Returns

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

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

128  {
129  global $ilAccess,$ilErr,$ilObjDataCache;
130 
131  if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
132  {
133  $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
134  }
135 
136  asort($_POST['position'],SORT_NUMERIC);
137 
138  $counter = 1;
139  foreach($_POST['position'] as $objective_id => $position)
140  {
141  $objective = new ilCourseObjective($this->course_obj,$objective_id);
142  $objective->writePosition($counter++);
143  }
144  ilUtil::sendSuccess($this->lng->txt('crs_objective_saved_sorting'));
145  $this->listObjectives();
146  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
class ilcourseobjective
+ Here is the call graph for this function:

◆ selfAssessmentAssignment()

ilCourseObjectivesGUI::selfAssessmentAssignment ( )
protected

self assessment assignemnt

protected

Returns

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

References $_GET, $ilErr, $tpl, __initQuestionObject(), ilCourseObjectiveQuestion\_getAssignableTests(), initWizard(), ilUtil\sendFailure(), and ilCourseObjectiveQuestion\TYPE_SELF_ASSESSMENT.

Referenced by updateMaterialAssignment(), and updateSelfAssessmentAssignment().

616  {
617  global $ilAccess,$ilErr,$tpl;
618 
619  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
620  {
621  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
622  }
623  if(!$_GET['objective_id'])
624  {
625  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
626  $this->ctrl->redirect($this,'listObjectives');
627  }
628 
629  $this->ctrl->saveParameter($this,'objective_id');
630 
631  $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
632 
633  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
635  $this->course_obj,
636  (int) $_GET['objective_id'],
638  $table->setTitle($this->lng->txt('crs_objective_wiz_self'),
639  'icon_lobj.png',$this->lng->txt('crs_objective'));
640  $table->parse(ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()));
641 
642  $this->__initQuestionObject((int) $_GET['objective_id']);
643  $w_tpl = $this->initWizard(3);
644  $w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
645  $tpl->setContent($w_tpl->get());
646  }
initWizard($a_step_number)
init wizard
$_GET["client_id"]
class ilcourseobjective
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
TableGUI for question assignments of course objectives.
static _getAssignableTests($a_container_ref_id)
Get assignable tests.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selfAssessmentLimits()

ilCourseObjectivesGUI::selfAssessmentLimits ( )
protected

self assessment limits

protected

Parameters

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

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

Referenced by updateSelfAssessmentAssignment(), and updateSelfAssessmentLimits().

735  {
736  global $ilAccess,$ilErr,$tpl;
737 
738  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
739  {
740  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
741  }
742  if(!$_GET['objective_id'])
743  {
744  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
745  $this->ctrl->redirect($this,'listObjectives');
746  }
747 
748  $this->ctrl->saveParameter($this,'objective_id');
749  $this->objective = new ilCourseObjective($this->course_obj,(int) $_GET['objective_id']);
750 
751  $this->__initQuestionObject((int) $_GET['objective_id']);
752  $w_tpl = $this->initWizard(4);
753 
754  $this->initFormLimits('selfAssessment');
755  $w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
756  $tpl->setContent($w_tpl->get());
757  }
initWizard($a_step_number)
init wizard
$_GET["client_id"]
class ilcourseobjective
initFormLimits($a_mode)
init limit form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubTabs()

ilCourseObjectivesGUI::setSubTabs ( )

set sub tabs

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

References ilCourseObjectiveQuestion\_hasTests().

Referenced by executeCommand().

389  {
390  global $ilTabs;
391 
392  $ilTabs->addSubTabTarget("crs_objective_overview_objectives",
393  $this->ctrl->getLinkTarget($this, "listObjectives"),
394  array("listObjectives", "moveObjectiveUp", "moveObjectiveDown", "listAssignedLM"),
395  array(),
396  '',
397  true);
398  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
399 
400  if(ilCourseObjectiveQuestion::_hasTests($this->course_obj->getId()))
401  {
402  $ilTabs->addSubTabTarget("crs_objective_overview_question_assignment",
403  $this->ctrl->getLinkTarget($this, "questionOverview"),
404  "editQuestionAssignment",
405  array(),
406  '',
407  false);
408  }
409  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateFinalTestAssignment()

ilCourseObjectivesGUI::updateFinalTestAssignment ( )
protected

update self assessment assignment

protected

Parameters

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

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

852  {
853  global $ilAccess,$ilErr,$ilObjDataCache;
854 
855  $checked_questions = $_POST['questions'] ? $_POST['questions'] : array();
856 
857 
858  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
859  {
860  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
861  }
862  if(!$_GET['objective_id'])
863  {
864  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
865  $this->ctrl->redirect($this,'listObjectives');
866  }
867 
868  $this->__initQuestionObject((int) $_GET['objective_id']);
869 
870  // Delete unchecked
871  foreach($this->objectives_qst_obj->getFinalTestQuestions() as $question)
872  {
873  $id = $question['ref_id'].'_'.$question['question_id'];
874  if(!in_array($id,$checked_questions))
875  {
876  $this->objectives_qst_obj->delete($question['qst_ass_id']);
877  }
878  }
879  // Add checked
880  foreach($checked_questions as $question_id)
881  {
882  list($test_ref_id,$qst_id) = explode('_',$question_id);
883  $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
884 
885  if($this->objectives_qst_obj->isFinalTestQuestion($qst_id))
886  {
887  continue;
888  }
889 
890  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_FINAL_TEST);
891  $this->objectives_qst_obj->setTestRefId($test_ref_id);
892  $this->objectives_qst_obj->setTestObjId($test_obj_id);
893  $this->objectives_qst_obj->setQuestionId($qst_id);
894  $this->objectives_qst_obj->add();
895  }
896 
897  // TODO: not nice
898  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
899  $this->questions = new ilCourseObjectiveQuestion((int) $_GET['objective_id']);
900  $this->questions->updateLimits();
901 
902  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
903  $this->finalTestLimits();
904  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
finalTestLimits()
self assessment limits
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
class ilcourseobjectiveQuestion
+ Here is the call graph for this function:

◆ updateFinalTestLimits()

ilCourseObjectivesGUI::updateFinalTestLimits ( )
protected

update self assessment limits

protected

Parameters

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

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

946  {
947  global $ilAccess,$ilErr,$ilObjDataCache;
948 
949  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
950  {
951  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
952  }
953  if(!$_GET['objective_id'])
954  {
955  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
956  $this->ctrl->redirect($this,'listObjectives');
957  }
958 
959  $this->__initQuestionObject((int) $_GET['objective_id']);
960 
961  if((int) $_POST['limit'] < 0 or (int) $_POST['limit'] > $this->objectives_qst_obj->getFinalTestPoints())
962  {
963  ilUtil::sendFailure(sprintf($this->lng->txt('crs_objective_err_limit'),0,$this->objectives_qst_obj->getFinalTestPoints()));
964  $this->finalTestLimits();
965  return false;
966  }
967 
968  foreach($this->objectives_qst_obj->getFinalTests() as $test)
969  {
970  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_FINAL_TEST);
971  $this->objectives_qst_obj->setTestSuggestedLimit((int) $_POST['limit']);
972  $this->objectives_qst_obj->updateTest($test['test_objective_id']);
973  }
974 
975  ilUtil::sendSuccess($this->lng->txt('crs_added_objective'));
976  $this->listObjectives();
977  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
finalTestLimits()
self assessment limits
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$test
Definition: Utf8Test.php:85
+ Here is the call graph for this function:

◆ updateMaterialAssignment()

ilCourseObjectivesGUI::updateMaterialAssignment ( )
protected

update material assignment

protected

Parameters

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

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

561  {
562  global $ilAccess,$ilErr,$ilObjDataCache;
563 
564  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
565  {
566  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
567  }
568  if(!$_GET['objective_id'])
569  {
570  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
571  $this->ctrl->redirect($this,'listObjectives');
572  }
573 
574  $this->__initLMObject((int) $_GET['objective_id']);
575  $this->objectives_lm_obj->deleteAll();
576 
577  if(is_array($_POST['materials']))
578  {
579  foreach($_POST['materials'] as $node_id)
580  {
581  $obj_id = $ilObjDataCache->lookupObjId($node_id);
582  $type = $ilObjDataCache->lookupType($obj_id);
583 
584  $this->objectives_lm_obj->setLMRefId($node_id);
585  $this->objectives_lm_obj->setLMObjId($obj_id);
586  $this->objectives_lm_obj->setType($type);
587  $this->objectives_lm_obj->add();
588  }
589  }
590  if(is_array($_POST['chapters']))
591  {
592  foreach($_POST['chapters'] as $chapter)
593  {
594  include_once('./Modules/LearningModule/classes/class.ilLMObject.php');
595 
596  list($ref_id,$chapter_id) = explode('_',$chapter);
597 
598  $this->objectives_lm_obj->setLMRefId($ref_id);
599  $this->objectives_lm_obj->setLMObjId($chapter_id);
600  $this->objectives_lm_obj->setType(ilLMObject::_lookupType($chapter_id));
601  $this->objectives_lm_obj->add();
602  }
603  }
604  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
605  $this->selfAssessmentAssignment();
606 
607  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
selfAssessmentAssignment()
self assessment assignemnt
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ updateSelfAssessmentAssignment()

ilCourseObjectivesGUI::updateSelfAssessmentAssignment ( )
protected

update self assessment assignment

protected

Parameters

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

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

656  {
657  global $ilAccess,$ilErr,$ilObjDataCache;
658 
659  $checked_questions = $_POST['questions'] ? $_POST['questions'] : array();
660 
661 
662  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
663  {
664  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
665  }
666  if(!$_GET['objective_id'])
667  {
668  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
669  $this->ctrl->redirect($this,'listObjectives');
670  }
671 
672  $this->__initQuestionObject((int) $_GET['objective_id']);
673 
674  // Delete unchecked
675  foreach($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question)
676  {
677  $id = $question['ref_id'].'_'.$question['question_id'];
678  if(!in_array($id,$checked_questions))
679  {
680  $this->objectives_qst_obj->delete($question['qst_ass_id']);
681  }
682  }
683  // Add checked
684  foreach($checked_questions as $question_id)
685  {
686  list($test_ref_id,$qst_id) = explode('_',$question_id);
687  $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
688 
689  if($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id))
690  {
691  continue;
692  }
693  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT);
694  $this->objectives_qst_obj->setTestRefId($test_ref_id);
695  $this->objectives_qst_obj->setTestObjId($test_obj_id);
696  $this->objectives_qst_obj->setQuestionId($qst_id);
697  $this->objectives_qst_obj->add();
698  }
699 
700  // TODO: not nice
701  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
702  $this->questions = new ilCourseObjectiveQuestion((int) $_GET['objective_id']);
703  $this->questions->updateLimits();
704 
705  if($checked_questions)
706  {
707  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
708  $this->selfAssessmentLimits();
709  return true;
710  }
711  else
712  {
713  switch($_SESSION['objective_mode'])
714  {
715  case self::MODE_CREATE:
716  $this->finalTestAssignment();
717  return true;
718 
719  case self::MODE_UPDATE:
720  $this->selfAssessmentAssignment();
721  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
722  return true;
723  }
724  }
725  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
selfAssessmentAssignment()
self assessment assignemnt
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
finalTestAssignment()
final test assignment
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
class ilcourseobjectiveQuestion
selfAssessmentLimits()
self assessment limits
+ Here is the call graph for this function:

◆ updateSelfAssessmentLimits()

ilCourseObjectivesGUI::updateSelfAssessmentLimits ( )
protected

update self assessment limits

protected

Parameters

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

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

767  {
768  global $ilAccess,$ilErr,$ilObjDataCache;
769 
770  if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
771  {
772  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
773  }
774  if(!$_GET['objective_id'])
775  {
776  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'),true);
777  $this->ctrl->redirect($this,'listObjectives');
778  }
779 
780  $this->__initQuestionObject((int) $_GET['objective_id']);
781 
782  if((int) $_POST['limit'] < 0 or (int) $_POST['limit'] > $this->objectives_qst_obj->getSelfAssessmentPoints())
783  {
784  ilUtil::sendFailure(sprintf($this->lng->txt('crs_objective_err_limit'),0,$this->objectives_qst_obj->getSelfAssessmentPoints()));
785  $this->selfAssessmentLimits();
786  return false;
787  }
788 
789  foreach($this->objectives_qst_obj->getSelfAssessmentTests() as $test)
790  {
791  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT);
792  $this->objectives_qst_obj->setTestSuggestedLimit((int) $_POST['limit']);
793  $this->objectives_qst_obj->updateTest($test['test_objective_id']);
794  }
795 
796  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
797  $this->finalTestAssignment();
798 
799  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
finalTestAssignment()
final test assignment
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
selfAssessmentLimits()
self assessment limits
$test
Definition: Utf8Test.php:85
+ Here is the call graph for this function:

Field Documentation

◆ $course_id

ilCourseObjectivesGUI::$course_id

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

◆ $course_obj

ilCourseObjectivesGUI::$course_obj

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

◆ $ctrl

ilCourseObjectivesGUI::$ctrl

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

◆ $ilErr

◆ $ilias

ilCourseObjectivesGUI::$ilias

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

Referenced by ilCourseObjectivesGUI().

◆ $lng

ilCourseObjectivesGUI::$lng

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

Referenced by ilCourseObjectivesGUI().

◆ $tpl

◆ MODE_CREATE

const ilCourseObjectivesGUI::MODE_CREATE = 1

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

◆ MODE_UNDEFINED

const ilCourseObjectivesGUI::MODE_UNDEFINED = 0

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

◆ MODE_UPDATE

const ilCourseObjectivesGUI::MODE_UPDATE = 2

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


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