ILIAS  release_7 Revision v7.30-3-g800a261c036
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

 __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 (int $active_step)
 init wizard protected More...
 

Protected Attributes

const STEP_SETTINGS = 1
 
const STEP_MATERIAL_ASSIGNMENT = 2
 
const STEP_INITIAL_TEST_ASSIGNMENT = 3
 
const STEP_INITIAL_TEST_LIMIT = 4
 
const STEP_FINAL_TEST_ASSIGNMENT = 5
 
const STEP_FINAL_TEST_LIMIT = 6
 
 $settings
 
 $test_type = 0
 

Private Attributes

 $logger = null
 
 $objectives_lm_obj
 

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

Constructor & Destructor Documentation

◆ __construct()

ilCourseObjectivesGUI::__construct (   $a_course_id)

Constructor.

Parameters
int$a_course_id

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

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

82  {
83  include_once './Modules/Course/classes/class.ilCourseObjective.php';
84 
85  global $DIC;
86 
87  $ilCtrl = $DIC['ilCtrl'];
88  $lng = $DIC['lng'];
89  $ilErr = $DIC['ilErr'];
90  $ilias = $DIC['ilias'];
91  $tpl = $DIC['tpl'];
92  $tree = $DIC['tree'];
93  $ilTabs = $DIC['ilTabs'];
94 
95  $this->ctrl = $ilCtrl;
96  $this->ctrl->saveParameter($this, array("ref_id"));
97 
98  $this->logger = $GLOBALS['DIC']->logger()->crs();
99  $this->ilErr = $ilErr;
100  $this->lng = $lng;
101  $this->lng->loadLanguageModule('crs');
102  $this->tpl = $tpl;
103  $this->tree = $tree;
104  $this->tabs_gui = $ilTabs;
105 
106  $this->course_id = $a_course_id;
107  $this->__initCourseObject();
108 
109  // begin-patch lok
110  $this->settings = ilLOSettings::getInstanceByObjId($this->course_obj->getId());
111  // end-patch lok
112  }
static getInstanceByObjId($a_obj_id)
get singleton instance
settings()
Definition: settings.php:2
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

Member Function Documentation

◆ __initCourseObject()

ilCourseObjectivesGUI::__initCourseObject ( )

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

References exit, and ilObjectFactory\getInstanceByRefId().

Referenced by __construct().

420  {
421  if (!$this->course_obj = &ilObjectFactory::getInstanceByRefId($this->course_id, false)) {
422  $this->ilErr->raiseError("ilCourseObjectivesGUI: cannot create course object", $this->ilErr->MESSAGE);
423  exit;
424  }
425  return true;
426  }
exit
Definition: login.php:29
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 433 of file class.ilCourseObjectivesGUI.php.

Referenced by updateMaterialAssignment().

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

◆ __initObjectivesObject()

ilCourseObjectivesGUI::__initObjectivesObject (   $a_id = 0)

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

Referenced by askDeleteObjective(), and deleteObjectives().

429  {
430  return $this->objectives_obj = new ilCourseObjective($this->course_obj, $a_id);
431  }
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 447 of file class.ilCourseObjectivesGUI.php.

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

448  {
449  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
450  $this->objectives_qst_obj = new ilCourseObjectiveQuestion($a_objective_id);
451 
452  return $this->objectives_qst_obj;
453  }
class ilcourseobjectiveQuestion
+ Here is the caller graph for this function:

◆ askDeleteObjective()

ilCourseObjectivesGUI::askDeleteObjective ( )

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

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

213  {
214  global $DIC;
215 
216  $rbacsystem = $DIC['rbacsystem'];
217 
218  // MINIMUM ACCESS LEVEL = 'write'
219  if (!$rbacsystem->checkAccess("write", $this->course_obj->getRefId())) {
220  $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
221  }
222  if (!count($_POST['objective'])) {
223  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
224  $this->listObjectives();
225 
226  return true;
227  }
228 
229  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html", 'Modules/Course');
230 
231  ilUtil::sendQuestion($this->lng->txt('crs_delete_objectve_sure'));
232 
233  $tpl = new ilTemplate("tpl.table.html", true, true);
234  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_delete_row.html", 'Modules/Course');
235 
236  $counter = 0;
237  foreach ($_POST['objective'] as $objective_id) {
238  $objective_obj = $this->__initObjectivesObject($objective_id);
239 
240  $tpl->setCurrentBlock("tbl_content");
241  $tpl->setVariable("ROWCOL", ilUtil::switchColor(++$counter, "tblrow2", "tblrow1"));
242  $tpl->setVariable("TITLE", $objective_obj->getTitle());
243  $tpl->setVariable("DESCRIPTION", $objective_obj->getDescription());
244  $tpl->parseCurrentBlock();
245  }
246 
247  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
248 
249  // Show action row
250  $tpl->setCurrentBlock("tbl_action_btn");
251  $tpl->setVariable("BTN_NAME", 'deleteObjectives');
252  $tpl->setVariable("BTN_VALUE", $this->lng->txt('delete'));
253  $tpl->parseCurrentBlock();
254 
255  $tpl->setCurrentBlock("tbl_action_btn");
256  $tpl->setVariable("BTN_NAME", 'listObjectives');
257  $tpl->setVariable("BTN_VALUE", $this->lng->txt('cancel'));
258  $tpl->parseCurrentBlock();
259 
260  $tpl->setCurrentBlock("tbl_action_row");
261  $tpl->setVariable("COLUMN_COUNTS", 1);
262  $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.svg'));
263  $tpl->parseCurrentBlock();
264 
265 
266  // create table
267  $tbl = new ilTableGUI();
268  $tbl->setStyle('table', 'std');
269 
270  // title & header columns
271  $tbl->setTitle($this->lng->txt("crs_objectives"), "", $this->lng->txt("crs_objectives"));
272 
273  $tbl->setHeaderNames(array($this->lng->txt("title")));
274  $tbl->setHeaderVars(
275  array("title"),
276  array("ref_id" => $this->course_obj->getRefId(),
277  "cmdClass" => "ilcourseobjectivesgui",
278  "cmdNode" => $_GET["cmdNode"])
279  );
280  $tbl->setColumnWidth(array("50%"));
281 
282  $tbl->setLimit($_GET["limit"]);
283  $tbl->setOffset($_GET["offset"]);
284  $tbl->setMaxCount(count($_POST['objective']));
285 
286  // footer
287  $tbl->disable("footer");
288  $tbl->disable('sort');
289 
290  // render table
291  $tbl->setTemplate($tpl);
292  $tbl->render();
293 
294  $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get());
295 
296 
297  // Save marked objectives
298  $_SESSION['crs_delete_objectives'] = $_POST['objective'];
299 
300  return true;
301  }
$_SESSION["AccountId"]
$_GET["client_id"]
Class ilTableGUI.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: goto.php:24
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 509 of file class.ilCourseObjectivesGUI.php.

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

