ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCourseObjectivesGUI Class Reference

class ilobjcourseobjectivesgui More...

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

Public Member Functions

 __construct ($a_course_id)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 getSettings ()
 Get settings. More...
 
 askDeleteObjective ()
 
 deleteObjectives ()
 
 __initCourseObject ()
 
 __initObjectivesObject ($a_id=0)
 
 __initLMObject ($a_objective_id=0)
 
 __initQuestionObject ($a_objective_id=0)
 
 setSubTabs ($a_active="")
 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...
 
 isRandomTestType ($a_tst_type=0)
 
 showRandomTestAssignment (ilPropertyFormGUI $form=null)
 
 initFormRandom ()
 show random test More...
 
 saveRandom ()
 Save random test settings. More...
 
 updateFinalTestAssignment ()
 update self assessment assignment More...
 
 finalSeparatedTestAssignment (ilPropertyFormGUI $form=null)
 Show test assignment form. 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...
 

Protected Attributes

 $settings
 
 $test_type = 0
 

Private Attributes

 $logger = null
 

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 36 of file class.ilCourseObjectivesGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCourseObjectivesGUI::__construct (   $a_course_id)

Constructor.

Parameters
int$a_course_id

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

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

67  {
68  include_once './Modules/Course/classes/class.ilCourseObjective.php';
69 
70  global $DIC;
71 
72  $ilCtrl = $DIC['ilCtrl'];
73  $lng = $DIC['lng'];
74  $ilErr = $DIC['ilErr'];
75  $ilias = $DIC['ilias'];
76  $tpl = $DIC['tpl'];
77  $tree = $DIC['tree'];
78  $ilTabs = $DIC['ilTabs'];
79 
80  $this->ctrl = $ilCtrl;
81  $this->ctrl->saveParameter($this, array("ref_id"));
82 
83  $this->logger = $GLOBALS['DIC']->logger()->crs();
84  $this->ilErr = $ilErr;
85  $this->lng = $lng;
86  $this->lng->loadLanguageModule('crs');
87  $this->tpl = $tpl;
88  $this->tree = $tree;
89  $this->tabs_gui = $ilTabs;
90 
91  $this->course_id = $a_course_id;
92  $this->__initCourseObject();
93 
94  // begin-patch lok
95  $this->settings = ilLOSettings::getInstanceByObjId($this->course_obj->getId());
96  // end-patch lok
97  }
static getInstanceByObjId($a_obj_id)
get singleton instance
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

Member Function Documentation

◆ __initCourseObject()

ilCourseObjectivesGUI::__initCourseObject ( )

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

References exit, and ilObjectFactory\getInstanceByRefId().

Referenced by __construct().

405  {
406  if (!$this->course_obj = &ilObjectFactory::getInstanceByRefId($this->course_id, false)) {
407  $this->ilErr->raiseError("ilCourseObjectivesGUI: cannot create course object", $this->ilErr->MESSAGE);
408  exit;
409  }
410  return true;
411  }
exit
Definition: backend.php:16
static 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 418 of file class.ilCourseObjectivesGUI.php.

Referenced by updateMaterialAssignment().

419  {
420  include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
421  $this->objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
422 
423  return true;
424  }
class ilCourseObjectiveMaterials
+ Here is the caller graph for this function:

◆ __initObjectivesObject()

ilCourseObjectivesGUI::__initObjectivesObject (   $a_id = 0)

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

Referenced by askDeleteObjective(), and deleteObjectives().

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

◆ __initQuestionObject()

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

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

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

433  {
434  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
435  $this->objectives_qst_obj = new ilCourseObjectiveQuestion($a_objective_id);
436 
437  return $this->objectives_qst_obj;
438  }
class ilcourseobjectiveQuestion
+ Here is the caller graph for this function:

◆ askDeleteObjective()

ilCourseObjectivesGUI::askDeleteObjective ( )

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

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

198  {
199  global $DIC;
200 
201  $rbacsystem = $DIC['rbacsystem'];
202 
203  // MINIMUM ACCESS LEVEL = 'write'
204  if (!$rbacsystem->checkAccess("write", $this->course_obj->getRefId())) {
205  $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
206  }
207  if (!count($_POST['objective'])) {
208  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
209  $this->listObjectives();
210 
211  return true;
212  }
213 
214  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html", 'Modules/Course');
215 
216  ilUtil::sendQuestion($this->lng->txt('crs_delete_objectve_sure'));
217 
218  $tpl = new ilTemplate("tpl.table.html", true, true);
219  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_delete_row.html", 'Modules/Course');
220 
221  $counter = 0;
222  foreach ($_POST['objective'] as $objective_id) {
223  $objective_obj = $this->__initObjectivesObject($objective_id);
224 
225  $tpl->setCurrentBlock("tbl_content");
226  $tpl->setVariable("ROWCOL", ilUtil::switchColor(++$counter, "tblrow2", "tblrow1"));
227  $tpl->setVariable("TITLE", $objective_obj->getTitle());
228  $tpl->setVariable("DESCRIPTION", $objective_obj->getDescription());
229  $tpl->parseCurrentBlock();
230  }
231 
232  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
233 
234  // Show action row
235  $tpl->setCurrentBlock("tbl_action_btn");
236  $tpl->setVariable("BTN_NAME", 'deleteObjectives');
237  $tpl->setVariable("BTN_VALUE", $this->lng->txt('delete'));
238  $tpl->parseCurrentBlock();
239 
240  $tpl->setCurrentBlock("tbl_action_btn");
241  $tpl->setVariable("BTN_NAME", 'listObjectives');
242  $tpl->setVariable("BTN_VALUE", $this->lng->txt('cancel'));
243  $tpl->parseCurrentBlock();
244 
245  $tpl->setCurrentBlock("tbl_action_row");
246  $tpl->setVariable("COLUMN_COUNTS", 1);
247  $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.svg'));
248  $tpl->parseCurrentBlock();
249 
250 
251  // create table
252  $tbl = new ilTableGUI();
253  $tbl->setStyle('table', 'std');
254 
255  // title & header columns
256  $tbl->setTitle($this->lng->txt("crs_objectives"), "", $this->lng->txt("crs_objectives"));
257 
258  $tbl->setHeaderNames(array($this->lng->txt("title")));
259  $tbl->setHeaderVars(
260  array("title"),
261  array("ref_id" => $this->course_obj->getRefId(),
262  "cmdClass" => "ilcourseobjectivesgui",
263  "cmdNode" => $_GET["cmdNode"])
264  );
265  $tbl->setColumnWidth(array("50%"));
266 
267  $tbl->setLimit($_GET["limit"]);
268  $tbl->setOffset($_GET["offset"]);
269  $tbl->setMaxCount(count($_POST['objective']));
270 
271  // footer
272  $tbl->disable("footer");
273  $tbl->disable('sort');
274 
275  // render table
276  $tbl->setTemplate($tpl);
277  $tbl->render();
278 
279  $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get());
280 
281 
282  // Save marked objectives
283  $_SESSION['crs_delete_objectives'] = $_POST['objective'];
284 
285  return true;
286  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$tbl
Definition: example_048.php:81
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) ...
$_POST["username"]
+ Here is the call graph for this function:

◆ create()

ilCourseObjectivesGUI::create ( )

create objective

public

