ILIAS  release_8 Revision v8.24
class.ilObjSCORM2004LearningModuleGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
37{
38 protected \ILIAS\DI\Container $dic;
39 protected ilTabsGUI $tabs;
41 protected ilHelpGUI $help;
44
45 public function __construct(array $a_data, int $a_id, bool $a_call_by_reference, ?bool $a_prepare_output = true)
46 {
47 global $DIC;
48 $this->dic = $DIC;
49 $this->lng = $DIC->language();
50 $this->access = $DIC->access();
51 $this->ctrl = $DIC->ctrl();
52 $this->tpl = $DIC["tpl"];
53 $this->tabs = $DIC->tabs();
54 $this->rbacsystem = $DIC->rbac()->system();
55 $this->tree = $DIC->repositoryTree();
56 $this->toolbar = $DIC->toolbar();
57 $this->settings = $DIC->settings();
58 $this->help = $DIC["ilHelp"];
59 $this->error = $DIC["ilErr"];
60 $this->user = $DIC->user();
61 $this->tool_context = $DIC->globalScreen()->tool()->context();
62 $lng = $DIC->language();
63
64 $lng->loadLanguageModule("content");
65 $lng->loadLanguageModule("sahs");
66 $lng->loadLanguageModule("search");
68 $this->type = "sahs";
69 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
70 #$this->tabs_gui = new ilTabsGUI();
71 }
72
76 protected function assignObject(): void
77 {
78 if ($this->id != 0) {
79 if ($this->call_by_reference) {
80 $this->object = new ilObjSCORM2004LearningModule($this->id, true);
81 } else {
82 $this->object = new ilObjSCORM2004LearningModule($this->id, false);
83 }
84 }
85 }
86
87 public function executeCommand(): void
88 {
89 $ilCtrl = $this->ctrl;
90
91 $next_class = $ilCtrl->getNextClass($this);
92 $cmd = $ilCtrl->getCmd();
93 parent::executeCommand();
94 $this->addHeaderAction();
95 }
96
100 public function properties(): void
101 {
106 $ilToolbar = $this->toolbar;
107 $ilCtrl = $this->ctrl;
109 $ilTabs = $this->tabs;
110
111 $this->setSettingsSubTabs();
112 $ilTabs->setSubTabActive('cont_settings');
113 // view
114 $ilToolbar->addButtonInstance($this->object->getViewButton());
115
116 // output forms
117 $this->initPropertiesForm();
119 $tpl->setContent($this->form->getHTML());
120 }
121
125 public function initPropertiesForm(): void
126 {
128 $ilCtrl = $this->ctrl;
129 $obj_service = $this->getObjectService();
130
131 //check/select only once
132 $this->object->checkMasteryScoreValues();
133
134 $this->form = new ilPropertyFormGUI();
135 $this->form->setFormAction($ilCtrl->getFormAction($this));
136 $this->form->setTitle($this->lng->txt("cont_lm_properties"));
137
138 //title
139 $ti = new ilTextInputGUI($this->lng->txt("title"), "Fobject_title");
140 $ti->setMaxLength(200);
141 $this->form->addItem($ti);
142
143 //description
144 $ti = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject_description");
145 $this->form->addItem($ti);
146
147 // SCORM-type
148 $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
149 $ne->setValue($this->lng->txt("lm_type_" . ilObjSAHSLearningModule::_lookupSubType($this->object->getID())));
150 $this->form->addItem($ne);
151
152 // version
153 $ne = new ilNonEditableValueGUI($this->lng->txt("cont_sc_version"), "");
154 $ne->setValue($this->object->getModuleVersion());
155 $ne->setInfo($this->lng->txt("cont_sc_version_info"));
156 $this->form->addItem($ne);
157
158 //
159 // activation
160 //
161 $sh = new ilFormSectionHeaderGUI();
162 $sh->setTitle($this->lng->txt("activation"));
163 $this->form->addItem($sh);
164
165 // online
166 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_online"), "cobj_online");
167 $cb->setInfo($this->lng->txt("cont_online_info"));
168 $this->form->addItem($cb);
169
170
171 //
172 // presentation
173 //
174 $sh = new ilFormSectionHeaderGUI();
175 $sh->setTitle($this->lng->txt("cont_presentation"));
176 $this->form->addItem($sh);
177
178 // display mode (open)
179 // $options = array(
180 // "0" => $this->lng->txt("cont_open_normal"),
181 // "1" => $this->lng->txt("cont_open_iframe_max"),
182 // "2" => $this->lng->txt("cont_open_iframe_defined"),
183 // "5" => $this->lng->txt("cont_open_window_undefined"),
184 // "6" => $this->lng->txt("cont_open_window_defined")
185 // );
186 // $si = new ilSelectInputGUI($this->lng->txt("cont_open"), "open_mode");
187 // $si->setOptions($options);
188 // $si->setValue($this->object->getOpenMode());
189 // $this->form->addItem($si);
190
191 $radg = new ilRadioGroupInputGUI($lng->txt("cont_open"), "open_mode");
192 $op0 = new ilRadioOption($this->lng->txt("cont_open_normal"), "0");
193 $radg->addOption($op0);
194 $op1 = new ilRadioOption($this->lng->txt("cont_open_iframe"), "1");
195 $radg->addOption($op1);
196 $op2 = new ilRadioOption($this->lng->txt("cont_open_window"), "5");
197 $radg->addOption($op2);
198 // width
199 $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width_0");
200 $ni->setMaxLength(4);
201 $ni->setSize(4);
202 $op1->addSubItem($ni);
203 $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width_1");
204 $ni->setMaxLength(4);
205 $ni->setSize(4);
206 $op2->addSubItem($ni);
207 // height
208 $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height_0");
209 $ni->setMaxLength(4);
210 $ni->setSize(4);
211 $ni->setInfo($this->lng->txt("cont_width_height_info"));
212 $op1->addSubItem($ni);
213 $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height_1");
214 $ni->setMaxLength(4);
215 $ni->setSize(4);
216 $ni->setInfo($this->lng->txt("cont_width_height_info"));
217 $op2->addSubItem($ni);
218
219 // force IE to render again
220 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_ie_force_render"), "cobj_ie_force_render");
221 $cb->setValue("y");
222 $cb->setInfo($this->lng->txt("cont_ie_force_render_info"));
223 $op2->addSubItem($cb);
224
225 $this->form->addItem($radg);
226
227
228 // disable top menu
229 //Hide Top Navigation Bar
230 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_nomenu"), "cobj_nomenu");
231 $cb->setValue("y");
232 $cb->setInfo($this->lng->txt("cont_nomenu_info"));
233 $this->form->addItem($cb);
234
235 // disable left-side navigation
236 // Hide Left Navigation Tree
237 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_hidenavig"), "cobj_hidenavig");
238 $cb->setValue("y");
239 $cb->setInfo($this->lng->txt("cont_hidenavig_info"));
240 $this->form->addItem($cb);
241
242 // auto navigation to last visited item
243 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_last_visited"), "cobj_auto_last_visited");
244 $cb->setValue("y");
245 $cb->setInfo($this->lng->txt("cont_auto_last_visited_info"));
246 $this->form->addItem($cb);
247
248 // tile image
249 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
250
251 //
252 // scorm options
253 //
254 $sh = new ilFormSectionHeaderGUI();
255 $sh->setTitle($this->lng->txt("cont_scorm_options"));
256 $this->form->addItem($sh);
257
258 // lesson mode
259 $radg = new ilRadioGroupInputGUI($lng->txt("cont_def_lesson_mode"), "lesson_mode");
260 $op0 = new ilRadioOption($this->lng->txt("cont_sc_less_mode_normal"), "normal");
261 $radg->addOption($op0);
262 $op1 = new ilRadioOption($this->lng->txt("cont_sc_less_mode_browse"), "browse");
263 $radg->addOption($op1);
264 // credit mode
265 $cmradg = new ilRadioGroupInputGUI($lng->txt("cont_credit_mode"), "credit_mode");
266 $cmop0 = new ilRadioOption($this->lng->txt("cont_credit_on"), "credit");
267 $cmradg->addOption($cmop0);
268 $cmop1 = new ilRadioOption($this->lng->txt("cont_credit_off"), "no_credit");
269 $cmradg->addOption($cmop1);
270 $op0->addSubItem($cmradg);
271 // set lesson mode review when completed
272 $options = array(
273 "n" => $this->lng->txt("cont_sc_auto_review_no"),
274 "r" => $this->lng->txt("cont_sc_auto_review_completed_not_failed_or_passed"),
275 "p" => $this->lng->txt("cont_sc_auto_review_passed"),
276 "q" => $this->lng->txt("cont_sc_auto_review_passed_or_failed"),
277 "c" => $this->lng->txt("cont_sc_auto_review_completed"),
278 "d" => $this->lng->txt("cont_sc_auto_review_completed_and_passed"),
279 "y" => $this->lng->txt("cont_sc_auto_review_completed_or_passed"),
280 "s" => $this->lng->txt("cont_sc_store_if_previous_score_was_lower")
281 );
282 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_auto_review_2004"), "auto_review");
283 $si->setOptions($options);
284 $si->setInfo($this->lng->txt("cont_sc_auto_review_info_2004"));
285 $op0->addSubItem($si);
286 // end lesson mode
287 $this->form->addItem($radg);
288
289 // mastery_score
290 if ($this->object->getMasteryScoreValues() != "") {
291 $ni = new ilNumberInputGUI($this->lng->txt("cont_mastery_score_2004"), "mastery_score");
292 $ni->setMaxLength(3);
293 $ni->setSize(3);
294 $ni->setInfo($this->lng->txt("cont_mastery_score_2004_info") . ' ' . $this->object->getMasteryScoreValues());
295 $this->form->addItem($ni);
296 }
297
298 //
299 // rte settings
300 //
301 $sh = new ilFormSectionHeaderGUI();
302 $sh->setTitle($this->lng->txt("cont_rte_settings"));
303 $this->form->addItem($sh);
304
305 // unlimited session timeout
306 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_usession"), "cobj_session");
307 $cb->setValue("y");
308 $cb->setInfo($this->lng->txt("cont_sc_usession_info"));
309 $this->form->addItem($cb);
310
311 // SCORM 2004 fourth edition features
312 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_fourth_edition"), "cobj_fourth_edition");
313 $cb->setValue("y");
314 $cb->setInfo($this->lng->txt("cont_fourth_edition_info"));
315 $this->form->addItem($cb);
316
317 // sequencing
318 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sequencing"), "cobj_sequencing");
319 $cb->setValue("y");
320 $cb->setInfo($this->lng->txt("cont_sequencing_info"));
321 $this->form->addItem($cb);
322
323 // storage of interactions
324 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_interactions"), "cobj_interactions");
325 $cb->setValue("y");
326 $cb->setInfo($this->lng->txt("cont_interactions_info"));
327 $this->form->addItem($cb);
328
329 // objectives
330 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_objectives"), "cobj_objectives");
331 $cb->setValue("y");
332 $cb->setInfo($this->lng->txt("cont_objectives_info"));
333 $this->form->addItem($cb);
334
335 // comments
336 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_comments"), "cobj_comments");
337 $cb->setValue("y");
338 $cb->setInfo($this->lng->txt("cont_comments_info"));
339 $this->form->addItem($cb);
340
341 // time from lms
342 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_time_from_lms"), "cobj_time_from_lms");
343 $cb->setValue("y");
344 $cb->setInfo($this->lng->txt("cont_time_from_lms_info"));
345 $this->form->addItem($cb);
346
347 // check values
348 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_check_values"), "cobj_check_values");
349 $cb->setValue("y");
350 $cb->setInfo($this->lng->txt("cont_check_values_info"));
351 $this->form->addItem($cb);
352
353 // auto cmi.exit to suspend
354 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_suspend"), "cobj_auto_suspend");
355 $cb->setValue("y");
356 $cb->setInfo($this->lng->txt("cont_auto_suspend_info"));
357 $this->form->addItem($cb);
358
359 // settings for student_id
360 $options = array(
361 0 => $this->lng->txt("cont_sc_id_setting_user_id"),
362 1 => $this->lng->txt("cont_sc_id_setting_user_login"),
363 2 => $this->lng->txt("cont_sc_id_setting_user_id_plus_ref_id"),
364 3 => $this->lng->txt("cont_sc_id_setting_user_login_plus_ref_id"),
365 4 => $this->lng->txt("cont_sc_id_setting_user_id_plus_obj_id"),
366 5 => $this->lng->txt("cont_sc_id_setting_user_login_plus_obj_id")
367 );
368 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_id_setting_2004"), "id_setting");
369 $si->setOptions($options);
370 $si->setInfo($this->lng->txt("cont_sc_id_setting_info"));
371 $this->form->addItem($si);
372
373 // settings for student_name
374 $options = array(
375 0 => $this->lng->txt("cont_sc_name_setting_last_firstname"),
376 1 => $this->lng->txt("cont_sc_name_setting_first_lastname"),
377 2 => $this->lng->txt("cont_sc_name_setting_fullname"),
378 3 => $this->lng->txt("cont_sc_name_setting_salutation_lastname"),
379 4 => $this->lng->txt("cont_sc_name_setting_first_name"),
380 9 => $this->lng->txt("cont_sc_name_setting_no_name")
381 );
382 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_name_setting_2004"), "name_setting");
383 $si->setOptions($options);
384 $si->setInfo($this->lng->txt("cont_sc_name_setting_info"));
385 $this->form->addItem($si);
386
387 //
388 // debugging
389 //
390 $sh = new ilFormSectionHeaderGUI();
391 $sh->setTitle($this->lng->txt("cont_debugging"));
392 $this->form->addItem($sh);
393
394 // test tool
395 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_debug"), "cobj_debug");
396 $cb->setValue("y");
397 if ($this->object->getDebugActivated() == false) {
398 $cb->setDisabled(true);
399 $cb->setInfo($this->lng->txt("cont_debug_deactivated"));
400 } else {
401 $cb->setInfo($this->lng->txt("cont_debug_deactivate"));
402 }
403 $this->form->addItem($cb);
404 $this->form->addCommandButton("saveProperties", $lng->txt("save"));
405 }
406
407
411 public function getPropertiesFormValues(): void
412 {
413 $values = array();
414 $values["Fobject_title"] = $this->object->getTitle();
415 $values["Fobject_description"] = $this->object->getLongDescription();
416 if (!$this->object->getOfflineStatus()) {
417 $values["cobj_online"] = true;
418 }
419 $values["open_mode"] = $this->object->getOpenMode();
420 $values["width_0"] = $this->object->getWidth();
421 $values["width_1"] = $this->object->getWidth();
422 $values["height_0"] = $this->object->getHeight();
423 $values["height_1"] = $this->object->getHeight();
424 $values["cobj_ie_force_render"] = $this->object->getIe_force_render();
425 $values["cobj_nomenu"] = $this->object->getNoMenu();
426 $values["cobj_hidenavig"] = $this->object->getHideNavig();
427 $values["cobj_auto_last_visited"] = $this->object->getAuto_last_visited();
428 $values["lesson_mode"] = $this->object->getDefaultLessonMode();
429 $values["credit_mode"] = $this->object->getCreditMode();
430 $values["auto_review"] = $this->object->getAutoReviewChar();
431 $values["mastery_score"] = $this->object->getMasteryScore();
432 $values["cobj_session"] = $this->object->getSession();
433 $values["cobj_fourth_edition"] = $this->object->getFourth_edition();
434 $values["cobj_sequencing"] = $this->object->getSequencing();
435 $values["cobj_interactions"] = $this->object->getInteractions();
436 $values["cobj_objectives"] = $this->object->getObjectives();
437 $values["cobj_comments"] = $this->object->getComments();
438 $values["cobj_time_from_lms"] = $this->object->getTime_from_lms();
439 $values["cobj_check_values"] = $this->object->getCheck_values();
440 $values["cobj_auto_suspend"] = $this->object->getAutoSuspend();
441 $values["id_setting"] = $this->object->getIdSetting();
442 $values["name_setting"] = $this->object->getNameSetting();
443 $values["cobj_debug"] = $this->object->getDebug();
444 $this->form->setValuesByArray($values);
445 }
446
450 public function saveProperties(): void
451 {
453 $obj_service = $this->getObjectService();
454 $this->initPropertiesForm();
455 $this->form->checkInput();
456 if ($this->dic->http()->wrapper()->post()->has('mastery_score')) {
457 $sMasteryScore = $this->dic->http()->wrapper()->post()->retrieve('mastery_score', $this->dic->refinery()->kindlyTo()->string());
458 if ($sMasteryScore !== "") {
459 $this->object->setMasteryScore((int) $sMasteryScore);
460 } else {
461 $this->object->setMasteryScore(null);
462 }
463 }
464
465 $t_auto_review = $this->dic->http()->wrapper()->post()->retrieve('auto_review', $this->dic->refinery()->kindlyTo()->string());
466 $t_auto_suspend = $this->dic->http()->wrapper()->post()->has('cobj_auto_suspend');
467 $t_session = $this->dic->http()->wrapper()->post()->has('cobj_session');
468 if ($t_auto_review === "s") {
469 $t_auto_suspend = true;
470 //if not storing without session
471 $t_session = true;
472 }
473
474 $t_height = $this->object->getHeight();
475 if ($this->dic->http()->wrapper()->post()->retrieve('height_0', $this->dic->refinery()->kindlyTo()->int()) != $this->object->getHeight()) {
476 $t_height = $this->dic->http()->wrapper()->post()->retrieve('height_0', $this->dic->refinery()->kindlyTo()->int());
477 }
478 if ($this->dic->http()->wrapper()->post()->retrieve('height_1', $this->dic->refinery()->kindlyTo()->int()) != $this->object->getHeight()) {
479 $t_height = $this->dic->http()->wrapper()->post()->retrieve('height_1', $this->dic->refinery()->kindlyTo()->int());
480 }
481
482 $t_width = $this->object->getWidth();
483 if ($this->dic->http()->wrapper()->post()->retrieve('width_0', $this->dic->refinery()->kindlyTo()->int()) != $this->object->getWidth()) {
484 $t_width = $this->dic->http()->wrapper()->post()->retrieve('width_0', $this->dic->refinery()->kindlyTo()->int());
485 }
486 if ($this->dic->http()->wrapper()->post()->retrieve('width_1', $this->dic->refinery()->kindlyTo()->int()) != $this->object->getWidth()) {
487 $t_width = $this->dic->http()->wrapper()->post()->retrieve('width_1', $this->dic->refinery()->kindlyTo()->int());
488 }
489
490 $this->object->setOfflineStatus(!($this->dic->http()->wrapper()->post()->has('cobj_online')));
491 $this->object->setOpenMode($this->dic->http()->wrapper()->post()->retrieve('open_mode', $this->dic->refinery()->kindlyTo()->int()));
492 $this->object->setWidth($t_width);
493 $this->object->setHeight($t_height);
494 $this->object->setCreditMode($this->dic->http()->wrapper()->post()->retrieve('credit_mode', $this->dic->refinery()->kindlyTo()->string()));
495 // $this->object->setMaxAttempt($this->dic->http()->wrapper()->post()->retrieve('max_attempt',$this->dic->refinery()->kindlyTo()->int()));
496 $this->object->setAutoReviewChar($t_auto_review);
497 $this->object->setDefaultLessonMode($this->dic->http()->wrapper()->post()->retrieve('lesson_mode', $this->dic->refinery()->kindlyTo()->string()));
498 $this->object->setSession($t_session);
499 $this->object->setNoMenu($this->dic->http()->wrapper()->post()->has('cobj_nomenu'));
500 $this->object->setHideNavig($this->dic->http()->wrapper()->post()->has('cobj_hidenavig'));
501 $this->object->setAuto_last_visited($this->dic->http()->wrapper()->post()->has('cobj_auto_last_visited'));
502 $this->object->setIe_force_render($this->dic->http()->wrapper()->post()->has('cobj_ie_force_render'));
503 $this->object->setFourth_edition($this->dic->http()->wrapper()->post()->has('cobj_fourth_edition'));
504 $this->object->setSequencing($this->dic->http()->wrapper()->post()->has('cobj_sequencing'));
505 $this->object->setInteractions($this->dic->http()->wrapper()->post()->has('cobj_interactions'));
506 $this->object->setObjectives($this->dic->http()->wrapper()->post()->has('cobj_objectives'));
507 $this->object->setComments($this->dic->http()->wrapper()->post()->has('cobj_comments'));
508 $this->object->setTime_from_lms($this->dic->http()->wrapper()->post()->has('cobj_time_from_lms'));
509 $this->object->setCheck_values($this->dic->http()->wrapper()->post()->has('cobj_check_values'));
510 $this->object->setAutoSuspend($t_auto_suspend);
511 // $this->object->setOfflineMode($tmpOfflineMode);
512 $this->object->setDebug($this->dic->http()->wrapper()->post()->has('cobj_debug'));//ilUtil::yn2tf($this->dic->http()->wrapper()->post()->retrieve('cobj_debug',$this->dic->refinery()->kindlyTo()->string())));
513 $this->object->setIdSetting($this->dic->http()->wrapper()->post()->retrieve('id_setting', $this->dic->refinery()->kindlyTo()->int()));
514 $this->object->setNameSetting($this->dic->http()->wrapper()->post()->retrieve('name_setting', $this->dic->refinery()->kindlyTo()->int()));
515 $this->object->setTitle($this->dic->http()->wrapper()->post()->retrieve('Fobject_title', $this->dic->refinery()->kindlyTo()->string()));
516 $this->object->setDescription($this->dic->http()->wrapper()->post()->retrieve('Fobject_description', $this->dic->refinery()->kindlyTo()->string()));
517
518 // tile image
519 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
520
521 $this->object->update();
522 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
523 $this->ctrl->redirect($this, "properties");
524 }
525
529 protected function showTrackingItemsBySco(): bool
530 {
531 $ilTabs = $this->tabs;
532
533 $this->setSubTabs();
534 $ilTabs->setTabActive("cont_tracking_data");
535 $ilTabs->setSubTabActive("cont_tracking_bysco");
536
537 $reports = array('exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','tracInteractionItem','tracInteractionUser','tracInteractionUserAnswers');
538
539 $scoSelected = "all";
540 if ($this->dic->http()->wrapper()->query()->has('scoSelected')) {
541 $scoSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('scoSelected', $this->dic->refinery()->kindlyTo()->string()));
542 }
543 if ($this->dic->http()->wrapper()->post()->has('scoSelected')) {
544 $scoSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('scoSelected', $this->dic->refinery()->kindlyTo()->string()));
545 }
546
547 $this->ctrl->setParameter($this, 'scoSelected', $scoSelected);
548
549 $report = "choose";
550 if ($this->dic->http()->wrapper()->query()->has('report')) {
551 $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
552 }
553 if ($this->dic->http()->wrapper()->post()->has('report')) {
554 $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
555 }
556 $this->ctrl->setParameter($this, 'report', $report);
557 $filter = new ilSCORM2004TrackingItemsPerScoFilterGUI($this, 'showTrackingItemsBySco');
558 $filter->parse($scoSelected, $report, $reports);
559 if ($report === "choose") {
560 $this->tpl->setContent($filter->form->getHTML());
561 } else {
562 $scosSelected = array();
563 if ($scoSelected !== "all") {
564 $scosSelected[] = $scoSelected;
565 } else {
566 $tmpscos = $this->object->getTrackedItems();
567 foreach ($tmpscos as $i => $value) {
568 $scosSelected[] = $value["id"];
569 }
570 }
571 $a_users = ilTrQuery::getParticipantsForObject($this->ref_id);
572 $tbl = new ilSCORM2004TrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItemsBySco', $a_users, $scosSelected, $report);
573 $this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
574 }
575 return true;
576 }
577
578 public function showTrackingItems(): bool
579 {
580 $ilTabs = $this->tabs;
581 $ilAccess = $this->access;
582
583 $ilTabs->setTabActive('cont_tracking_data');
584
585 if ($ilAccess->checkAccess("read_learning_progress", "", $this->object->getRefId())) {
586 $this->setSubTabs();
587 $ilTabs->setSubTabActive('cont_tracking_byuser');
588
589 $reports = array('exportSelectedSuccess','exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportObjGlobalToSystem');
590
591 $userSelected = "all";
592 if ($this->dic->http()->wrapper()->query()->has('userSelected')) {
593 $userSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('userSelected', $this->dic->refinery()->kindlyTo()->string()));
594 }
595 if ($this->dic->http()->wrapper()->post()->has('userSelected')) {
596 $userSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('userSelected', $this->dic->refinery()->kindlyTo()->string()));
597 }
598 $this->ctrl->setParameter($this, 'userSelected', $userSelected);
599
600 $report = "choose";
601 if ($this->dic->http()->wrapper()->query()->has('report')) {
602 $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
603 }
604 if ($this->dic->http()->wrapper()->post()->has('report')) {
605 $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
606 }
607 $this->ctrl->setParameter($this, 'report', $report);
608 $filter = new ilSCORM2004TrackingItemsPerUserFilterGUI($this, 'showTrackingItems');
609 $filter->parse($userSelected, $report, $reports);
610 if ($report === "choose") {
611 $this->tpl->setContent($filter->form->getHTML());
612 } else {
613 $usersSelected = array();
614 if ($userSelected !== "all") {
615 $usersSelected[] = $userSelected;
616 } else {
617 $users = ilTrQuery::getParticipantsForObject($this->ref_id);
618 foreach ($users as $usr) {
619 $user = (int) $usr;
620 if (ilObject::_exists($user) && ilObject::_lookUpType($user) === 'usr') {
621 $usersSelected[] = $user;
622 }
623 }
624 }
625 $scosSelected = array();
626 $tmpscos = $this->object->getTrackedItems();
627 foreach ($tmpscos as $i => $value) {
628 $scosSelected[] = $value["id"];
629 }
630 $tbl = new ilSCORM2004TrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItems', $usersSelected, $scosSelected, $report);
631 $this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
632 }
633 } elseif ($ilAccess->checkAccess("edit_learning_progress", "", $this->object->getRefId())) {
634 $this->modifyTrackingItems();
635 }
636 return true;
637 }
638}
error(string $a_errmsg)
This class represents a checkbox property in a property form.
getNextClass($a_gui_class=null)
@inheritDoc
Error Handling & global info handling uses PEAR error class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Help GUI class.
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a number property in a property form.
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
getPropertiesFormValues()
Get values for properties form.
assignObject()
assign scorm object to scorm gui object
saveProperties()
save scorm 2004 module properties
__construct(array $a_data, int $a_id, bool $a_call_by_reference, ?bool $a_prepare_output=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjSCORMLearningModuleGUI.
ilAccessHandler $access
ilGlobalTemplateInterface $tpl
ilSetting $settings
addHeaderAction()
Add header action menu.
ilToolbarGUI $toolbar
ilLanguage $lng
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getParticipantsForObject(int $a_ref_id)
Get participant ids for given object.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
global $DIC
Definition: feed.php:28
setContent(string $a_html)
Sets content for standard template.
$i
Definition: metadata.php:41
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form( $class_path, string $cmd)
global $ilSetting
Definition: privfeed.php:17