Referenced by save().

510  {
511  global $DIC;
512 
513  $tpl = $DIC['tpl'];
514 
515  $this->setSubTabs("create_obj");
516 
517  $_SESSION['objective_mode'] = self::MODE_CREATE;
518 
519  $this->ctrl->saveParameter($this, 'objective_id');
520 
521  if (!is_object($this->objective)) {
522  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
523  }
524  $this->__initQuestionObject((int) $_GET['objective_id']);
525  $this->initWizard(self::STEP_SETTINGS);
526 
527  $this->initFormTitle('create', 1);
528  $GLOBALS['DIC']['tpl']->setContent($this->form->getHtml());
529  #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
530  #$tpl->setContent($w_tpl->get());
531  }
initWizard(int $active_step)
init wizard protected
initFormTitle($a_mode, $a_step_number)
init form title
$_SESSION["AccountId"]
$_GET["client_id"]
class ilcourseobjective
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setSubTabs($a_active="")
set sub tabs
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteObjectives()

ilCourseObjectivesGUI::deleteObjectives ( )

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

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

304  {
305  global $DIC;
306 
307  $rbacsystem = $DIC['rbacsystem'];
308 
309  // MINIMUM ACCESS LEVEL = 'write'
310  if (!$rbacsystem->checkAccess("write", $this->course_obj->getRefId())) {
311  $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
312  }
313  if (!count($_SESSION['crs_delete_objectives'])) {
314  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'));
315  $this->listObjectives();
316 
317  return true;
318  }
319 
320  foreach ($_SESSION['crs_delete_objectives'] as $objective_id) {
321  $objective_obj = &$this->__initObjectivesObject($objective_id);
322  $objective_obj->delete();
323  }
324 
325  ilUtil::sendSuccess($this->lng->txt('crs_objectives_deleted'));
326  $this->listObjectives();
327 
328  return true;
329  }
$_SESSION["AccountId"]
global $DIC
Definition: goto.php:24
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 539 of file class.ilCourseObjectivesGUI.php.

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

Referenced by save().

540  {
541  global $DIC;
542 
543  $tpl = $DIC['tpl'];
544 
545  $_SESSION['objective_mode'] = self::MODE_UPDATE;
546 
547  $this->setSubTabs("edit_obj");
548 
549  $this->ctrl->setParameter($this, 'objective_id', (int) $_REQUEST['objective_id']);
550 
551  if (!$_REQUEST['objective_id']) {
552  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
553  $this->ctrl->redirect($this, 'listObjectives');
554  }
555 
556  if (!is_object($this->objective)) {
557  $this->objective = new ilCourseObjective($this->course_obj, (int) $_REQUEST['objective_id']);
558  }
559 
560  $this->__initQuestionObject((int) $_REQUEST['objective_id']);
561  $this->initWizard(self::STEP_SETTINGS);
562  $this->initFormTitle('create', 1);
563  $GLOBALS['DIC']['tpl']->setContent($this->form->getHtml());
564  #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
565  #$tpl->setContent($w_tpl->get());
566  }
initWizard(int $active_step)
init wizard protected
initFormTitle($a_mode, $a_step_number)
init form title
$_SESSION["AccountId"]
class ilcourseobjective
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setSubTabs($a_active="")
set sub tabs
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:

◆ executeCommand()

ilCourseObjectivesGUI::executeCommand ( )

execute command

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

References $DIC.

118  {
119  global $DIC;
120 
121  $ilTabs = $DIC['ilTabs'];
122 
123  $ilTabs->setTabActive('crs_objectives');
124 
125  $cmd = $this->ctrl->getCmd();
126 
127 
128  if (!$cmd = $this->ctrl->getCmd()) {
129  $cmd = "list";
130  }
131 
132  $this->$cmd();
133  }
global $DIC
Definition: goto.php:24

◆ finalSeparatedTestAssignment()

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

Show test assignment form.

Parameters
ilPropertyFormGUI$form

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

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

1278  {
1279  global $DIC;
1280 
1281  $ilAccess = $DIC['ilAccess'];
1282  $ilErr = $DIC['ilErr'];
1283 
1284  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
1285  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
1286  }
1287  if (!$_GET['objective_id']) {
1288  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
1289  $this->ctrl->returnToParent($this);
1290  }
1291  $this->ctrl->saveParameter($this, 'objective_id');
1292  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
1293 
1294  $this->initWizard(self::STEP_FINAL_TEST_LIMIT);
1295  $form = $this->initFormTestAssignment();
1296  $GLOBALS['DIC']['tpl']->setContent($form->getHtml());
1297  }
initWizard(int $active_step)
init wizard protected
$_GET["client_id"]
class ilcourseobjective
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ finalTestAssignment()

ilCourseObjectivesGUI::finalTestAssignment ( )
protected

final test assignment

protected

Parameters

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

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

Referenced by updateMaterialAssignment(), and updateSelfAssessmentAssignment().

957  {
958  global $DIC;
959 
960  $ilAccess = $DIC['ilAccess'];
961  $ilErr = $DIC['ilErr'];
962  $tpl = $DIC['tpl'];
963 
964  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
965  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
966  }
967  if (!$_GET['objective_id']) {
968  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
969  $this->ctrl->redirect($this, 'listObjectives');
970  }
971 
972  $this->setSubTabs("final_test_assign");
973 
974  $this->ctrl->saveParameter($this, 'objective_id');
975  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
976 
977  // begin-patch lok
978  $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
979  $this->test_type = $_REQUEST['tt'] = ilLOSettings::TYPE_TEST_QUALIFIED;
981  return $this->showRandomTestAssignment();
982  }
983  // end-patch lok
984 
985  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
987  $this,
988  $this->course_obj,
989  (int) $_GET['objective_id'],
991  );
992 
993  $table->setTitle(
994  $this->lng->txt('crs_objective_wiz_final'),
995  '',
996  $this->lng->txt('crs_objective')
997  );
998  $table->parse(ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()));
999 
1000  $this->__initQuestionObject((int) $_GET['objective_id']);
1001  $this->initWizard(self::STEP_FINAL_TEST_ASSIGNMENT);
1002  $GLOBALS['DIC']['tpl']->setContent($table->getHTML());
1003  }
initWizard(int $active_step)
init wizard protected
$_GET["client_id"]
showRandomTestAssignment(ilPropertyFormGUI $form=null)
class ilcourseobjective
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setSubTabs($a_active="")
set sub tabs
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 1306 of file class.ilCourseObjectivesGUI.php.

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

Referenced by updateFinalTestAssignment(), and updateFinalTestLimits().