Parameters

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

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

Referenced by save().

495  {
496  global $DIC;
497 
498  $tpl = $DIC['tpl'];
499 
500  $this->setSubTabs("create_obj");
501 
502  $_SESSION['objective_mode'] = self::MODE_CREATE;
503 
504  $this->ctrl->saveParameter($this, 'objective_id');
505 
506  if (!is_object($this->objective)) {
507  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
508  }
509  $this->__initQuestionObject((int) $_GET['objective_id']);
510  $this->initWizard(1);
511 
512  $this->initFormTitle('create', 1);
513  $GLOBALS['DIC']['tpl']->setContent($this->form->getHtml());
514  #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
515  #$tpl->setContent($w_tpl->get());
516  }
initFormTitle($a_mode, $a_step_number)
init form title
$_SESSION["AccountId"]
initWizard($a_step_number)
init wizard
global $DIC
Definition: saml.php:7
$_GET["client_id"]
class ilcourseobjective
setSubTabs($a_active="")
set sub tabs
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteObjectives()

ilCourseObjectivesGUI::deleteObjectives ( )

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

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

289  {
290  global $DIC;
291 
292  $rbacsystem = $DIC['rbacsystem'];
293 
294  // MINIMUM ACCESS LEVEL = 'write'
295  if (!$rbacsystem->checkAccess("write", $this->course_obj->getRefId())) {
296  $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
297  }
298  if (!count($_SESSION['crs_delete_objectives'])) {
299  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
300  $this->listObjectives();
301 
302  return true;
303  }
304 
305  foreach ($_SESSION['crs_delete_objectives'] as $objective_id) {
306  $objective_obj = &$this->__initObjectivesObject($objective_id);
307  $objective_obj->delete();
308  }
309 
310  ilUtil::sendSuccess($this->lng->txt('crs_objectives_deleted'));
311  $this->listObjectives();
312 
313  return true;
314  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
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 524 of file class.ilCourseObjectivesGUI.php.

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

Referenced by save().

525  {
526  global $DIC;
527 
528  $tpl = $DIC['tpl'];
529 
530  $_SESSION['objective_mode'] = self::MODE_UPDATE;
531 
532  $this->setSubTabs("edit_obj");
533 
534  $this->ctrl->setParameter($this, 'objective_id', (int) $_REQUEST['objective_id']);
535 
536  if (!$_REQUEST['objective_id']) {
537  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
538  $this->ctrl->redirect($this, 'listObjectives');
539  }
540 
541  if (!is_object($this->objective)) {
542  $this->objective = new ilCourseObjective($this->course_obj, (int) $_REQUEST['objective_id']);
543  }
544 
545  $this->__initQuestionObject((int) $_REQUEST['objective_id']);
546  $this->initWizard(1);
547  $this->initFormTitle('create', 1);
548  $GLOBALS['DIC']['tpl']->setContent($this->form->getHtml());
549  #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
550  #$tpl->setContent($w_tpl->get());
551  }
initFormTitle($a_mode, $a_step_number)
init form title
$_SESSION["AccountId"]
initWizard($a_step_number)
init wizard
global $DIC
Definition: saml.php:7
class ilcourseobjective
setSubTabs($a_active="")
set sub tabs
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilCourseObjectivesGUI::executeCommand ( )

execute command

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

References $DIC.

103  {
104  global $DIC;
105 
106  $ilTabs = $DIC['ilTabs'];
107 
108  $ilTabs->setTabActive('crs_objectives');
109 
110  $cmd = $this->ctrl->getCmd();
111 
112 
113  if (!$cmd = $this->ctrl->getCmd()) {
114  $cmd = "list";
115  }
116 
117  $this->$cmd();
118  }
global $DIC
Definition: saml.php:7

◆ finalSeparatedTestAssignment()

ilCourseObjectivesGUI::finalSeparatedTestAssignment ( ilPropertyFormGUI  $form = null)
protected

Show test assignment form.

Parameters
ilPropertyFormGUI$form

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

References $_GET, $DIC, $form, $GLOBALS, $ilErr, initWizard(), and ilUtil\sendFailure().

1262  {
1263  global $DIC;
1264 
1265  $ilAccess = $DIC['ilAccess'];
1266  $ilErr = $DIC['ilErr'];
1267 
1268  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
1269  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
1270  }
1271  if (!$_GET['objective_id']) {
1272  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
1273  $this->ctrl->returnToParent($this);
1274  }
1275  $this->ctrl->saveParameter($this, 'objective_id');
1276  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
1277 
1278  $this->initWizard(6);
1279  $form = $this->initFormTestAssignment();
1280  $GLOBALS['DIC']['tpl']->setContent($form->getHtml());
1281  }
initWizard($a_step_number)
init wizard
global $DIC
Definition: saml.php:7
$_GET["client_id"]
class ilcourseobjective
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ finalTestAssignment()

ilCourseObjectivesGUI::finalTestAssignment ( )
protected

final test assignment

protected

Parameters

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

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

Referenced by updateMaterialAssignment(), and updateSelfAssessmentAssignment().

936  {
937  global $DIC;
938 
939  $ilAccess = $DIC['ilAccess'];
940  $ilErr = $DIC['ilErr'];
941  $tpl = $DIC['tpl'];
942 
943  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
944  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
945  }
946  if (!$_GET['objective_id']) {
947  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
948  $this->ctrl->redirect($this, 'listObjectives');
949  }
950 
951  $this->setSubTabs("final_test_assign");
952 
953  $this->ctrl->saveParameter($this, 'objective_id');
954  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
955 
956  // begin-patch lok
957  $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
958  $this->test_type = $_REQUEST['tt'] = ilLOSettings::TYPE_TEST_QUALIFIED;
960  return $this->showRandomTestAssignment();
961  }
962  // end-patch lok
963 
964  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
966  $this,
967  $this->course_obj,
968  (int) $_GET['objective_id'],
970  );
971 
972  $table->setTitle(
973  $this->lng->txt('crs_objective_wiz_final'),
974  '',
975  $this->lng->txt('crs_objective')
976  );
977  $table->parse(ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()));
978 
979  $this->__initQuestionObject((int) $_GET['objective_id']);
980  $this->initWizard(5);
981  $GLOBALS['DIC']['tpl']->setContent($table->getHTML());
982  #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
983  #$tpl->setContent($w_tpl->get());
984  }
initWizard($a_step_number)
init wizard
global $DIC
Definition: saml.php:7
$_GET["client_id"]
showRandomTestAssignment(ilPropertyFormGUI $form=null)
class ilcourseobjective
setSubTabs($a_active="")
set sub tabs
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(empty($password)) $table
Definition: pwgen.php:24
TableGUI for question assignments of course objectives.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
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 1290 of file class.ilCourseObjectivesGUI.php.

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

Referenced by updateFinalTestAssignment(), and updateFinalTestLimits().

1291  {
1292  global $DIC;
1293 
1294  $ilAccess = $DIC['ilAccess'];
1295  $ilErr = $DIC['ilErr'];
1296  $tpl = $DIC['tpl'];
1297 
1298  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
1299  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
1300  }
1301  if (!$_GET['objective_id']) {
1302  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
1303  $this->ctrl->returnToParent($this);
1304  }
1305 
1306  $this->setSubTabs("final_test_limits");
1307 
1308  $this->ctrl->saveParameter($this, 'objective_id');
1309  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
1310 
1311  $this->__initQuestionObject((int) $_GET['objective_id']);
1312  $this->initWizard(6);
1313 
1314  $this->initFormLimits('final');
1315  $GLOBALS['DIC']['tpl']->setContent($this->form->getHtml());
1316 
1317  #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
1318  #$tpl->setContent($w_tpl->get());
1319  }
initWizard($a_step_number)
init wizard
global $DIC
Definition: saml.php:7
$_GET["client_id"]
class ilcourseobjective
setSubTabs($a_active="")
set sub tabs
initFormLimits($a_mode)
init limit form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSettings()

ilCourseObjectivesGUI::getSettings ( )

Get settings.

Returns
ilLOSettings

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

References $settings.

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

+ Here is the caller graph for this function:

◆ initFormLimits()

ilCourseObjectivesGUI::initFormLimits (   $a_mode)
protected

init limit form

protected

Parameters
stringmode selfAssessment or final
Returns

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

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

Referenced by finalTestLimits(), and selfAssessmentLimits().

1374  {
1375  if (!is_object($this->form)) {
1376  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
1377  $this->form = new ilPropertyFormGUI();
1378  }
1379  $this->form->setFormAction($this->ctrl->getFormAction($this));
1380  $this->form->setTableWidth('100%');
1381  //$this->form->setTitleIcon(ilUtil::getImagePath('icon_lobj.svg'),$this->lng->txt('crs_objective'));
1382 
1383  switch ($a_mode) {
1384  case 'selfAssessment':
1385  $this->form->setTitle($this->lng->txt('crs_objective_wiz_self_limit'));
1386  $this->form->addCommandButton('updateSelfAssessmentLimits', $this->lng->txt('crs_wiz_next'));
1387  $this->form->addCommandButton('selfAssessmentAssignment', $this->lng->txt('crs_wiz_back'));
1388 
1389  $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
1390  $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
1391 
1392  break;
1393 
1394  case 'final':
1395  $this->form->setTitle($this->lng->txt('crs_objective_wiz_final_limit'));
1396  $this->form->addCommandButton('updateFinalTestLimits', $this->lng->txt('crs_wiz_next'));
1397  $this->form->addCommandButton('finalTestAssignment', $this->lng->txt('crs_wiz_back'));
1398 
1399  $tests = $this->objectives_qst_obj->getFinalTests();
1400  $max_points = $this->objectives_qst_obj->getFinalTestPoints();
1401 
1402  break;
1403  }
1404 
1405  $over = new ilCustomInputGUI($this->lng->txt('crs_objective_qst_summary'), '');
1406 
1407  $tpl = new ilTemplate('tpl.crs_objective_qst_summary.html', true, true, 'Modules/Course');
1408 
1409 
1410  $limit = 0;
1411 
1412  foreach ($tests as $test) {
1413  $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': ' . print_r($test, true));
1414 
1415  $limit = $test['limit'];
1416 
1417  foreach ($this->objectives_qst_obj->getQuestionsOfTest($test['obj_id']) as $question) {
1418  $tpl->setCurrentBlock('qst');
1419  $tpl->setVariable('QST_TITLE', $question['title']);
1420  if (strlen($question['description'])) {
1421  $tpl->setVariable('QST_DESCRIPTION', $question['description']);
1422  }
1423  $tpl->setVariable('QST_POINTS', $question['points'] . ' ' .
1424  $this->lng->txt('crs_objective_points'));
1425  $tpl->parseCurrentBlock();
1426  }
1427  $tpl->setCurrentBlock('tst');
1428  $tpl->setVariable('TST_TITLE', ilObject::_lookupTitle($test['obj_id']));
1429  if ($desc = ilObject::_lookupDescription($test['obj_id'])) {
1430  $tpl->setVariable('TST_DESC', $desc);
1431  }
1432  $tpl->setVariable('TST_TYPE_IMG', ilUtil::getTypeIconPath('tst', $test['obj_id'], 'tiny'));
1433  $tpl->setVariable('TST_ALT_IMG', $this->lng->txt('obj_tst'));
1434  $tpl->parseCurrentBlock();
1435  }
1436 
1437  $tpl->setVariable('TXT_ALL_POINTS', $this->lng->txt('crs_objective_all_points'));
1438  $tpl->setVariable('TXT_POINTS', $this->lng->txt('crs_objective_points'));
1439  $tpl->setVariable('POINTS', $max_points);
1440 
1441  $over->setHtml($tpl->get());
1442  $this->form->addItem($over);
1443 
1444  // points
1445  $req = new ilNumberInputGUI($this->lng->txt('crs_loc_perc'), 'limit');
1446  $req->setValue($limit);
1447  $req->setSize(3);
1448  $req->setMinValue(1);
1449  $req->setMaxValue(100);
1450  $req->setRequired(true);
1451  switch ($a_mode) {
1452  case 'selfAssessment':
1453  $req->setInfo($this->lng->txt('crs_obj_initial_req_info'));
1454  break;
1455 
1456  case 'final':
1457  $req->setInfo($this->lng->txt('crs_obj_final_req_info'));
1458  break;
1459  }
1460  $this->form->addItem($req);
1461  }
setHtml($a_html)
Set Html.
This class represents a property form user interface.
static _lookupTitle($a_id)
lookup object title
$req
Definition: getUserInfo.php:20
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 Depre...
This class represents a number property in a property form.
$tests
Definition: bench.php:104
static _lookupDescription($a_id)
lookup object description
special template class to simplify handling of ITX/PEAR
This class represents a custom property in a property form.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
$test
Definition: Utf8Test.php:84
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormRandom()

ilCourseObjectivesGUI::initFormRandom ( )
protected

show random test

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

References $form, $GLOBALS, $list, PHPMailer\PHPMailer\$options, $title, ilObject\_lookupObjId(), ilObjectFactory\getInstanceByRefId(), getSettings(), ilLORandomTestQuestionPools\lookupLimit(), ilLORandomTestQuestionPools\lookupSequencesByType(), ilFormPropertyGUI\setRequired(), ilNumberInputGUI\setValue(), and ilLOSettings\TYPE_TEST_INITIAL.

Referenced by saveRandom(), and showRandomTestAssignment().