1307  {
1308  global $DIC;
1309 
1310  $ilAccess = $DIC['ilAccess'];
1311  $ilErr = $DIC['ilErr'];
1312  $tpl = $DIC['tpl'];
1313 
1314  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
1315  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
1316  }
1317  if (!$_GET['objective_id']) {
1318  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
1319  $this->ctrl->returnToParent($this);
1320  }
1321 
1322  $this->setSubTabs("final_test_limits");
1323 
1324  $this->ctrl->saveParameter($this, 'objective_id');
1325  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
1326 
1327  $this->__initQuestionObject((int) $_GET['objective_id']);
1328  $this->initWizard(self::STEP_FINAL_TEST_LIMIT);
1329 
1330  $this->initFormLimits('final');
1331  $GLOBALS['DIC']['tpl']->setContent($this->form->getHtml());
1332  }
initWizard(int $active_step)
init wizard protected
$_GET["client_id"]
class ilcourseobjective
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setSubTabs($a_active="")
set sub tabs
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:

◆ getSettings()

ilCourseObjectivesGUI::getSettings ( )

Get settings.

Returns
ilLOSettings

Definition at line 140 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 1386 of file class.ilCourseObjectivesGUI.php.

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

Referenced by finalTestLimits(), and selfAssessmentLimits().

1387  {
1388  if (!is_object($this->form)) {
1389  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
1390  $this->form = new ilPropertyFormGUI();
1391  }
1392  $this->form->setFormAction($this->ctrl->getFormAction($this));
1393  $this->form->setTableWidth('100%');
1394  //$this->form->setTitleIcon(ilUtil::getImagePath('icon_lobj.svg'),$this->lng->txt('crs_objective'));
1395 
1396  switch ($a_mode) {
1397  case 'selfAssessment':
1398  $this->form->setTitle($this->lng->txt('crs_objective_wiz_self_limit'));
1399  $this->form->addCommandButton('updateSelfAssessmentLimits', $this->lng->txt('crs_wiz_next'));
1400 
1401  $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
1402  $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
1403 
1404  break;
1405 
1406  case 'final':
1407  $this->form->setTitle($this->lng->txt('crs_objective_wiz_final_limit'));
1408  $this->form->addCommandButton('updateFinalTestLimits', $this->lng->txt('crs_wiz_next'));
1409 
1410  $tests = $this->objectives_qst_obj->getFinalTests();
1411  $max_points = $this->objectives_qst_obj->getFinalTestPoints();
1412 
1413  break;
1414  }
1415 
1416  $over = new ilCustomInputGUI($this->lng->txt('crs_objective_qst_summary'), '');
1417 
1418  $tpl = new ilTemplate('tpl.crs_objective_qst_summary.html', true, true, 'Modules/Course');
1419 
1420 
1421  $limit = 0;
1422 
1423  foreach ($tests as $test) {
1424  $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': ' . print_r($test, true));
1425 
1426  $limit = $test['limit'];
1427 
1428  foreach ($this->objectives_qst_obj->getQuestionsOfTest($test['obj_id']) as $question) {
1429  $tpl->setCurrentBlock('qst');
1430  $tpl->setVariable('QST_TITLE', $question['title']);
1431  if (strlen($question['description'])) {
1432  $tpl->setVariable('QST_DESCRIPTION', $question['description']);
1433  }
1434  $tpl->setVariable('QST_POINTS', $question['points'] . ' ' .
1435  $this->lng->txt('crs_objective_points'));
1436  $tpl->parseCurrentBlock();
1437  }
1438  $tpl->setCurrentBlock('tst');
1439  $tpl->setVariable('TST_TITLE', ilObject::_lookupTitle($test['obj_id']));
1440  if ($desc = ilObject::_lookupDescription($test['obj_id'])) {
1441  $tpl->setVariable('TST_DESC', $desc);
1442  }
1443  $tpl->setVariable('TST_TYPE_IMG', ilUtil::getTypeIconPath('tst', $test['obj_id'], 'tiny'));
1444  $tpl->setVariable('TST_ALT_IMG', $this->lng->txt('obj_tst'));
1445  $tpl->parseCurrentBlock();
1446  }
1447 
1448  $tpl->setVariable('TXT_ALL_POINTS', $this->lng->txt('crs_objective_all_points'));
1449  $tpl->setVariable('TXT_POINTS', $this->lng->txt('crs_objective_points'));
1450  $tpl->setVariable('POINTS', $max_points);
1451 
1452  $over->setHtml($tpl->get());
1453  $this->form->addItem($over);
1454 
1455  // points
1456  $req = new ilNumberInputGUI($this->lng->txt('crs_loc_perc'), 'limit');
1457  $req->setValue($limit);
1458  $req->setSize(3);
1459  $req->setMinValue(1);
1460  $req->setMaxValue(100);
1461  $req->setRequired(true);
1462  switch ($a_mode) {
1463  case 'selfAssessment':
1464  $req->setInfo($this->lng->txt('crs_obj_initial_req_info'));
1465  break;
1466 
1467  case 'final':
1468  $req->setInfo($this->lng->txt('crs_obj_final_req_info'));
1469  break;
1470  }
1471  $this->form->addItem($req);
1472  }
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 Depre...
This class represents a number property in a property form.
static _lookupDescription($a_id)
lookup object description
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
This class represents a custom property in a property form.
$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 1046 of file class.ilCourseObjectivesGUI.php.

References $GLOBALS, ilObject\_lookupObjId(), ilObjectFactory\getInstanceByRefId(), getSettings(), ilLORandomTestQuestionPools\lookupLimit(), ilLORandomTestQuestionPools\lookupSequencesByType(), ilNumberInputGUI\setValue(), ilRadioGroupInputGUI\setValue(), and ilLOSettings\TYPE_TEST_INITIAL.

Referenced by saveRandom(), and showRandomTestAssignment().

1047  {
1048  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1049  $form = new ilPropertyFormGUI();
1050  $form->setFormAction($this->ctrl->getFormAction($this));
1051 
1052  if ($this->test_type == ilLOSettings::TYPE_TEST_INITIAL) {
1053  $form->setTitle($this->lng->txt('crs_loc_form_random_limits_it'));
1054  } else {
1055  $form->setTitle($this->lng->txt('crs_loc_form_random_limits_qt'));
1056  }
1057 
1058  $form->addCommandButton('saveRandom', $this->lng->txt('save'));
1059 
1060  $options = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_rand_assign_qpl'), 'type');
1061  $options->setValue(1);
1062  $options->setRequired(true);
1063 
1064  $ass_qpl = new ilRadioOption($this->lng->txt('crs_loc_rand_assign_qpl'), 1);
1065  $options->addOption($ass_qpl);
1066 
1067  $qpl = new ilSelectInputGUI($this->lng->txt('crs_loc_rand_qpl'), 'qpl');
1068  $qpl->setRequired(true);
1069  $qpl->setMulti(true, false);
1070  $qpl->setOptions($this->getRandomTestQplOptions());
1071 
1073  $this->course_obj->getId(),
1074  (int) $_REQUEST['objective_id'],
1075  ilObject::_lookupObjId($this->getSettings()->getTestByType($this->test_type)),
1076  $this->test_type
1077  );
1078 
1079  $qpl->setValue($sequences[0]);
1080  $qpl->setMultiValues($sequences);
1081  $ass_qpl->addSubItem($qpl);
1082 
1083  // points
1084  $per = new ilNumberInputGUI($this->lng->txt('crs_loc_perc'), 'per');
1085  $per->setValue(
1087  $this->course_obj->getId(),
1088  (int) $_REQUEST['objective_id'],
1089  $this->test_type
1090  )
1091  );
1092  $per->setSize(3);
1093  $per->setMinValue(1);
1094  $per->setMaxValue(100);
1095  $per->setRequired(true);
1096  $ass_qpl->addSubItem($per);
1097 
1098  $form->addItem($options);
1099  return $form;
1100  }
This class represents an option in a radio group.
setValue($a_value)
Set Value.
This class represents a property form user interface.
This class represents a property in a property 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
+ 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 1481 of file class.ilCourseObjectivesGUI.php.