1031  {
1032  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1033  $form = new ilPropertyFormGUI();
1034  $form->setFormAction($this->ctrl->getFormAction($this));
1035 
1036  if ($this->test_type == ilLOSettings::TYPE_TEST_INITIAL) {
1037  $form->setTitle($this->lng->txt('crs_loc_form_random_limits_it'));
1038  } else {
1039  $form->setTitle($this->lng->txt('crs_loc_form_random_limits_qt'));
1040  }
1041 
1042  $form->addCommandButton('saveRandom', $this->lng->txt('save'));
1043 
1044  $options = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_rand_assign_qpl'), 'type');
1045  $options->setValue(1);
1046  $options->setRequired(true);
1047 
1048  $ass_qpl = new ilRadioOption($this->lng->txt('crs_loc_rand_assign_qpl'), 1);
1049  $options->addOption($ass_qpl);
1050 
1051  $qpl = new ilSelectInputGUI($this->lng->txt('crs_loc_rand_qpl'), 'qpl');
1052  $qpl->setRequired(true);
1053  $qpl->setMulti(true, false);
1054  $qpl->setOptions($this->getRandomTestQplOptions());
1055 
1057  $this->course_obj->getId(),
1058  (int) $_REQUEST['objective_id'],
1059  ilObject::_lookupObjId($this->getSettings()->getTestByType($this->test_type)),
1060  $this->test_type
1061  );
1062 
1063  $qpl->setValue($sequences[0]);
1064  $qpl->setMultiValues($sequences);
1065  $ass_qpl->addSubItem($qpl);
1066 
1067  // points
1068  $per = new ilNumberInputGUI($this->lng->txt('crs_loc_perc'), 'per');
1069  $per->setValue(
1071  $this->course_obj->getId(),
1072  (int) $_REQUEST['objective_id'],
1073  $this->test_type
1074  )
1075  );
1076  $per->setSize(3);
1077  $per->setMinValue(1);
1078  $per->setMaxValue(100);
1079  $per->setRequired(true);
1080  $ass_qpl->addSubItem($per);
1081 
1082  $form->addItem($options);
1083  return $form;
1084  }
This class represents an option in a radio group.
setValue($a_value)
Set Value.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
This class represents a number property in a property form.
static _lookupObjId($a_id)
static lookupSequencesByType($a_container_id, $a_objective_id, $a_test_id, $a_test_type)
Lookup sequence ids type $ilDB.
static lookupLimit($a_container_id, $a_objective_id, $a_test_type)
lookup limit type $ilDB
setRequired($a_required)
Set Required.
+ 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 1470 of file class.ilCourseObjectivesGUI.php.

References $title, and ilTextAreaInputGUI\setValue().

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

1471  {
1472  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
1473  if ($this->form instanceof ilPropertyFormGUI) {
1474  return;
1475  }
1476 
1477  $this->form = new ilPropertyFormGUI();
1478  $this->form->setFormAction($this->ctrl->getFormAction($this));
1479  //$this->form->setTitleIcon(ilUtil::getImagePath('icon_lobj.svg'),$this->lng->txt('crs_objective'));
1480 
1481  switch ($a_mode) {
1482  case 'create':
1483  $this->form->setTitle($this->lng->txt('crs_objective_wiz_title'));
1484  $this->form->addCommandButton('save', $this->lng->txt('crs_wiz_next'));
1485  // begin-patch lok
1486  #$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel'));
1487  // end-patch lok
1488  break;
1489 
1490  case 'update':
1491  break;
1492  }
1493 
1494  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
1495  $title->setValue($this->objective->getTitle());
1496  $title->setRequired(true);
1497  $title->setSize(40);
1498  $title->setMaxLength(70);
1499  $this->form->addItem($title);
1500 
1501  $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
1502  $desc->setValue($this->objective->getDescription());
1503  $desc->setCols(40);
1504  $desc->setRows(5);
1505  $this->form->addItem($desc);
1506  }
This class represents a property form user interface.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
This class represents a text area property in a property form.
+ 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 1516 of file class.ilCourseObjectivesGUI.php.

References $_SESSION, $GLOBALS, $info, $links, PHPMailer\PHPMailer\$options, $step, $title, getSettings(), isRandomTestType(), ilChecklistGUI\STATUS_NO_STATUS, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

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

1517  {
1518  $options = array(
1519  1 => $this->lng->txt('crs_objective_wiz_title'),
1520  2 => $this->lng->txt('crs_objective_wiz_materials'),
1521  3 => $this->lng->txt('crs_objective_wiz_self'),
1522  4 => $this->lng->txt('crs_objective_wiz_self_limit'),
1523  5 => $this->lng->txt('crs_objective_wiz_final'),
1524  6 => $this->lng->txt('crs_objective_wiz_final_limit'));
1525 
1526  $info = array(
1527  1 => $this->lng->txt('crs_objective_wiz_title_info'),
1528  2 => $this->lng->txt('crs_objective_wiz_materials_info'),
1529  3 => $this->lng->txt('crs_objective_wiz_self_info'),
1530  4 => $this->lng->txt('crs_objective_wiz_self_limit_info'),
1531  5 => $this->lng->txt('crs_objective_wiz_final_info'),
1532  6 => $this->lng->txt('crs_objective_wiz_final_limit_info'));
1533 
1534  $links = array(
1535  1 => $this->ctrl->getLinkTarget($this, 'edit'),
1536  2 => $this->ctrl->getLinkTarget($this, 'materialAssignment'),
1537  3 => $this->ctrl->getLinkTarget($this, 'selfAssessmentAssignment'),
1538  4 => $this->ctrl->getLinkTarget($this, 'selfAssessmentLimits'),
1539  5 => $this->ctrl->getLinkTarget($this, 'finalTestAssignment'),
1540  6 => $this->ctrl->getLinkTarget($this, 'finalTestLimits'));
1541 
1542 
1543 
1544 
1545  // checklist gui start
1546  include_once("./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
1547  $check_list = new ilChecklistGUI();
1548  // checklist gui end
1549 
1550  if ($_SESSION['objective_mode'] == self::MODE_CREATE) {
1551  // checklist gui start
1552  $check_list->setHeading($this->lng->txt('crs_checklist_objective'));
1553  // checklist gui end
1554  } else {
1555  // checklist gui start
1556  $check_list->setHeading($this->lng->txt('crs_checklist_objective'));
1557  // checklist gui end
1558  }
1559 
1560  // end-patch lok
1561  $num = 0;
1562  foreach ($options as $step => $title) {
1563  // checklist gui start
1564  $item_link = "";
1565  // checklist gui end
1566 
1567  // begin-patch lok
1568  if ($step == 3 and (!$this->getSettings()->worksWithInitialTest() or $this->getSettings()->hasSeparateInitialTests())) {
1569  continue;
1570  }
1571  if ($step == 4 and (!$this->getSettings()->worksWithInitialTest() or $this->getSettings()->hasSeparateInitialTests())) {
1572  continue;
1573  }
1574  if ($step == 5 and $this->getSettings()->hasSeparateQualifiedTests()) {
1575  continue;
1576  }
1577  if ($step == 6 and $this->getSettings()->hasSeparateQualifiedTests()) {
1578  continue;
1579  }
1581  continue;
1582  }
1584  continue;
1585  }
1586  $num++;
1587  // end-patch lok
1588 
1589  if ($_SESSION['objective_mode'] == self::MODE_UPDATE) {
1590  $hide_link = false;
1591  if ($step == 4 and !count($this->objectives_qst_obj->getSelfAssessmentQuestions())) {
1592  $hide_link = true;
1593  }
1594  if ($step == 6 and !count($this->objectives_qst_obj->getFinalTestQuestions())) {
1595  $hide_link = true;
1596  }
1597  // begin-patch lok
1598  if ($step == 3 and !$this->getSettings()->worksWithInitialTest()) {
1599  $hide_link = true;
1600  }
1601  if ($step == 4 and !$this->getSettings()->worksWithInitialTest()) {
1602  $hide_link = true;
1603  }
1604  if (!$hide_link) {
1605  // checklist gui start
1606  $item_link = $links[$step];
1607  // checklist gui end
1608  }
1609  }
1610 
1611  // checklist gui start
1612  $check_list->addEntry($title, $item_link, ilChecklistGUI::STATUS_NO_STATUS, ($step == $a_step_number));
1613  // checklist gui end
1614  }
1615 
1616  // checklist gui start
1617  $GLOBALS['DIC']["tpl"]->setRightContent($check_list->getHTML());
1618  // checklist gui end
1619  }
$_SESSION["AccountId"]
foreach( $_REQUEST as $var) foreach(array('_POST'=> 'HTTP_POST_VARS', '_GET'=> 'HTTP_GET_VARS', '_COOKIE'=> 'HTTP_COOKIE_VARS', '_SERVER'=> 'HTTP_SERVER_VARS', '_ENV'=> 'HTTP_ENV_VARS', '_FILES'=> 'HTTP_POST_FILES') as $array=> $other) $step
Definition: cssgen.php:155
$links
$info
Definition: index.php:5
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRandomTestType()

ilCourseObjectivesGUI::isRandomTestType (   $a_tst_type = 0)
protected

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

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

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

988  {
989  if (!$a_tst_type) {
990  $a_tst_type = $this->test_type;
991  }
992 
993  $tst_ref_id = $this->getSettings()->getTestByType($a_tst_type);
994  if (!$tst_ref_id) {
995  return false;
996  }
997  include_once './Modules/Test/classes/class.ilObjTest.php';
999  }
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not...
static _lookupObjId($a_id)
+ 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 139 of file class.ilCourseObjectivesGUI.php.

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

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

140  {
141  global $DIC;
142 
143  $ilAccess = $DIC['ilAccess'];
144  $ilErr = $DIC['ilErr'];
145  $ilObjDataCache = $DIC['ilObjDataCache'];
146  $ilToolbar = $DIC['ilToolbar'];
147 
148  $_SESSION['objective_mode'] = self::MODE_UNDEFINED;
149  if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
150  $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
151  }
152 
153  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.crs_objectives.html', 'Modules/Course');
154 
155  $ilToolbar->addButton(
156  $this->lng->txt('crs_add_objective'),
157  $this->ctrl->getLinkTarget($this, "'create")
158  );
159 
160  include_once('./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
161  $table = new ilCourseObjectivesTableGUI($this, $this->course_obj);
162  $table->setTitle($this->lng->txt('crs_objectives'), '', $this->lng->txt('crs_objectives'));
163  $table->parse(ilCourseObjective::_getObjectiveIds($this->course_obj->getId(), false));
164 
165  $this->tpl->setVariable('OBJECTIVES_TABLE', $table->getHTML());
166  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
static _getObjectiveIds($course_id, $a_activated_only=false)
if(empty($password)) $table
Definition: pwgen.php:24
+ 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 612 of file class.ilCourseObjectivesGUI.php.

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

613  {
614  global $DIC;
615 
616  $ilAccess = $DIC['ilAccess'];
617  $ilErr = $DIC['ilErr'];
618  $tpl = $DIC['tpl'];
619 
620  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
621  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
622  }
623  if (!$_GET['objective_id']) {
624  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
625  $this->ctrl->redirect($this, 'listObjectives');
626  }
627 
628  $this->setSubTabs("materials");
629 
630  $this->ctrl->saveParameter($this, 'objective_id');
631 
632  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
633 
634  include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
635  $table = new ilCourseObjectiveMaterialAssignmentTableGUI($this, $this->course_obj, (int) $_GET['objective_id']);
636  $table->setTitle(
637  $this->lng->txt('crs_objective_wiz_materials'),
638  '',
639  $this->lng->txt('crs_objectives')
640  );
641 
642  include_once('Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
643  $table->parse(ilCourseObjectiveMaterials::_getAssignableMaterials($this->course_obj->getRefId()));
644 
645  $this->__initQuestionObject((int) $_GET['objective_id']);
646  $this->initWizard(2);
647  #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
648  $GLOBALS['DIC']['tpl']->setContent($table->getHTML());
649  #$tpl->setContent($w_tpl->get());
650  }
initWizard($a_step_number)
init wizard
global $DIC
Definition: saml.php:7
$_GET["client_id"]
TableGUI for material assignments of course objectives.
class ilcourseobjective
setSubTabs($a_active="")
set sub tabs
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...
if(empty($password)) $table
Definition: pwgen.php:24
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ questionOverview()

ilCourseObjectivesGUI::questionOverview ( )
protected

question overiew

protected

Returns

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

References $DIC, $ilErr, $table, and ilCourseObjective\_getObjectiveIds().

Referenced by saveQuestionOverview().

323  {
324  global $DIC;
325 
326  $ilAccess = $DIC['ilAccess'];
327  $ilErr = $DIC['ilErr'];
328  $ilTabs = $DIC['ilTabs'];
329 
330  $ilTabs->setSubTabActive('crs_objective_overview_question_assignment');
331 
332  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
333  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
334  }
335 
336  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
337  $table = new ilCourseObjectiveQuestionsTableGUI($this, $this->course_obj);
338  $table->setTitle($this->lng->txt('crs_objectives_edit_question_assignments'), '', $this->lng->txt('crs_objectives'));
339  // begin-patch lok
340  $table->parse(ilCourseObjective::_getObjectiveIds($this->course_obj->getId(), false));
341  // end-patch lok
342 
343  $this->tpl->setContent($table->getHTML());
344  }
global $DIC
Definition: saml.php:7
static _getObjectiveIds($course_id, $a_activated_only=false)
if(empty($password)) $table
Definition: pwgen.php:24
+ 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 559 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_SESSION, $DIC, $ilErr, create(), edit(), and initFormTitle().

560  {
561  global $DIC;
562 
563  $ilAccess = $DIC['ilAccess'];
564  $ilErr = $DIC['ilErr'];
565 
566  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
567  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
568  }
569 
570  $this->ctrl->saveParameter($this, 'objective_id');
571 
572  $this->objective = new ilCourseObjective($this->course_obj, (int) $_REQUEST['objective_id']);
573  $this->initFormTitle('create', 1);
574  if ($this->form->checkInput()) {
575  $this->objective->setTitle($this->form->getInput('title'));
576  $this->objective->setDescription($this->form->getInput('description'));
577  $this->objective->setPasses(0);
578 
579  if (!$_GET['objective_id']) {
580  $objective_id = $this->objective->add();
581  ilUtil::sendSuccess($this->lng->txt('crs_added_objective'), true);
582  } else {
583  $this->objective->update();
584  ilUtil::sendSuccess($this->lng->txt('crs_objective_modified'), true);
585  $objective_id = $_GET['objective_id'];
586  }
587  } else {
588  if ((int) $_GET['objective_id']) {
589  $this->form->setValuesByPost();
590  return $this->edit();
591  } else {
592  $this->form->setValuesByPost();
593  return $this->create();
594  }
595  }
596 
597  if ($_SESSION['objective_mode'] != self::MODE_CREATE) {
598  $this->ctrl->returnToParent($this);
599  }
600 
601  $this->ctrl->setParameter($this, 'objective_id', $objective_id);
602  $this->ctrl->redirect($this, 'materialAssignment');
603  return true;
604  }
initFormTitle($a_mode, $a_step_number)
init form title
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
class ilcourseobjective
+ Here is the call graph for this function:

◆ saveQuestionOverview()

ilCourseObjectivesGUI::saveQuestionOverview ( )
protected