References ilTextAreaInputGUI\setValue().

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

1482  {
1483  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
1484  if ($this->form instanceof ilPropertyFormGUI) {
1485  return;
1486  }
1487 
1488  $this->form = new ilPropertyFormGUI();
1489  $this->form->setFormAction($this->ctrl->getFormAction($this));
1490  //$this->form->setTitleIcon(ilUtil::getImagePath('icon_lobj.svg'),$this->lng->txt('crs_objective'));
1491 
1492  switch ($a_mode) {
1493  case 'create':
1494  $this->form->setTitle($this->lng->txt('crs_objective_wiz_title'));
1495  $this->form->addCommandButton('save', $this->lng->txt('crs_wiz_next'));
1496  // begin-patch lok
1497  #$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel'));
1498  // end-patch lok
1499  break;
1500 
1501  case 'update':
1502  break;
1503  }
1504 
1505  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
1506  $title->setValue($this->objective->getTitle());
1507  $title->setRequired(true);
1508  $title->setSize(40);
1509  $title->setMaxLength(70);
1510  $this->form->addItem($title);
1511 
1512  $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
1513  $desc->setValue($this->objective->getDescription());
1514  $desc->setCols(40);
1515  $desc->setRows(5);
1516  $this->form->addItem($desc);
1517  }
This class represents a property form user interface.
setValue($a_value)
Set Value.
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 ( int  $active_step)
protected

init wizard protected

Parameters
int$a_step_number
Returns
void

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

References $DIC, $steps, getSettings(), isRandomTestType(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

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

1527  {
1528  global $DIC;
1529  $steps = [];
1530  $step_positions = [];
1531 
1532  $workflow = $DIC->ui()->factory()->listing()->workflow();
1533 
1534  // 1 Settings
1535  $title = $this->lng->txt('crs_objective_wiz_title');
1536  $link = $this->ctrl->getLinkTarget($this, 'edit');
1537 
1538  $steps[] = $workflow->step($title, "", $link);
1539  $step_positions[self::STEP_SETTINGS] = count($steps) - 1;
1540 
1541  // 2 Material
1542  $title = $this->lng->txt('crs_objective_wiz_materials');
1543  $link = $this->ctrl->getLinkTarget($this, 'materialAssignment');
1544  $steps[] = $workflow->step($title, "", $link);
1545  $step_positions[self::STEP_MATERIAL_ASSIGNMENT] = count($steps) - 1;
1546 
1547 
1548  if ($this->getSettings()->worksWithInitialTest() && !$this->getSettings()->hasSeparateInitialTests()) {
1549  // 3 initial
1550  $title = $this->lng->txt('crs_objective_wiz_self');
1551  $link = $this->getSettings()->worksWithInitialTest()
1552  ? $this->ctrl->getLinkTarget($this, 'selfAssessmentAssignment')
1553  : null;
1554 
1555  $steps[] = $workflow->step($title, "", $link)
1556  ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1557  $step_positions[self::STEP_INITIAL_TEST_ASSIGNMENT] = count($steps) - 1;
1558 
1560  // 4 initial limit
1561  $title = $this->lng->txt('crs_objective_wiz_self_limit');
1562  $link = count($this->objectives_qst_obj->getSelfAssessmentQuestions())
1563  && $this->getSettings()->worksWithInitialTest()
1564  ? $this->ctrl->getLinkTarget($this, 'selfAssessmentLimits')
1565  : null;
1566  $steps[] = $workflow->step($title, "", $link)
1567  ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1568  $step_positions[self::STEP_INITIAL_TEST_LIMIT] = count($steps) - 1;
1569  }
1570  }
1571 
1572  if (!$this->getSettings()->hasSeparateQualifiedTests()) {
1573  // 5 final
1574  $title = $this->lng->txt('crs_objective_wiz_final');
1575  $link = $this->ctrl->getLinkTarget($this, 'finalTestAssignment');
1576  $steps[] = $workflow->step($title, "", $link);
1577  $step_positions[self::STEP_FINAL_TEST_ASSIGNMENT] = count($steps) - 1;
1578 
1580  // 6 final limit
1581  $title = $this->lng->txt('crs_objective_wiz_final_limit');
1582  $link = count($this->objectives_qst_obj->getFinalTestQuestions())
1583  ? $this->ctrl->getLinkTarget($this, 'finalTestLimits')
1584  : null;
1585  $steps[] = $workflow->step($title, "", $link)
1586  ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1587  $step_positions[self::STEP_FINAL_TEST_LIMIT] = count($steps) - 1;
1588  }
1589  }
1590 
1591  $list = $workflow->linear(
1592  $this->lng->txt('crs_checklist_objective'),
1593  $steps
1594  );
1595  if (!empty($step_positions[$active_step])) {
1596  $list = $list->withActive($step_positions[$active_step]);
1597  }
1598 
1599  $renderer = $DIC->ui()->renderer();
1600 
1601  $DIC["tpl"]->setRightContent($renderer->render($list));
1602  }
global $DIC
Definition: goto.php:24
$steps
Definition: latex.php:3
+ 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 1006 of file class.ilCourseObjectivesGUI.php.

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

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

1007  {
1008  if (!$a_tst_type) {
1009  $a_tst_type = $this->test_type;
1010  }
1011 
1012  $tst_ref_id = $this->getSettings()->getTestByType($a_tst_type);
1013  if (!$tst_ref_id) {
1014  return false;
1015  }
1016  include_once './Modules/Test/classes/class.ilObjTest.php';
1018  }
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 154 of file class.ilCourseObjectivesGUI.php.

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

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