update question overview

protected

Returns

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

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

353  {
354  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
355 
356  global $DIC;
357 
358  $ilAccess = $DIC['ilAccess'];
359  $ilErr = $DIC['ilErr'];
360 
361  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
362  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
363  }
364  $error = false;
365 
366  $_POST['self'] = $_POST['self'] ? $_POST['self'] : array();
367  $_POST['final'] = $_POST['final'] ? $_POST['final'] : array();
368 
369  foreach ($_POST['self'] as $objective_id => $limit) {
370  $qst = new ilCourseObjectiveQuestion($objective_id);
371  $max_points = $qst->getSelfAssessmentPoints();
372 
373  if ($limit < 0 or $limit > $max_points) {
374  ilUtil::sendFailure($this->lng->txt('crs_objective_limit_err'));
375  $this->questionOverview();
376  return false;
377  }
378  }
379  foreach ($_POST['final'] as $objective_id => $limit) {
380  $qst = new ilCourseObjectiveQuestion($objective_id);
381  $max_points = $qst->getFinalTestPoints();
382 
383  if ($limit < 0 or $limit > $max_points) {
384  ilUtil::sendFailure($this->lng->txt('crs_objective_limit_err'));
385  $this->questionOverview();
386  return false;
387  }
388  }
389 
390  foreach ($_POST['self'] as $objective_id => $limit) {
392  }
393 
394  foreach ($_POST['final'] as $objective_id => $limit) {
396  }
397 
398  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
399  $this->questionOverview();
400  return true;
401  }
global $DIC
Definition: saml.php:7
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
$_POST["username"]
+ Here is the call graph for this function:

◆ saveRandom()

ilCourseObjectivesGUI::saveRandom ( )
protected

Save random test settings.

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

References $_GET, $form, __initQuestionObject(), ilObject\_lookupObjId(), ilLORandomTestQuestionPools\deleteForObjectiveAndTestType(), getSettings(), initFormRandom(), ilUtil\sendFailure(), showRandomTestAssignment(), ilCourseObjectiveQuestion\TYPE_FINAL_TEST, ilCourseObjectiveQuestion\TYPE_SELF_ASSESSMENT, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

1145  {
1146  $this->ctrl->saveParameter($this, 'objective_id');
1147  $this->ctrl->setParameter($this, 'tt', (int) $_REQUEST['tt']);
1148  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
1149  $this->test_type = (int) $_REQUEST['tt'];
1150 
1151  $form = $this->initFormRandom();
1152 
1153 
1154 
1155 
1156  if ($form->checkInput()) {
1158  $this->course_obj->getId(),
1159  (int) $_REQUEST['objective_id'],
1160  $this->test_type
1161  );
1162 
1163  $qst = $this->__initQuestionObject((int) $_GET['objective_id']);
1164  $qst->deleteByTestType(
1165  ($this->test_type == ilLOSettings::TYPE_TEST_INITIAL) ?
1168  );
1169  $ref_id = $this->getSettings()->getTestByType($this->test_type);
1170  foreach (array_unique((array) $form->getInput('qpl')) as $qpl_id) {
1171  include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
1172  $rnd = new ilLORandomTestQuestionPools(
1173  $this->course_obj->getId(),
1174  (int) $_REQUEST['objective_id'],
1175  $this->test_type,
1176  $qpl_id
1177  );
1178  $rnd->setLimit($form->getInput('per'));
1179  $rnd->setTestId(ilObject::_lookupObjId($ref_id));
1180  $rnd->create();
1181  }
1182  } else {
1183  $form->setValuesByPost();
1184  ilUtil::sendFailure($this->lng->txt('err_check_input'));
1185  return $this->showRandomTestAssignment();
1186  }
1187 
1188  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1189  if ($this->test_type == ilLOSettings::TYPE_TEST_QUALIFIED) {
1190  $this->ctrl->returnToParent($this);
1191  } else {
1192  $this->ctrl->redirect($this, 'finalTestAssignment');
1193  }
1194  }
$_GET["client_id"]
static deleteForObjectiveAndTestType($a_course_id, $a_objective_id, $a_tst_type)
Delete assignment for objective id and test type.
showRandomTestAssignment(ilPropertyFormGUI $form=null)
if(isset($_POST['submit'])) $form
class ilcourseobjective
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ saveSorting()

ilCourseObjectivesGUI::saveSorting ( )
protected

save position

protected

Returns

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

References $_POST, $DIC, $ilErr, and listObjectives().

175  {
176  global $DIC;
177 
178  $ilAccess = $DIC['ilAccess'];
179  $ilErr = $DIC['ilErr'];
180  $ilObjDataCache = $DIC['ilObjDataCache'];
181 
182  if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
183  $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
184  }
185 
186  asort($_POST['position'], SORT_NUMERIC);
187 
188  $counter = 1;
189  foreach ($_POST['position'] as $objective_id => $position) {
190  $objective = new ilCourseObjective($this->course_obj, $objective_id);
191  $objective->writePosition($counter++);
192  }
193  ilUtil::sendSuccess($this->lng->txt('crs_objective_saved_sorting'));
194  $this->listObjectives();
195  }
global $DIC
Definition: saml.php:7
class ilcourseobjective
$_POST["username"]
+ Here is the call graph for this function:

◆ selfAssessmentAssignment()

ilCourseObjectivesGUI::selfAssessmentAssignment ( )
protected

self assessment assignemnt

protected

Returns

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

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

Referenced by updateMaterialAssignment(), and updateSelfAssessmentAssignment().

725  {
726  global $DIC;
727 
728  $ilAccess = $DIC['ilAccess'];
729  $ilErr = $DIC['ilErr'];
730  $tpl = $DIC['tpl'];
731 
732  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
733  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
734  }
735  if (!$_GET['objective_id']) {
736  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
737  $this->ctrl->redirect($this, 'listObjectives');
738  }
739 
740  $this->setSubTabs("self_ass_assign");
741 
742  $this->ctrl->saveParameter($this, 'objective_id');
743 
744  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
745 
746  // begin-patch lok
747  $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_INITIAL);
748  $this->test_type = $_REQUEST['tt'] = ilLOSettings::TYPE_TEST_INITIAL;
750  return $this->showRandomTestAssignment();
751  }
752  // end-patch lok
753 
754  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
756  $this,
757  $this->course_obj,
758  (int) $_GET['objective_id'],
760  );
761  $table->setTitle(
762  $this->lng->txt('crs_objective_wiz_self'),
763  '',
764  $this->lng->txt('crs_objective')
765  );
766  $table->parse(ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()));
767 
768  $this->__initQuestionObject((int) $_GET['objective_id']);
769  $this->initWizard(3);
770  $GLOBALS['DIC']['tpl']->setContent($table->getHTML());
771  #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML());
772  #$tpl->setContent($w_tpl->get());
773  }
initWizard($a_step_number)
init wizard
global $DIC
Definition: saml.php:7
$_GET["client_id"]
showRandomTestAssignment(ilPropertyFormGUI $form=null)
class ilcourseobjective
setSubTabs($a_active="")
set sub tabs
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(empty($password)) $table
Definition: pwgen.php:24
TableGUI for question assignments of course objectives.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
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 856 of file class.ilCourseObjectivesGUI.php.

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

Referenced by updateSelfAssessmentAssignment(), and updateSelfAssessmentLimits().

857  {
858  global $DIC;
859 
860  $ilAccess = $DIC['ilAccess'];
861  $ilErr = $DIC['ilErr'];
862  $tpl = $DIC['tpl'];
863 
864  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
865  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
866  }
867  if (!$_GET['objective_id']) {
868  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
869  $this->ctrl->redirect($this, 'listObjectives');
870  }
871 
872  $this->setSubTabs("self_ass_limits");
873 
874  $this->ctrl->saveParameter($this, 'objective_id');
875  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
876 
877  $this->__initQuestionObject((int) $_GET['objective_id']);
878  $this->initWizard(4);
879 
880  $this->initFormLimits('selfAssessment');
881  $GLOBALS['DIC']['tpl']->setContent($this->form->getHtml());
882  #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
883  #$tpl->setContent($w_tpl->get());
884  }
initWizard($a_step_number)
init wizard
global $DIC
Definition: saml.php:7
$_GET["client_id"]
class ilcourseobjective
setSubTabs($a_active="")
set sub tabs
initFormLimits($a_mode)
init limit form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubTabs()

ilCourseObjectivesGUI::setSubTabs (   $a_active = "")

set sub tabs

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

References $DIC, and ilCourseObjectiveQuestion\_hasTests().

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

445  {
446  global $DIC;
447 
448  $ilTabs = $DIC['ilTabs'];
449  $ilHelp = $DIC['ilHelp'];
450 
451  if ($a_active != "") {
452  $ilHelp->setScreenIdComponent("crs");
453  $ilHelp->setScreenId("crs_objective");
454  $ilHelp->setSubScreenId($a_active);
455  }
456 
457 
458  // begin-patch lok
459  // no subtabs here
460  return true;
461  // end-patch lok
462 
463 
464  $ilTabs->addSubTabTarget(
465  "crs_objective_overview_objectives",
466  $this->ctrl->getLinkTarget($this, "listObjectives"),
467  array("listObjectives", "moveObjectiveUp", "moveObjectiveDown", "listAssignedLM"),
468  array(),
469  '',
470  true
471  );
472  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
473 
474  if (ilCourseObjectiveQuestion::_hasTests($this->course_obj->getId())) {
475  $ilTabs->addSubTabTarget(
476  "crs_objective_overview_question_assignment",
477  $this->ctrl->getLinkTarget($this, "questionOverview"),
478  "editQuestionAssignment",
479  array(),
480  '',
481  false
482  );
483  }
484  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRandomTestAssignment()

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

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

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

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

1006  {
1007  $this->ctrl->saveParameter($this, 'objective_id');
1008  $this->ctrl->setParameter($this, 'tt', (int) $_REQUEST['tt']);
1009  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
1010  $this->test_type = (int) $_REQUEST['tt'];
1011 
1012 
1013  $this->setSubTabs("rand_test_assign");
1014 
1015  if (!$form instanceof ilPropertyFormGUI) {
1016  $form = $this->initFormRandom();
1017  }
1018 
1019  $this->__initQuestionObject((int) $_GET['objective_id']);
1020  $this->initWizard(5);
1021  $GLOBALS['DIC']['tpl']->setContent($form->getHTML());
1022  #$w_tpl->setVariable('WIZ_CONTENT',$form->getHTML());
1023 
1024  #$GLOBALS['DIC']['tpl']->setContent($w_tpl->get());
1025  }
This class represents a property form user interface.
initWizard($a_step_number)
init wizard
$_GET["client_id"]
class ilcourseobjective
setSubTabs($a_active="")
set sub tabs
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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 1203 of file class.ilCourseObjectivesGUI.php.

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

1204  {
1205  global $DIC;
1206 
1207  $ilAccess = $DIC['ilAccess'];
1208  $ilErr = $DIC['ilErr'];
1209  $ilObjDataCache = $DIC['ilObjDataCache'];
1210 
1211  $checked_questions = $_POST['questions'] ? $_POST['questions'] : array();
1212 
1213 
1214  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
1215  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
1216  }
1217  if (!$_GET['objective_id']) {
1218  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
1219  $this->ctrl->redirect($this, 'listObjectives');
1220  }
1221 
1222  $this->__initQuestionObject((int) $_GET['objective_id']);
1223 
1224  // Delete unchecked
1225  foreach ($this->objectives_qst_obj->getFinalTestQuestions() as $question) {
1226  $id = $question['ref_id'] . '_' . $question['question_id'];
1227  if (!in_array($id, $checked_questions)) {
1228  $this->objectives_qst_obj->delete($question['qst_ass_id']);
1229  }
1230  }
1231  // Add checked
1232  foreach ($checked_questions as $question_id) {
1233  list($test_ref_id, $qst_id) = explode('_', $question_id);
1234  $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
1235 
1236  if ($this->objectives_qst_obj->isFinalTestQuestion($qst_id)) {
1237  continue;
1238  }
1239 
1240  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_FINAL_TEST);
1241  $this->objectives_qst_obj->setTestRefId($test_ref_id);
1242  $this->objectives_qst_obj->setTestObjId($test_obj_id);
1243  $this->objectives_qst_obj->setQuestionId($qst_id);
1244  $this->objectives_qst_obj->add();
1245  }
1246 
1247  // TODO: not nice
1248  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
1249  $this->questions = new ilCourseObjectiveQuestion((int) $_GET['objective_id']);
1250  // not required due to percentages
1251  //$this->questions->updateLimits();
1252 
1253  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
1254  $this->finalTestLimits();
1255  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
if(!array_key_exists('StateId', $_REQUEST)) $id
finalTestLimits()
self assessment limits
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
class ilcourseobjectiveQuestion
$_POST["username"]
+ Here is the call graph for this function:

◆ updateFinalTestLimits()

ilCourseObjectivesGUI::updateFinalTestLimits ( )
protected

update self assessment limits

protected

Parameters

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

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

1329  {
1330  global $DIC;
1331 
1332  $ilAccess = $DIC['ilAccess'];
1333  $ilErr = $DIC['ilErr'];
1334  $ilObjDataCache = $DIC['ilObjDataCache'];
1335 
1336  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
1337  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
1338  }
1339  if (!$_GET['objective_id']) {
1340  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
1341  $this->ctrl->redirect($this, 'listObjectives');
1342  }
1343 
1344  $this->__initQuestionObject((int) $_GET['objective_id']);
1345 
1346  if ((int) $_POST['limit'] < 1 or (int) $_POST['limit'] > 100) {
1347  ilUtil::sendFailure($this->lng->txt('crs_objective_err_limit'));
1348  $this->finalTestLimits();
1349  return false;
1350  }
1351 
1352  foreach ($this->objectives_qst_obj->getFinalTests() as $test) {
1353  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_FINAL_TEST);
1354  $this->objectives_qst_obj->setTestSuggestedLimit((int) $_POST['limit']);
1355  $this->objectives_qst_obj->updateTest($test['test_objective_id']);
1356  }
1357 
1358  if ($_SESSION['objective_mode'] != self::MODE_CREATE) {
1359  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1360  } else {
1361  ilUtil::sendSuccess($this->lng->txt('crs_added_objective'), true);
1362  }
1363  $this->ctrl->returnToParent($this);
1364  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
finalTestLimits()
self assessment limits
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
$test
Definition: Utf8Test.php:84
+ Here is the call graph for this function:

◆ updateMaterialAssignment()

ilCourseObjectivesGUI::updateMaterialAssignment ( )
protected

update material assignment

protected

Parameters

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

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

660  {
661  global $DIC;
662 
663  $ilAccess = $DIC['ilAccess'];
664  $ilErr = $DIC['ilErr'];
665  $ilObjDataCache = $DIC['ilObjDataCache'];
666 
667  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
668  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
669  }
670  if (!$_GET['objective_id']) {
671  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
672  $this->ctrl->redirect($this, 'listObjectives');
673  }
674 
675  $this->__initLMObject((int) $_GET['objective_id']);
676  $this->objectives_lm_obj->deleteAll();
677 
678  if (is_array($_POST['materials'])) {
679  foreach ($_POST['materials'] as $node_id) {
680  $obj_id = $ilObjDataCache->lookupObjId($node_id);
681  $type = $ilObjDataCache->lookupType($obj_id);
682 
683  $this->objectives_lm_obj->setLMRefId($node_id);
684  $this->objectives_lm_obj->setLMObjId($obj_id);
685  $this->objectives_lm_obj->setType($type);
686  $this->objectives_lm_obj->add();
687  }
688  }
689  if (is_array($_POST['chapters'])) {
690  foreach ($_POST['chapters'] as $chapter) {
691  include_once('./Modules/LearningModule/classes/class.ilLMObject.php');
692 
693  list($ref_id, $chapter_id) = explode('_', $chapter);
694 
695  $this->objectives_lm_obj->setLMRefId($ref_id);
696  $this->objectives_lm_obj->setLMObjId($chapter_id);
697  $this->objectives_lm_obj->setType(ilLMObject::_lookupType($chapter_id));
698  $this->objectives_lm_obj->add();
699  }
700  }
701  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
702 
703 
704  if ($_SESSION['objective_mode'] != self::MODE_CREATE) {
705  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'), true);
706  $this->ctrl->returnToParent($this);
707  }
708 
709  // begin-patch lok
710  if ($this->getSettings()->worksWithInitialTest()) {
711  $this->selfAssessmentAssignment();
712  } else {
713  $this->finalTestAssignment();
714  }
715  // end-patch lok
716  }
selfAssessmentAssignment()
self assessment assignemnt
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
$_SESSION["AccountId"]
$type
global $DIC
Definition: saml.php:7
$_GET["client_id"]
finalTestAssignment()
final test assignment
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ updateSelfAssessmentAssignment()

ilCourseObjectivesGUI::updateSelfAssessmentAssignment ( )
protected

update self assessment assignment

protected

Parameters

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

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

783  {
784  global $DIC;
785 
786  $ilAccess = $DIC['ilAccess'];
787  $ilErr = $DIC['ilErr'];
788  $ilObjDataCache = $DIC['ilObjDataCache'];
789 
790  $checked_questions = $_POST['questions'] ? $_POST['questions'] : array();
791 
792 
793  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
794  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
795  }
796  if (!$_GET['objective_id']) {
797  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
798  $this->ctrl->redirect($this, 'listObjectives');
799  }
800 
801  $this->__initQuestionObject((int) $_GET['objective_id']);
802 
803  // Delete unchecked
804  foreach ($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question) {
805  $id = $question['ref_id'] . '_' . $question['question_id'];
806  if (!in_array($id, $checked_questions)) {
807  $this->objectives_qst_obj->delete($question['qst_ass_id']);
808  }
809  }
810  // Add checked
811  foreach ($checked_questions as $question_id) {
812  list($test_ref_id, $qst_id) = explode('_', $question_id);
813  $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
814 
815  if ($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id)) {
816  continue;
817  }
818  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT);
819  $this->objectives_qst_obj->setTestRefId($test_ref_id);
820  $this->objectives_qst_obj->setTestObjId($test_obj_id);
821  $this->objectives_qst_obj->setQuestionId($qst_id);
822  $this->objectives_qst_obj->add();
823  }
824 
825  // TODO: not nice
826  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
827  $this->questions = new ilCourseObjectiveQuestion((int) $_GET['objective_id']);
828  // not required due to percentages
829  //$this->questions->updateLimits();
830 
831  if ($checked_questions) {
832  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
833  $this->selfAssessmentLimits();
834  return true;
835  } else {
836  switch ($_SESSION['objective_mode']) {
837  case self::MODE_CREATE:
838  $this->finalTestAssignment();
839  return true;
840 
841  case self::MODE_UPDATE:
842  $this->selfAssessmentAssignment();
843  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
844  return true;
845  }
846  }
847  }
selfAssessmentAssignment()
self assessment assignemnt
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
if(!array_key_exists('StateId', $_REQUEST)) $id
finalTestAssignment()
final test assignment
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
class ilcourseobjectiveQuestion
$_POST["username"]
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 893 of file class.ilCourseObjectivesGUI.php.

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

894  {
895  global $DIC;
896 
897  $ilAccess = $DIC['ilAccess'];
898  $ilErr = $DIC['ilErr'];
899  $ilObjDataCache = $DIC['ilObjDataCache'];
900 
901  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
902  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
903  }
904  if (!$_GET['objective_id']) {
905  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
906  $this->ctrl->redirect($this, 'listObjectives');
907  }
908 
909  $this->__initQuestionObject((int) $_GET['objective_id']);
910 
911  if ((int) $_POST['limit'] < 1 or (int) $_POST['limit'] > 100) {
912  ilUtil::sendFailure($this->lng->txt('crs_objective_err_limit'));
913  $this->selfAssessmentLimits();
914  return false;
915  }
916 
917  foreach ($this->objectives_qst_obj->getSelfAssessmentTests() as $test) {
918  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT);
919  $this->objectives_qst_obj->setTestSuggestedLimit((int) $_POST['limit']);
920  $this->objectives_qst_obj->updateTest($test['test_objective_id']);
921  }
922 
923  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
924  $this->ctrl->returnToParent($this);
925  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
selfAssessmentLimits()
self assessment limits
$test
Definition: Utf8Test.php:84
+ Here is the call graph for this function:

Field Documentation

◆ $course_id

ilCourseObjectivesGUI::$course_id

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

◆ $course_obj

ilCourseObjectivesGUI::$course_obj

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

◆ $ctrl

ilCourseObjectivesGUI::$ctrl

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

◆ $ilErr

◆ $ilias

ilCourseObjectivesGUI::$ilias

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

Referenced by __construct().

◆ $lng

ilCourseObjectivesGUI::$lng

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

Referenced by __construct().

◆ $logger

ilCourseObjectivesGUI::$logger = null
private

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

◆ $settings

ilCourseObjectivesGUI::$settings
protected

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

Referenced by getSettings().

◆ $test_type

ilCourseObjectivesGUI::$test_type = 0
protected

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

Referenced by isRandomTestType().

◆ $tpl

◆ MODE_CREATE

const ilCourseObjectivesGUI::MODE_CREATE = 1

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

◆ MODE_UNDEFINED

const ilCourseObjectivesGUI::MODE_UNDEFINED = 0

◆ MODE_UPDATE

const ilCourseObjectivesGUI::MODE_UPDATE = 2

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


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