155  {
156  global $DIC;
157 
158  $ilAccess = $DIC['ilAccess'];
159  $ilErr = $DIC['ilErr'];
160  $ilObjDataCache = $DIC['ilObjDataCache'];
161  $ilToolbar = $DIC['ilToolbar'];
162 
163  $_SESSION['objective_mode'] = self::MODE_UNDEFINED;
164  if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
165  $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
166  }
167 
168  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.crs_objectives.html', 'Modules/Course');
169 
170  $ilToolbar->addButton(
171  $this->lng->txt('crs_add_objective'),
172  $this->ctrl->getLinkTarget($this, "'create")
173  );
174 
175  include_once('./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
176  $table = new ilCourseObjectivesTableGUI($this, $this->course_obj);
177  $table->setTitle($this->lng->txt('crs_objectives'), '', $this->lng->txt('crs_objectives'));
178  $table->parse(ilCourseObjective::_getObjectiveIds($this->course_obj->getId(), false));
179 
180  $this->tpl->setVariable('OBJECTIVES_TABLE', $table->getHTML());
181  }
$_SESSION["AccountId"]
static _getObjectiveIds($course_id, $a_activated_only=false)
global $DIC
Definition: goto.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 627 of file class.ilCourseObjectivesGUI.php.

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

628  {
629  global $DIC;
630 
631  $ilAccess = $DIC['ilAccess'];
632  $ilErr = $DIC['ilErr'];
633  $tpl = $DIC['tpl'];
634 
635  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
636  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
637  }
638  if (!$_GET['objective_id']) {
639  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
640  $this->ctrl->redirect($this, 'listObjectives');
641  }
642 
643  $this->setSubTabs("materials");
644 
645  $this->ctrl->saveParameter($this, 'objective_id');
646 
647  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
648 
649  include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
650  $table = new ilCourseObjectiveMaterialAssignmentTableGUI($this, $this->course_obj, (int) $_GET['objective_id']);
651  $table->setTitle(
652  $this->lng->txt('crs_objective_wiz_materials'),
653  '',
654  $this->lng->txt('crs_objectives')
655  );
656 
657  include_once('Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
658  $table->parse(ilCourseObjectiveMaterials::_getAssignableMaterials($this->course_obj->getRefId()));
659 
660  $this->__initQuestionObject((int) $_GET['objective_id']);
661  $this->initWizard(self::STEP_MATERIAL_ASSIGNMENT);
662  $GLOBALS['DIC']['tpl']->setContent($table->getHTML());
663  }
initWizard(int $active_step)
init wizard protected
$_GET["client_id"]
TableGUI for material assignments of course objectives.
class ilcourseobjective
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
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...
+ Here is the call graph for this function:

◆ questionOverview()

ilCourseObjectivesGUI::questionOverview ( )
protected

question overiew

protected

Returns

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

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

Referenced by saveQuestionOverview().

338  {
339  global $DIC;
340 
341  $ilAccess = $DIC['ilAccess'];
342  $ilErr = $DIC['ilErr'];
343  $ilTabs = $DIC['ilTabs'];
344 
345  $ilTabs->setSubTabActive('crs_objective_overview_question_assignment');
346 
347  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
348  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
349  }
350 
351  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
352  $table = new ilCourseObjectiveQuestionsTableGUI($this, $this->course_obj);
353  $table->setTitle($this->lng->txt('crs_objectives_edit_question_assignments'), '', $this->lng->txt('crs_objectives'));
354  // begin-patch lok
355  $table->parse(ilCourseObjective::_getObjectiveIds($this->course_obj->getId(), false));
356  // end-patch lok
357 
358  $this->tpl->setContent($table->getHTML());
359  }
static _getObjectiveIds($course_id, $a_activated_only=false)
global $DIC
Definition: goto.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 574 of file class.ilCourseObjectivesGUI.php.

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

575  {
576  global $DIC;
577 
578  $ilAccess = $DIC['ilAccess'];
579  $ilErr = $DIC['ilErr'];
580 
581  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
582  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
583  }
584 
585  $this->ctrl->saveParameter($this, 'objective_id');
586 
587  $this->objective = new ilCourseObjective($this->course_obj, (int) $_REQUEST['objective_id']);
588  $this->initFormTitle('create', 1);
589  if ($this->form->checkInput()) {
590  $this->objective->setTitle($this->form->getInput('title'));
591  $this->objective->setDescription($this->form->getInput('description'));
592  $this->objective->setPasses(0);
593 
594  if (!$_GET['objective_id']) {
595  $objective_id = $this->objective->add();
596  ilUtil::sendSuccess($this->lng->txt('crs_added_objective'), true);
597  } else {
598  $this->objective->update();
599  ilUtil::sendSuccess($this->lng->txt('crs_objective_modified'), true);
600  $objective_id = $_GET['objective_id'];
601  }
602  } else {
603  if ((int) $_GET['objective_id']) {
604  $this->form->setValuesByPost();
605  return $this->edit();
606  } else {
607  $this->form->setValuesByPost();
608  return $this->create();
609  }
610  }
611 
612  if ($_SESSION['objective_mode'] != self::MODE_CREATE) {
613  $this->ctrl->returnToParent($this);
614  }
615 
616  $this->ctrl->setParameter($this, 'objective_id', $objective_id);
617  $this->ctrl->redirect($this, 'materialAssignment');
618  return true;
619  }
initFormTitle($a_mode, $a_step_number)
init form title
$_SESSION["AccountId"]
$_GET["client_id"]
class ilcourseobjective
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ saveQuestionOverview()

ilCourseObjectivesGUI::saveQuestionOverview ( )
protected

update question overview

protected

Returns

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

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

368  {
369  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
370 
371  global $DIC;
372 
373  $ilAccess = $DIC['ilAccess'];
374  $ilErr = $DIC['ilErr'];
375 
376  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
377  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
378  }
379  $error = false;
380 
381  $_POST['self'] = $_POST['self'] ? $_POST['self'] : array();
382  $_POST['final'] = $_POST['final'] ? $_POST['final'] : array();
383 
384  foreach ($_POST['self'] as $objective_id => $limit) {
385  $qst = new ilCourseObjectiveQuestion($objective_id);
386  $max_points = $qst->getSelfAssessmentPoints();
387 
388  if ($limit < 0 or $limit > $max_points) {
389  ilUtil::sendFailure($this->lng->txt('crs_objective_limit_err'));
390  $this->questionOverview();
391  return false;
392  }
393  }
394  foreach ($_POST['final'] as $objective_id => $limit) {
395  $qst = new ilCourseObjectiveQuestion($objective_id);
396  $max_points = $qst->getFinalTestPoints();
397 
398  if ($limit < 0 or $limit > $max_points) {
399  ilUtil::sendFailure($this->lng->txt('crs_objective_limit_err'));
400  $this->questionOverview();
401  return false;
402  }
403  }
404 
405  foreach ($_POST['self'] as $objective_id => $limit) {
407  }
408 
409  foreach ($_POST['final'] as $objective_id => $limit) {
411  }
412 
413  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
414  $this->questionOverview();
415  return true;
416  }
global $DIC
Definition: goto.php:24
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 1160 of file class.ilCourseObjectivesGUI.php.

References $_GET, __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.

1161  {
1162  $this->ctrl->saveParameter($this, 'objective_id');
1163  $this->ctrl->setParameter($this, 'tt', (int) $_REQUEST['tt']);
1164  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
1165  $this->test_type = (int) $_REQUEST['tt'];
1166 
1167  $form = $this->initFormRandom();
1168 
1169 
1170 
1171 
1172  if ($form->checkInput()) {
1174  $this->course_obj->getId(),
1175  (int) $_REQUEST['objective_id'],
1176  $this->test_type
1177  );
1178 
1179  $qst = $this->__initQuestionObject((int) $_GET['objective_id']);
1180  $qst->deleteByTestType(
1181  ($this->test_type == ilLOSettings::TYPE_TEST_INITIAL) ?
1184  );
1185  $ref_id = $this->getSettings()->getTestByType($this->test_type);
1186  foreach (array_unique((array) $form->getInput('qpl')) as $qpl_id) {
1187  include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
1188  $rnd = new ilLORandomTestQuestionPools(
1189  $this->course_obj->getId(),
1190  (int) $_REQUEST['objective_id'],
1191  $this->test_type,
1192  $qpl_id
1193  );
1194  $rnd->setLimit($form->getInput('per'));
1195  $rnd->setTestId(ilObject::_lookupObjId($ref_id));
1196  $rnd->create();
1197  }
1198  } else {
1199  $form->setValuesByPost();
1200  ilUtil::sendFailure($this->lng->txt('err_check_input'));
1201  return $this->showRandomTestAssignment();
1202  }
1203 
1204  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1205  if ($this->test_type == ilLOSettings::TYPE_TEST_QUALIFIED) {
1206  $this->ctrl->returnToParent($this);
1207  } else {
1208  $this->ctrl->redirect($this, 'finalTestAssignment');
1209  }
1210  }
$_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)
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 189 of file class.ilCourseObjectivesGUI.php.

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

190  {
191  global $DIC;
192 
193  $ilAccess = $DIC['ilAccess'];
194  $ilErr = $DIC['ilErr'];
195  $ilObjDataCache = $DIC['ilObjDataCache'];
196 
197  if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) {
198  $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE);
199  }
200 
201  asort($_POST['position'], SORT_NUMERIC);
202 
203  $counter = 1;
204  foreach ($_POST['position'] as $objective_id => $position) {
205  $objective = new ilCourseObjective($this->course_obj, $objective_id);
206  $objective->writePosition($counter++);
207  }
208  ilUtil::sendSuccess($this->lng->txt('crs_objective_saved_sorting'));
209  $this->listObjectives();
210  }
class ilcourseobjective
global $DIC
Definition: goto.php:24
$_POST["username"]
+ Here is the call graph for this function:

◆ selfAssessmentAssignment()

ilCourseObjectivesGUI::selfAssessmentAssignment ( )
protected

self assessment assignemnt

protected

Returns

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

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

Referenced by updateMaterialAssignment(), and updateSelfAssessmentAssignment().

748  {
749  global $DIC;
750 
751  $ilAccess = $DIC['ilAccess'];
752  $ilErr = $DIC['ilErr'];
753  $tpl = $DIC['tpl'];
754 
755  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
756  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
757  }
758  if (!$_GET['objective_id']) {
759  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
760  $this->ctrl->redirect($this, 'listObjectives');
761  }
762 
763  $this->setSubTabs("self_ass_assign");
764 
765  $this->ctrl->saveParameter($this, 'objective_id');
766 
767  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
768 
769  // begin-patch lok
770  $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_INITIAL);
771  $this->test_type = $_REQUEST['tt'] = ilLOSettings::TYPE_TEST_INITIAL;
773  return $this->showRandomTestAssignment();
774  }
775  // end-patch lok
776 
777  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
779  $this,
780  $this->course_obj,
781  (int) $_GET['objective_id'],
783  );
784  $table->setTitle(
785  $this->lng->txt('crs_objective_wiz_self'),
786  '',
787  $this->lng->txt('crs_objective')
788  );
789  $table->parse(ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()));
790 
791  $this->__initQuestionObject((int) $_GET['objective_id']);
792  $this->initWizard(self::STEP_INITIAL_TEST_ASSIGNMENT);
793  $GLOBALS['DIC']['tpl']->setContent($table->getHTML());
794  }
initWizard(int $active_step)
init wizard protected
$_GET["client_id"]
showRandomTestAssignment(ilPropertyFormGUI $form=null)
class ilcourseobjective
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setSubTabs($a_active="")
set sub tabs
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 877 of file class.ilCourseObjectivesGUI.php.

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

Referenced by updateSelfAssessmentAssignment(), and updateSelfAssessmentLimits().

878  {
879  global $DIC;
880 
881  $ilAccess = $DIC['ilAccess'];
882  $ilErr = $DIC['ilErr'];
883  $tpl = $DIC['tpl'];
884 
885  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
886  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
887  }
888  if (!$_GET['objective_id']) {
889  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
890  $this->ctrl->redirect($this, 'listObjectives');
891  }
892 
893  $this->setSubTabs("self_ass_limits");
894 
895  $this->ctrl->saveParameter($this, 'objective_id');
896  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
897 
898  $this->__initQuestionObject((int) $_GET['objective_id']);
899  $this->initWizard(self::STEP_INITIAL_TEST_LIMIT);
900 
901  $this->initFormLimits('selfAssessment');
902  $GLOBALS['DIC']['tpl']->setContent($this->form->getHtml());
903  #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml());
904  #$tpl->setContent($w_tpl->get());
905  }
initWizard(int $active_step)
init wizard protected
$_GET["client_id"]
class ilcourseobjective
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setSubTabs($a_active="")
set sub tabs
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 (   $a_active = "")

set sub tabs

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

References $DIC, and ilCourseObjectiveQuestion\_hasTests().

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

460  {
461  global $DIC;
462 
463  $ilTabs = $DIC['ilTabs'];
464  $ilHelp = $DIC['ilHelp'];
465 
466  if ($a_active != "") {
467  $ilHelp->setScreenIdComponent("crs");
468  $ilHelp->setScreenId("crs_objective");
469  $ilHelp->setSubScreenId($a_active);
470  }
471 
472 
473  // begin-patch lok
474  // no subtabs here
475  return true;
476  // end-patch lok
477 
478 
479  $ilTabs->addSubTabTarget(
480  "crs_objective_overview_objectives",
481  $this->ctrl->getLinkTarget($this, "listObjectives"),
482  array("listObjectives", "moveObjectiveUp", "moveObjectiveDown", "listAssignedLM"),
483  array(),
484  '',
485  true
486  );
487  include_once('./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
488 
489  if (ilCourseObjectiveQuestion::_hasTests($this->course_obj->getId())) {
490  $ilTabs->addSubTabTarget(
491  "crs_objective_overview_question_assignment",
492  $this->ctrl->getLinkTarget($this, "questionOverview"),
493  "editQuestionAssignment",
494  array(),
495  '',
496  false
497  );
498  }
499  }
global $DIC
Definition: goto.php:24
+ 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 1024 of file class.ilCourseObjectivesGUI.php.

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

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

1025  {
1026  $this->ctrl->saveParameter($this, 'objective_id');
1027  $this->ctrl->setParameter($this, 'tt', (int) $_REQUEST['tt']);
1028  $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
1029  $this->test_type = (int) $_REQUEST['tt'];
1030 
1031 
1032  $this->setSubTabs("rand_test_assign");
1033 
1034  if (!$form instanceof ilPropertyFormGUI) {
1035  $form = $this->initFormRandom();
1036  }
1037 
1038  $this->__initQuestionObject((int) $_GET['objective_id']);
1039  $this->initWizard(self::STEP_FINAL_TEST_ASSIGNMENT);
1040  $GLOBALS['DIC']['tpl']->setContent($form->getHTML());
1041  }
initWizard(int $active_step)
init wizard protected
This class represents a property form user interface.
$_GET["client_id"]
class ilcourseobjective
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setSubTabs($a_active="")
set sub tabs
+ 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 1219 of file class.ilCourseObjectivesGUI.php.

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

1220  {
1221  global $DIC;
1222 
1223  $ilAccess = $DIC['ilAccess'];
1224  $ilErr = $DIC['ilErr'];
1225  $ilObjDataCache = $DIC['ilObjDataCache'];
1226 
1227  $checked_questions = $_POST['questions'] ? $_POST['questions'] : array();
1228 
1229 
1230  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
1231  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
1232  }
1233  if (!$_GET['objective_id']) {
1234  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
1235  $this->ctrl->redirect($this, 'listObjectives');
1236  }
1237 
1238  $this->__initQuestionObject((int) $_GET['objective_id']);
1239 
1240  // Delete unchecked
1241  foreach ($this->objectives_qst_obj->getFinalTestQuestions() as $question) {
1242  $id = $question['ref_id'] . '_' . $question['question_id'];
1243  if (!in_array($id, $checked_questions)) {
1244  $this->objectives_qst_obj->delete($question['qst_ass_id']);
1245  }
1246  }
1247  // Add checked
1248  foreach ($checked_questions as $question_id) {
1249  list($test_ref_id, $qst_id) = explode('_', $question_id);
1250  $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
1251 
1252  if ($this->objectives_qst_obj->isFinalTestQuestion($qst_id)) {
1253  continue;
1254  }
1255 
1256  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_FINAL_TEST);
1257  $this->objectives_qst_obj->setTestRefId($test_ref_id);
1258  $this->objectives_qst_obj->setTestObjId($test_obj_id);
1259  $this->objectives_qst_obj->setQuestionId($qst_id);
1260  $this->objectives_qst_obj->add();
1261  }
1262 
1263  // TODO: not nice
1264  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
1265  $this->questions = new ilCourseObjectiveQuestion((int) $_GET['objective_id']);
1266  // not required due to percentages
1267  //$this->questions->updateLimits();
1268 
1269  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
1270  $this->finalTestLimits();
1271  }
$_GET["client_id"]
finalTestLimits()
self assessment limits
global $DIC
Definition: goto.php:24
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 1341 of file class.ilCourseObjectivesGUI.php.

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

1342  {
1343  global $DIC;
1344 
1345  $ilAccess = $DIC['ilAccess'];
1346  $ilErr = $DIC['ilErr'];
1347  $ilObjDataCache = $DIC['ilObjDataCache'];
1348 
1349  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
1350  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
1351  }
1352  if (!$_GET['objective_id']) {
1353  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
1354  $this->ctrl->redirect($this, 'listObjectives');
1355  }
1356 
1357  $this->__initQuestionObject((int) $_GET['objective_id']);
1358 
1359  if ((int) $_POST['limit'] < 1 or (int) $_POST['limit'] > 100) {
1360  ilUtil::sendFailure($this->lng->txt('crs_objective_err_limit'));
1361  $this->finalTestLimits();
1362  return false;
1363  }
1364 
1365  foreach ($this->objectives_qst_obj->getFinalTests() as $test) {
1366  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_FINAL_TEST);
1367  $this->objectives_qst_obj->setTestSuggestedLimit((int) $_POST['limit']);
1368  $this->objectives_qst_obj->updateTest($test['test_objective_id']);
1369  }
1370 
1371  if ($_SESSION['objective_mode'] != self::MODE_CREATE) {
1372  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1373  } else {
1374  ilUtil::sendSuccess($this->lng->txt('crs_added_objective'), true);
1375  }
1376  $this->ctrl->returnToParent($this);
1377  }
$_SESSION["AccountId"]
$_GET["client_id"]
finalTestLimits()
self assessment limits
global $DIC
Definition: goto.php:24
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 672 of file class.ilCourseObjectivesGUI.php.

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

673  {
674  global $DIC;
675 
676  $ilAccess = $DIC['ilAccess'];
677  $ilErr = $DIC['ilErr'];
678  $ilObjDataCache = $DIC['ilObjDataCache'];
679 
680  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
681  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
682  }
683  if (!$_GET['objective_id']) {
684  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
685  $this->ctrl->redirect($this, 'listObjectives');
686  }
687 
688  $this->__initLMObject((int) $_GET['objective_id']);
689 
690  $visibleMaterials = is_array($_POST['visible_materials']) ? $_POST['visible_materials'] : [];
691  $visibleChapters = is_array($_POST['visible_chapters']) ? $_POST['visible_chapters'] : [];
692  $materials = is_array($_POST['materials']) ? $_POST['materials'] : [];
693  $chapters = is_array($_POST['chapters']) ? $_POST['chapters'] : [];
694 
695  foreach ($visibleMaterials as $node_id) {
696  $obj_id = $ilObjDataCache->lookupObjId($node_id);
697  if (!in_array($node_id, $materials)) {
698  $this->objectives_lm_obj->deleteMaterial($node_id, $obj_id);
699  continue;
700  }
701  if ($this->objectives_lm_obj->isMaterialAssigned($node_id, $obj_id)) {
702  continue;
703  }
704  $this->objectives_lm_obj->setLMRefId($node_id);
705  $this->objectives_lm_obj->setLMObjId($obj_id);
706  $this->objectives_lm_obj->setType($ilObjDataCache->lookupType($obj_id));
707  $this->objectives_lm_obj->add();
708  }
709 
710  foreach ($visibleChapters as $chapter) {
711  list($ref_id, $chapter_id) = explode('_', $chapter);
712  if (!in_array($chapter, $chapters)) {
713  $this->objectives_lm_obj->deleteMaterial($ref_id, $chapter_id);
714  continue;
715  }
716  if ($this->objectives_lm_obj->isMaterialAssigned($ref_id, $chapter_id)) {
717  continue;
718  }
719  $this->objectives_lm_obj->setLMRefId($ref_id);
720  $this->objectives_lm_obj->setLMObjId($chapter_id);
721  $this->objectives_lm_obj->setType(ilLMObject::_lookupType($chapter_id));
722  $this->objectives_lm_obj->add();
723  }
724  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
725 
726 
727  if ($_SESSION['objective_mode'] != self::MODE_CREATE) {
728  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'), true);
729  $this->ctrl->returnToParent($this);
730  }
731 
732  // begin-patch lok
733  if ($this->getSettings()->worksWithInitialTest()) {
734  $this->selfAssessmentAssignment();
735  } else {
736  $this->finalTestAssignment();
737  }
738  // end-patch lok
739  }
selfAssessmentAssignment()
self assessment assignemnt
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
$_SESSION["AccountId"]
$_GET["client_id"]
finalTestAssignment()
final test assignment
global $DIC
Definition: goto.php:24
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 803 of file class.ilCourseObjectivesGUI.php.

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

804  {
805  global $DIC;
806 
807  $ilAccess = $DIC['ilAccess'];
808  $ilErr = $DIC['ilErr'];
809  $ilObjDataCache = $DIC['ilObjDataCache'];
810 
811  $checked_questions = $_POST['questions'] ? $_POST['questions'] : array();
812 
813 
814  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
815  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
816  }
817  if (!$_GET['objective_id']) {
818  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
819  $this->ctrl->redirect($this, 'listObjectives');
820  }
821 
822  $this->__initQuestionObject((int) $_GET['objective_id']);
823 
824  // Delete unchecked
825  foreach ($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question) {
826  $id = $question['ref_id'] . '_' . $question['question_id'];
827  if (!in_array($id, $checked_questions)) {
828  $this->objectives_qst_obj->delete($question['qst_ass_id']);
829  }
830  }
831  // Add checked
832  foreach ($checked_questions as $question_id) {
833  list($test_ref_id, $qst_id) = explode('_', $question_id);
834  $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
835 
836  if ($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id)) {
837  continue;
838  }
839  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT);
840  $this->objectives_qst_obj->setTestRefId($test_ref_id);
841  $this->objectives_qst_obj->setTestObjId($test_obj_id);
842  $this->objectives_qst_obj->setQuestionId($qst_id);
843  $this->objectives_qst_obj->add();
844  }
845 
846  // TODO: not nice
847  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
848  $this->questions = new ilCourseObjectiveQuestion((int) $_GET['objective_id']);
849  // not required due to percentages
850  //$this->questions->updateLimits();
851 
852  if ($checked_questions) {
853  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
854  $this->selfAssessmentLimits();
855  return true;
856  } else {
857  switch ($_SESSION['objective_mode']) {
858  case self::MODE_CREATE:
859  $this->finalTestAssignment();
860  return true;
861 
862  case self::MODE_UPDATE:
863  $this->selfAssessmentAssignment();
864  ilUtil::sendSuccess($this->lng->txt('crs_objectives_assigned_lm'));
865  return true;
866  }
867  }
868  }
selfAssessmentAssignment()
self assessment assignemnt
$_SESSION["AccountId"]
$_GET["client_id"]
finalTestAssignment()
final test assignment
global $DIC
Definition: goto.php:24
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 914 of file class.ilCourseObjectivesGUI.php.

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

915  {
916  global $DIC;
917 
918  $ilAccess = $DIC['ilAccess'];
919  $ilErr = $DIC['ilErr'];
920  $ilObjDataCache = $DIC['ilObjDataCache'];
921 
922  if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
923  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
924  }
925  if (!$_GET['objective_id']) {
926  ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
927  $this->ctrl->redirect($this, 'listObjectives');
928  }
929 
930  $this->__initQuestionObject((int) $_GET['objective_id']);
931 
932  if ((int) $_POST['limit'] < 1 or (int) $_POST['limit'] > 100) {
933  ilUtil::sendFailure($this->lng->txt('crs_objective_err_limit'));
934  $this->selfAssessmentLimits();
935  return false;
936  }
937 
938  foreach ($this->objectives_qst_obj->getSelfAssessmentTests() as $test) {
939  $this->objectives_qst_obj->setTestStatus(ilCourseObjectiveQuestion::TYPE_SELF_ASSESSMENT);
940  $this->objectives_qst_obj->setTestSuggestedLimit((int) $_POST['limit']);
941  $this->objectives_qst_obj->updateTest($test['test_objective_id']);
942  }
943 
944  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
945  $this->ctrl->returnToParent($this);
946  }
$_GET["client_id"]
global $DIC
Definition: goto.php:24
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 60 of file class.ilCourseObjectivesGUI.php.

◆ $course_obj

ilCourseObjectivesGUI::$course_obj

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

◆ $ctrl

ilCourseObjectivesGUI::$ctrl

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

◆ $ilErr

◆ $ilias

ilCourseObjectivesGUI::$ilias

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

Referenced by __construct().

◆ $lng

ilCourseObjectivesGUI::$lng

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

Referenced by __construct().

◆ $logger

ilCourseObjectivesGUI::$logger = null
private

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

◆ $objectives_lm_obj

ilCourseObjectivesGUI::$objectives_lm_obj
private

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

◆ $settings

ilCourseObjectivesGUI::$settings
protected

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

Referenced by getSettings().

◆ $test_type

ilCourseObjectivesGUI::$test_type = 0
protected

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

Referenced by isRandomTestType().

◆ $tpl

◆ MODE_CREATE

const ilCourseObjectivesGUI::MODE_CREATE = 1

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

◆ MODE_UNDEFINED

const ilCourseObjectivesGUI::MODE_UNDEFINED = 0

◆ MODE_UPDATE

const ilCourseObjectivesGUI::MODE_UPDATE = 2

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

◆ STEP_FINAL_TEST_ASSIGNMENT

const ilCourseObjectivesGUI::STEP_FINAL_TEST_ASSIGNMENT = 5
protected

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

◆ STEP_FINAL_TEST_LIMIT

const ilCourseObjectivesGUI::STEP_FINAL_TEST_LIMIT = 6
protected

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

◆ STEP_INITIAL_TEST_ASSIGNMENT

const ilCourseObjectivesGUI::STEP_INITIAL_TEST_ASSIGNMENT = 3
protected

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

◆ STEP_INITIAL_TEST_LIMIT

const ilCourseObjectivesGUI::STEP_INITIAL_TEST_LIMIT = 4
protected

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

◆ STEP_MATERIAL_ASSIGNMENT

const ilCourseObjectivesGUI::STEP_MATERIAL_ASSIGNMENT = 2
protected

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

◆ STEP_SETTINGS

const ilCourseObjectivesGUI::STEP_SETTINGS = 1
protected

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


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