ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilObjSCORMLearningModuleGUI Class Reference

Class ilObjSCORMLearningModuleGUI. More...

+ Inheritance diagram for ilObjSCORMLearningModuleGUI:
+ Collaboration diagram for ilObjSCORMLearningModuleGUI:

Public Member Functions

 __construct ($data, int $id, bool $call_by_reference, bool $prepare_output=true)
 Constructor. More...
 
 properties ()
 scorm module properties More...
 
 initPropertiesForm ()
 Init properties form. More...
 
 getPropertiesFormValues ()
 Get values for properties form. More...
 
 newModuleVersion ()
 upload new version of module More...
 
 getMaxFileSize ()
 
 newModuleVersionUpload ()
 
 saveProperties ()
 
 showTrackingItems ()
 Show tracking table. More...
 
 deleteTrackingForUser ()
 display deletion confirmation screen More...
 
 cancelDeleteTracking ()
 cancel deletion of export files More...
 
 confirmedDeleteTracking ()
 
 cancel ()
 overwrite..jump back to trackingdata not parent More...
 
 setSubTabs ()
 
- Public Member Functions inherited from ilObjSAHSLearningModuleGUI
 __construct ($data, int $id, bool $call_by_reference, bool $prepare_output=true)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 properties ()
 module properties More...
 
 saveProperties ()
 
 uploadObject ()
 display status information or report errors messages in case of error More...
 
 upload ()
 
 getTemplate ()
 output main header (title and locator) More...
 
 certificate ()
 Shows the certificate editor. More...
 
 addLocatorItems ()
 
 setSettingsSubTabs ()
 
 export ()
 
 exportModule ()
 
 getType ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 assignObject ()
 assign scorm object to scorm gui object More...
 
 showTrackingItemsBySco ()
 
 modifyTrackingItems ()
 
 applyUserTableFilter ()
 
 resetUserTableFilter ()
 Reset table filter. More...
 
 importTracking ()
 gui functions for GUI export More...
 
 trackingImportForm ()
 Show import form. More...
 
 initTrackingImportForm ()
 Init import form. More...
 
 exportAll ()
 Show export section for all users. More...
 
 exportSelectionUsers ()
 Export selection for selected users. More...
 
- Protected Member Functions inherited from ilObjSAHSLearningModuleGUI
 infoScreen ()
 
 infoScreenForward ()
 
 initCreateForm (string $new_type)
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 setTabs ()
 
 getTabs ()
 adds tabs to tab gui object More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ILIAS DI Container $dic
 
int $refId
 
ilCtrl $ctrl
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Attributes

ilPropertyFormGUI $form
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjSAHSLearningModuleGUI
static _goto (string $a_target)
 goto target course More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSCORMLearningModuleGUI::__construct (   $data,
int  $id,
bool  $call_by_reference,
bool  $prepare_output = true 
)

Constructor.

Reimplemented from ilObjSAHSLearningModuleGUI.

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

47 {
48 global $DIC;
49 $this->dic = $DIC;
50 $this->lng = $DIC->language();
51 $this->ctrl = $DIC->ctrl();
52 $this->tpl = $DIC["tpl"];
53
54 $this->lng->loadLanguageModule("content");
55 $this->lng->loadLanguageModule("search");
56
57 $this->refId = $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int());
58
59 $this->type = "sahs";
61 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References ilObjectGUI\$call_by_reference, ilObjectGUI\$data, $DIC, ilObjectGUI\$id, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ applyUserTableFilter()

ilObjSCORMLearningModuleGUI::applyUserTableFilter ( )
protected
Exceptions
ilCtrlException

Definition at line 795 of file class.ilObjSCORMLearningModuleGUI.php.

795 : void
796 {
797 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
798 $tbl->writeFilterToSession();
799 $tbl->resetOffset();
800 $this->modifyTrackingItems();
801 }

References modifyTrackingItems(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ assignObject()

ilObjSCORMLearningModuleGUI::assignObject ( )
protected

assign scorm object to scorm gui object

Reimplemented from ilObjectGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

66 : void
67 {
68 if ($this->id != 0) {
69 if ($this->call_by_reference) {
70 $this->object = new ilObjSCORMLearningModule((int) $this->id, true);
71 } else {
72 $this->object = new ilObjSCORMLearningModule((int) $this->id, false);
73 }
74 }
75 }
Class ilObjSCORMLearningModule.

◆ cancel()

ilObjSCORMLearningModuleGUI::cancel ( )

overwrite..jump back to trackingdata not parent

Exceptions
ilCtrlException

Definition at line 871 of file class.ilObjSCORMLearningModuleGUI.php.

871 : void
872 {
873 $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_cancel"), true);
874 $this->ctrl->redirect($this, "properties");
875 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ cancelDeleteTracking()

ilObjSCORMLearningModuleGUI::cancelDeleteTracking ( )

cancel deletion of export files

Exceptions
ilCtrlException

Definition at line 852 of file class.ilObjSCORMLearningModuleGUI.php.

852 : void
853 {
854 $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_cancel"), true);
855 $this->ctrl->redirect($this, "modifyTrackingItems");
856 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmedDeleteTracking()

ilObjSCORMLearningModuleGUI::confirmedDeleteTracking ( )
Exceptions
ilCtrlException

Definition at line 861 of file class.ilObjSCORMLearningModuleGUI.php.

861 : void
862 {
863 $this->object->deleteTrackingDataOfUsers($this->post_wrapper->retrieve('user', $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())));
864 $this->ctrl->redirect($this, "modifyTrackingItems");
865 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ deleteTrackingForUser()

ilObjSCORMLearningModuleGUI::deleteTrackingForUser ( )

display deletion confirmation screen

Exceptions
ilCtrlException

Definition at line 819 of file class.ilObjSCORMLearningModuleGUI.php.

819 : void
820 {
821 global $DIC;
822 $ilErr = $DIC["ilErr"];
823
824 if (!$DIC->http()->wrapper()->post()->has('user')) {
825 $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
826 }
827
828 // display confirmation message
829 $cgui = new ilConfirmationGUI();
830 $cgui->setFormAction($this->ctrl->getFormAction($this));
831 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
832 $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteTracking");
833 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeleteTracking");
834 foreach ($DIC->http()->wrapper()->post()->retrieve('user', $DIC->refinery()->kindlyTo()->listOf($DIC->refinery()->kindlyTo()->int())) as $id) {
835 if (ilObject::_exists((int) $id) && ilObject::_lookUpType((int) $id) === "usr") {
836 $user = new ilObjUser((int) $id);
837
838 //was ilUtil::getImageTagByType("sahs", (string) $this->tpl->getValue("TPLPATH")) .
839 $caption = $this->lng->txt("cont_tracking_data") . ": " . $user->getLastname() . ", " . $user->getFirstname();
840
841 $cgui->addItem("user[]", (string) $id, $caption);
842 }
843 }
844
845 $this->tpl->setContent($cgui->getHTML());
846 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User class.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
$ilErr
Definition: raiseError.php:33

References $DIC, ilObjectGUI\$id, $ilErr, ilObjectGUI\$user, ilObject\_exists(), ILIAS\Repository\ctrl(), ilObjUser\getFirstname(), ilObjUser\getLastname(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ exportAll()

ilObjSCORMLearningModuleGUI::exportAll ( )
protected

Show export section for all users.

Definition at line 942 of file class.ilObjSCORMLearningModuleGUI.php.

942 : void
943 {
944 $this->object->exportSelected(true);
945 }

◆ exportSelectionUsers()

ilObjSCORMLearningModuleGUI::exportSelectionUsers ( )
protected

Export selection for selected users.

Exceptions
ilCtrlException

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

951 : void
952 {
953 if (!$this->post_wrapper->has('user')) {
954 //was if (!count((array) $_POST['user'])) {
955 //ilUtil::sendFailure($this->lng->txt('select_one'),true);
956 $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
957 $this->ctrl->redirect($this, 'modifyTrackingItems');
958 } else {
959 $this->object->exportSelected(false, $this->post_wrapper->retrieve('user', $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())));
960 }
961 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getMaxFileSize()

ilObjSCORMLearningModuleGUI::getMaxFileSize ( )

Definition at line 429 of file class.ilObjSCORMLearningModuleGUI.php.

429 : string
430 {
431 // get the value for the maximal uploadable filesize from the php.ini (if available)
432 $umf = get_cfg_var("upload_max_filesize");
433 // get the value for the maximal post data from the php.ini (if available)
434 $pms = get_cfg_var("post_max_size");
435
436 //convert from short-string representation to "real" bytes
437 $multiplier_a = array("K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024);
438
439 $umf_parts = preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
440 $pms_parts = preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
441
442 if (count($umf_parts) == 2) {
443 $umf = $umf_parts[0] * $multiplier_a[$umf_parts[1]];
444 }
445 if (count($pms_parts) == 2) {
446 $pms = $pms_parts[0] * $multiplier_a[$pms_parts[1]];
447 }
448
449 // use the smaller one as limit
450 $max_filesize = min($umf, $pms);
451
452 if (!$max_filesize) {
453 $max_filesize = max($umf, $pms);
454 }
455
456 //format for display in mega-bytes
457 return $max_filesize = sprintf("%.1f MB", $max_filesize / 1024 / 1024);
458 }
PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE

References PREG_SPLIT_DELIM_CAPTURE.

◆ getPropertiesFormValues()

ilObjSCORMLearningModuleGUI::getPropertiesFormValues ( )

Get values for properties form.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

337 : void
338 {
339 $values = array();
340 $values["Fobject_title"] = $this->object->getTitle();
341 $values["Fobject_description"] = $this->object->getLongDescription();
342 if (!$this->object->getOfflineStatus()) {
343 $values["cobj_online"] = true;
344 }
345 // $values["cobj_offline_mode"] = $this->object->getOfflineMode();
346 $values["open_mode"] = $this->object->getOpenMode();
347 $values["width_0"] = $this->object->getWidth();
348 $values["width_1"] = $this->object->getWidth();
349 $values["height_0"] = $this->object->getHeight();
350 $values["height_1"] = $this->object->getHeight();
351 $values["cobj_auto_last_visited"] = $this->object->getAuto_last_visited();
352 $values["auto_continue"] = $this->object->getAutoContinue();
353 $values["lesson_mode"] = $this->object->getDefaultLessonMode();
354 $values["auto_review"] = $this->object->getAutoReviewChar();
355 $values["mastery_score"] = $this->object->getMasteryScore();
356 $values["cobj_session"] = $this->object->getSession();
357 $values["cobj_interactions"] = $this->object->getInteractions();
358 $values["cobj_objectives"] = $this->object->getObjectives();
359 $values["cobj_time_from_lms"] = $this->object->getTime_from_lms();
360 $values["cobj_check_values"] = $this->object->getCheck_values();
361 $values["cobj_auto_suspend"] = $this->object->getAutoSuspend();
362 $values["id_setting"] = $this->object->getIdSetting();
363 $values["name_setting"] = $this->object->getNameSetting();
364 $values["cobj_debug"] = $this->object->getDebug();
365 $this->form->setValuesByArray($values);
366 }
form(?array $class_path, string $cmd, string $submit_caption="")

References ILIAS\Repository\form(), and ILIAS\Repository\object().

Referenced by properties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importTracking()

ilObjSCORMLearningModuleGUI::importTracking ( )
protected

gui functions for GUI export

Exceptions
ilCtrlException

Definition at line 881 of file class.ilObjSCORMLearningModuleGUI.php.

881 : void
882 {
883 $form = $this->initTrackingImportForm("");
884 if ($form->checkInput()) {
885 $source = $form->getInput('csv');
886 $success = $this->object->importTrackingData($source['tmp_name']);
887 switch ($success) {
888 case true:
889 $this->tpl->setOnScreenMessage('info', 'Tracking data imported', true);
890 $this->ctrl->redirect($this, "showTrackingItems");
891 break;
892 case false:
893 $this->tpl->setOnScreenMessage('info', $this->lng->txt('err_check_input'));
894 $this->trackingImportForm();
895 break;
896 }
897 }
898 $this->tpl->setOnScreenMessage('info', $this->lng->txt('err_check_input'));
900 $this->trackingImportForm();
901 }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...

References $form, ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getInput(), initTrackingImportForm(), ILIAS\Repository\lng(), ilPropertyFormGUI\setValuesByPost(), and trackingImportForm().

+ Here is the call graph for this function:

◆ initPropertiesForm()

ilObjSCORMLearningModuleGUI::initPropertiesForm ( )

Init properties form.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

Definition at line 103 of file class.ilObjSCORMLearningModuleGUI.php.

103 : void
104 {
105 $obj_service = $this->object_service;
106 $this->form = new ilPropertyFormGUI();
107 $this->form->setTitle($this->lng->txt("cont_lm_properties"));
108
109 //check/select only once
110 $this->object->checkMasteryScoreValues();
111
112 //title
113 $ti = new ilTextInputGUI($this->lng->txt("title"), "Fobject_title");
114 $ti->setMaxLength(200);
115 $this->form->addItem($ti);
116
117 //description
118 $ti = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject_description");
119 $ti->setCols(40);
120 $ti->setRows(2);
121 $this->form->addItem($ti);
122
123 // SCORM-type
124 $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
125 $ne->setValue($this->lng->txt("lm_type_" . ilObjSAHSLearningModule::_lookupSubType($this->object->getID())));
126 $this->form->addItem($ne);
127
128 // version
129 $ne = new ilNonEditableValueGUI($this->lng->txt("cont_sc_version"), "");
130 $ne->setValue($this->object->getModuleVersion());
131 $ne->setInfo($this->lng->txt("cont_sc_version_info"));
132 $this->form->addItem($ne);
133
134 //
135 // activation
136 //
137 $sh = new ilFormSectionHeaderGUI();
138 $sh->setTitle($this->lng->txt("activation"));
139 $this->form->addItem($sh);
140
141 // online
142 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_online"), "cobj_online");
143 $cb->setInfo($this->lng->txt("cont_online_info"));
144 $this->form->addItem($cb);
145
146
147 //
148 // presentation
149 //
150 $sh = new ilFormSectionHeaderGUI();
151 $sh->setTitle($this->lng->txt("cont_presentation"));
152 $this->form->addItem($sh);
153
154 $radg = new ilRadioGroupInputGUI($this->lng->txt("cont_open"), "open_mode");
155 $op0 = new ilRadioOption($this->lng->txt("cont_open_normal"), "0");
156 $op0->setInfo($this->lng->txt("cont_open_normal_info"));
157 $radg->addOption($op0);
158 $op1 = new ilRadioOption($this->lng->txt("cont_open_iframe"), "1");
159 $op1->setInfo($this->lng->txt("cont_open_iframe_info"));
160 $radg->addOption($op1);
161 $op2 = new ilRadioOption($this->lng->txt("cont_open_window"), "5");
162 $op2->setInfo($this->lng->txt("cont_open_window_info"));
163 $radg->addOption($op2);
164
165 // width
166 $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width_0");
167 $ni->setMaxLength(4);
168 $ni->setSize(4);
169 $op1->addSubItem($ni);
170 $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width_1");
171 $ni->setMaxLength(4);
172 $ni->setSize(4);
173 $op2->addSubItem($ni);
174 // height
175 $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height_0");
176 $ni->setMaxLength(4);
177 $ni->setSize(4);
178 $ni->setInfo($this->lng->txt("cont_width_height_info"));
179 $op1->addSubItem($ni);
180 $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height_1");
181 $ni->setMaxLength(4);
182 $ni->setSize(4);
183 $ni->setInfo($this->lng->txt("cont_width_height_info"));
184 $op2->addSubItem($ni);
185
186 $this->form->addItem($radg);
187
188 // auto navigation to last visited item
189 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_last_visited"), "cobj_auto_last_visited");
190 $cb->setValue("y");
191 $cb->setInfo($this->lng->txt("cont_auto_last_visited_info"));
192 $this->form->addItem($cb);
193
194 // auto continue
195 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_auto_continue"), "auto_continue");
196 $cb->setValue("y");
197 $cb->setInfo($this->lng->txt("cont_sc_auto_continue_info"));
198 $this->form->addItem($cb);
199
200 // tile image
201 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
202
203 //
204 // scorm options
205 //
206 $sh = new ilFormSectionHeaderGUI();
207 $sh->setTitle($this->lng->txt("cont_scorm_options"));
208 $this->form->addItem($sh);
209
210 // lesson mode
211 $radg = new ilRadioGroupInputGUI($this->lng->txt("cont_def_lesson_mode"), "lesson_mode");
212 $op0 = new ilRadioOption($this->lng->txt("cont_sc_less_mode_normal"), "normal");
213 $op0->setInfo($this->lng->txt("cont_sc_less_mode_normal_info"));
214 $radg->addOption($op0);
215 $op1 = new ilRadioOption($this->lng->txt("cont_sc_less_mode_browse"), "browse");
216 $op1->setInfo($this->lng->txt("cont_sc_less_mode_browse_info"));
217 $radg->addOption($op1);
218
219
220 // set lesson mode review when completed
221 $options = array(
222 "n" => $this->lng->txt("cont_sc_auto_review_no"),
223 "y" => $this->lng->txt("cont_sc_auto_review_completed_or_passed"),
224 );
225 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_auto_review_2004"), "auto_review");
226 $si->setOptions($options);
227 // $si->setInfo($this->lng->txt("cont_sc_auto_review_info_12"));
228 $op0->addSubItem($si);
229 // end lesson mode
230 $this->form->addItem($radg);
231
232 // mastery_score
233 if ($this->object->getMasteryScoreValues() != "") {
234 $ni = new ilNumberInputGUI($this->lng->txt("cont_mastery_score_12"), "mastery_score");
235 $ni->setMaxLength(3);
236 $ni->setSize(3);
237 $ni->setInfo($this->lng->txt("cont_mastery_score_12_info") . ' ' . $this->object->getMasteryScoreValues());
238 $this->form->addItem($ni);
239 }
240
241 //
242 // rte settings
243 //
244 $sh = new ilFormSectionHeaderGUI();
245 $sh->setTitle($this->lng->txt("cont_rte_settings"));
246 $this->form->addItem($sh);
247
248 // unlimited session timeout
249 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_usession"), "cobj_session");
250 $cb->setValue("y");
251 $cb->setInfo($this->lng->txt("cont_sc_usession_info"));
252 $this->form->addItem($cb);
253
254 // storage of interactions
255 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_interactions"), "cobj_interactions");
256 $cb->setValue("y");
257 $cb->setInfo($this->lng->txt("cont_interactions_info_12"));
258 $this->form->addItem($cb);
259
260 // objectives
261 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_objectives"), "cobj_objectives");
262 $cb->setValue("y");
263 $cb->setInfo($this->lng->txt("cont_objectives_info"));
264 $this->form->addItem($cb);
265
266 // time from lms
267 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_time_from_lms"), "cobj_time_from_lms");
268 $cb->setValue("y");
269 $cb->setInfo($this->lng->txt("cont_time_from_lms_info"));
270 $this->form->addItem($cb);
271
272 // check values
273 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_check_values"), "cobj_check_values");
274 $cb->setValue("y");
275 $cb->setInfo($this->lng->txt("cont_check_values_info"));
276 $this->form->addItem($cb);
277
278 // auto cmi.core.exit to suspend
279 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_suspend"), "cobj_auto_suspend");
280 $cb->setValue("y");
281 $cb->setInfo($this->lng->txt("cont_auto_suspend_info"));
282 $this->form->addItem($cb);
283
284 // settings for student_id
285 $options = array(
286 0 => $this->lng->txt("cont_sc_id_setting_user_id"),
287 1 => $this->lng->txt("cont_sc_id_setting_user_login"),
288 2 => $this->lng->txt("cont_sc_id_setting_user_id_plus_ref_id"),
289 3 => $this->lng->txt("cont_sc_id_setting_user_login_plus_ref_id"),
290 4 => $this->lng->txt("cont_sc_id_setting_user_id_plus_obj_id"),
291 5 => $this->lng->txt("cont_sc_id_setting_user_login_plus_obj_id")
292 );
293 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_id_setting"), "id_setting");
294 $si->setOptions($options);
295 $si->setInfo($this->lng->txt("cont_sc_id_setting_info"));
296 $this->form->addItem($si);
297
298 // settings for student_name
299 $options = array(
300 0 => $this->lng->txt("cont_sc_name_setting_last_firstname"),
301 1 => $this->lng->txt("cont_sc_name_setting_first_lastname"),
302 2 => $this->lng->txt("cont_sc_name_setting_fullname"),
303 3 => $this->lng->txt("cont_sc_name_setting_salutation_lastname"),
304 4 => $this->lng->txt("cont_sc_name_setting_first_name"),
305 9 => $this->lng->txt("cont_sc_name_setting_no_name")
306 );
307 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_name_setting"), "name_setting");
308 $si->setOptions($options);
309 $si->setInfo($this->lng->txt("cont_sc_name_setting_info"));
310 $this->form->addItem($si);
311
312 //
313 // debugging
314 //
315 $sh = new ilFormSectionHeaderGUI();
316 $sh->setTitle($this->lng->txt("cont_debugging"));
317 $this->form->addItem($sh);
318
319 // test tool
320 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_debug"), "cobj_debug");
321 $cb->setValue("y");
322 if ($this->object->getDebugActivated() == false) {
323 $cb->setDisabled(true);
324 $cb->setInfo($this->lng->txt("cont_debug_deactivated"));
325 } else {
326 $cb->setInfo($this->lng->txt("cont_debug_deactivate12"));
327 }
328 $this->form->addItem($cb);
329 $this->form->addCommandButton("saveProperties", $this->lng->txt("save"));
330 $this->form->setFormAction($this->ctrl->getFormAction($this));
331 }
This class represents a checkbox property in a property form.
This class represents a section header in a property form.
This class represents a non editable value in a property form.
This class represents a number property in a property form.
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
ilObjectService $object_service
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References ilObjectGUI\$object_service, ILIAS\UI\Implementation\Component\Input\Field\$options, ilObjSAHSLearningModule\_lookupSubType(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by properties(), and saveProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTrackingImportForm()

ilObjSCORMLearningModuleGUI::initTrackingImportForm ( )
protected

Init import form.

Exceptions
ilCtrlException

Definition at line 923 of file class.ilObjSCORMLearningModuleGUI.php.

924 {
925 $form = new ilPropertyFormGUI();
926 $form->setFormAction($this->ctrl->getFormAction($this));
927 $form->setTitle($this->lng->txt('cont_import_tracking'));
928 $form->addCommandButton('importTracking', $this->lng->txt('import'));
929 $form->addCommandButton('showTrackingItems', $this->lng->txt('cancel'));
930
931 $csv = new ilFileInputGUI($this->lng->txt('select_file'), 'csv');
932 $csv->setRequired(true);
933 $csv->setSuffixes(array('csv'));
934 $form->addItem($csv);
935
936 return $form;
937 }
This class represents a file property in a property form.
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")

References $form, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), and ilPropertyFormGUI\setTitle().

Referenced by importTracking(), and trackingImportForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyTrackingItems()

ilObjSCORMLearningModuleGUI::modifyTrackingItems ( )
protected
Exceptions
ilCtrlException

Definition at line 760 of file class.ilObjSCORMLearningModuleGUI.php.

760 : void
761 {
762 global $DIC;
763 $ilAccess = $DIC->access();
764 $ilErr = $DIC["ilErr"];
765 if ($ilAccess->checkAccess("edit_learning_progress", "", $this->refId)) {
767 if (!$privacy->enabledSahsProtocolData()) {
768 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
769 }
770
771 global $DIC;
772 $ilTabs = $DIC->tabs();
773 $ilToolbar = $DIC->toolbar();
774 $ilToolbar->addButton(
775 $this->lng->txt('import'),
776 $this->ctrl->getLinkTarget($this, 'trackingImportForm')
777 );
778 $ilToolbar->addButton(
779 $this->lng->txt('cont_export_all'),
780 $this->ctrl->getLinkTarget($this, 'exportAll')
781 );
782
783 $this->setSubTabs();
784 $ilTabs->setTabActive('cont_tracking_data');
785 $ilTabs->setSubTabActive('cont_tracking_modify');
786 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
787 $tbl->parse();
788 $this->tpl->setContent($tbl->getHTML());
789 }
790 }

References $DIC, $ilErr, ilPrivacySettings\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and setSubTabs().

Referenced by applyUserTableFilter(), resetUserTableFilter(), ilObjSCORM2004LearningModuleGUI\showTrackingItems(), and showTrackingItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newModuleVersion()

ilObjSCORMLearningModuleGUI::newModuleVersion ( )

upload new version of module

Definition at line 371 of file class.ilObjSCORMLearningModuleGUI.php.

371 : void
372 {
373 global $DIC;
374 $ilTabs = $DIC->tabs();
375 $this->setSettingsSubTabs();
376 $ilTabs->setSubTabActive('cont_sc_new_version');
377
378 $obj_id = ilObject::_lookupObjectId($this->refId);
380 $this->form = new ilPropertyFormGUI();
381 //title
382 $this->form->setTitle($this->lng->txt("import_sahs_new"));
383
384 $this->form->setDescription($this->lng->txt("import_sahs_info"));
385
386 // SCORM-type
387 $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
388 $ne->setValue($this->lng->txt("lm_type_" . ilObjSAHSLearningModule::_lookupSubType($this->object->getID())));
389 $this->form->addItem($ne);
390
391 $options = array();
393 $options[""] = $this->lng->txt("cont_select_from_upload_dir");
395 foreach ($files as $file) {
396 $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
397 $options[$file] = $file;
398 }
399 }
400 if (count($options) > 1) {
401 // choose upload directory
402 $radg = new ilRadioGroupInputGUI($this->lng->txt("cont_choose_file_source"), "file_source");
403 $op0 = new ilRadioOption($this->lng->txt("cont_choose_local"), "local");
404 $radg->addOption($op0);
405 $op1 = new ilRadioOption($this->lng->txt("cont_choose_upload_dir"), "upload_dir");
406 $radg->addOption($op1);
407 $radg->setValue("local");
408
409 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
410 $fi->setRequired(true);
411 $op0->addSubItem($fi);
412
413 $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
414 $si->setOptions($options);
415 $op1->addSubItem($si);
416
417 $this->form->addItem($radg);
418 } else {
419 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
420 $fi->setRequired(true);
421 $this->form->addItem($fi);
422 }
423 $this->form->addCommandButton("newModuleVersionUpload", $this->lng->txt("upload"));
424 $this->form->addCommandButton("cancel", $this->lng->txt("cancel"));
425 $this->form->setFormAction($DIC->ctrl()->getFormAction($this, "newModuleVersionUpload"));
426 $DIC['tpl']->setContent($this->form->getHTML());
427 }
static _lookupObjectId(int $ref_id)
static _getUploadDirectory()

References $DIC, ilObjectGUI\$obj_id, ILIAS\UI\Implementation\Component\Input\Field\$options, ilObjectGUI\$type, ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ILIAS\Repository\form(), ILIAS\Repository\lng(), and ilObjSAHSLearningModuleGUI\setSettingsSubTabs().

Referenced by newModuleVersionUpload().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newModuleVersionUpload()

ilObjSCORMLearningModuleGUI::newModuleVersionUpload ( )
Exceptions
ilException
ilFileUtilsException

Definition at line 464 of file class.ilObjSCORMLearningModuleGUI.php.

464 : void
465 {
466 global $DIC;
467 $rbacsystem = $DIC->access();
468 $ilErr = $DIC["ilErr"];
469
470 $unzip = PATH_TO_UNZIP;
471 $tocheck = "imsmanifest.xml";
472
473 // check create permission before because the uploaded file will be copied
474 if (!$rbacsystem->checkAccess("write", "", $this->refId)) {
475 $ilErr->raiseError($this->lng->txt("no_create_permission"), $ilErr->WARNING);
476 } elseif ($_FILES["scormfile"]["name"]) {
477 // check if file was uploaded
478 $source = $_FILES["scormfile"]["tmp_name"];
479 if (($source === 'none') || (!$source)) {
480 $this->tpl->setOnScreenMessage('info', $this->lng->txt("upload_error_file_not_found"), true);
481 $this->newModuleVersion();
482 return;
483 }
484 } elseif ($DIC->http()->wrapper()->post()->has('uploaded_file')) {
485 $uploadedFile = $DIC->http()->wrapper()->post()->retrieve('uploaded_file', $DIC->refinery()->kindlyTo()->string());
486 // check if the file is in the ftp directory and readable
487 if (!ilUploadFiles::_checkUploadFile($uploadedFile)) {
488 $ilErr->raiseError($this->lng->txt("upload_error_file_not_found"), $ilErr->MESSAGE);
489 }
490 // copy the uploaded file to the client web dir to analyze the imsmanifest
491 // the copy will be moved to the lm directory or deleted
492 $source = CLIENT_WEB_DIR . "/" . $uploadedFile;
493 ilUploadFiles::_copyUploadFile($uploadedFile, $source);
494 $source_is_copy = true;
495 } else {
496 $this->tpl->setOnScreenMessage('info', $this->lng->txt("upload_error_file_not_found"), true);
497 $this->newModuleVersion();
498 return;
499 }
500 // fim.
501
502 //unzip the imsmanifest-file from new uploaded file
503 $pathinfo = pathinfo($source);
504 $dir = $pathinfo["dirname"];
505 $file = $pathinfo["basename"];
506 $cdir = getcwd();
507 chdir($dir);
508
509 //we need more flexible unzip here than ILIAS standard classes allow
510 $unzipcmd = $unzip . " -o " . ilShellUtil::escapeShellArg($source) . " " . $tocheck;
511 exec($unzipcmd);
512 chdir($cdir);
513 $tmp_file = $dir . "/" . $this->refId . "." . $tocheck;
514
515 ilFileUtils::rename($dir . "/" . $tocheck, $tmp_file);
516 $new_manifest = file_get_contents($tmp_file);
517
518 //remove temp file
519 unlink($tmp_file);
520
521 //get old manifest file
522 $old_manifest = file_get_contents($this->object->getDataDirectory() . "/" . $tocheck);
523
524 //reload fixed version of file
525 $check = '/xmlns="http:\/\/www.imsglobal.org\/xsd\/imscp_v1p1"/';
526 $replace = "xmlns=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2\"";
527 $reload_manifest = preg_replace($check, $replace, $new_manifest);
528
529 //do testing for converted versions as well as earlier ILIAS version messed up utf8 conversion
530 if (strcmp($new_manifest, $old_manifest) == 0 || strcmp(mb_convert_encoding($new_manifest, "UTF-8", mb_detect_encoding($new_manifest)), $old_manifest) == 0 ||
531 strcmp($reload_manifest, $old_manifest) == 0 || strcmp(mb_convert_encoding($reload_manifest, "UTF-8", mb_detect_encoding($reload_manifest)), $old_manifest) == 0) {
532
533 //get exisiting module version
534 $module_version = $this->object->getModuleVersion() + 1;
535
536 if ($_FILES["scormfile"]["name"]) {
537 //build targetdir in lm_data
538 $file_path = $this->object->getDataDirectory() . "/" . $_FILES["scormfile"]["name"] . "." . $module_version;
539 $file_path = str_replace(".zip." . $module_version, "." . $module_version . ".zip", $file_path);
540 //move to data directory and add subfix for versioning
542 $_FILES["scormfile"]["tmp_name"],
543 $_FILES["scormfile"]["name"],
544 $file_path
545 );
546 } else {
547 //build targetdir in lm_data
548 $uploadedFile = $DIC->http()->wrapper()->post()->retrieve('uploaded_file', $DIC->refinery()->kindlyTo()->string());
549 $file_path = $this->object->getDataDirectory() . "/" . $uploadedFile . "." . $module_version;
550 $file_path = str_replace(".zip." . $module_version, "." . $module_version . ".zip", $file_path);
551 // move the already copied file to the lm_data directory
552 ilFileUtils::rename($source, $file_path);
553 }
554
555 //unzip and replace old extracted files
556 $DIC->legacyArchives()->unzip($file_path, null, true);
557 ilFileUtils::renameExecutables($this->object->getDataDirectory()); //(security)
558
559 //increase module version
560 $this->object->setModuleVersion($module_version);
561 $this->object->update();
562
563 //redirect to properties and display success
564 $this->tpl->setOnScreenMessage('info', $this->lng->txt("cont_new_module_added"), true);
565 ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $this->refId);
566 exit;
567 }
568
569 if (isset($source_is_copy)) {
570 unlink($source);
571 }
572
573 $this->tpl->setOnScreenMessage('info', $this->lng->txt("cont_invalid_new_module"), true);
574 $this->newModuleVersion();
575 }
$check
Definition: buildRTE.php:81
static rename(string $a_source, string $a_target)
static renameExecutables(string $a_dir)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
newModuleVersion()
upload new version of module
static escapeShellArg(string $a_arg)
static _copyUploadFile(string $a_file, string $a_target, bool $a_raise_errors=true)
static _checkUploadFile(string $a_file)
static redirect(string $a_script)
const CLIENT_WEB_DIR
Definition: constants.php:47
exit

References $check, $DIC, $ilErr, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_copyUploadFile(), CLIENT_WEB_DIR, ilShellUtil\escapeShellArg(), exit, ILIAS\Repository\lng(), ilFileUtils\moveUploadedFile(), newModuleVersion(), ILIAS\Repository\object(), ilUtil\redirect(), ilFileUtils\rename(), and ilFileUtils\renameExecutables().

+ Here is the call graph for this function:

◆ properties()

ilObjSCORMLearningModuleGUI::properties ( )

scorm module properties

Reimplemented from ilObjSAHSLearningModuleGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

Definition at line 80 of file class.ilObjSCORMLearningModuleGUI.php.

80 : void
81 {
82 global $DIC;
83 $ilToolbar = $DIC->toolbar();
84 $ilTabs = $DIC->tabs();
85
86 // $lng->loadLanguageModule("style");
87
88 $this->setSettingsSubTabs();
89 $ilTabs->setSubTabActive('general');//cont_settings
90
91 // view
92 $ilToolbar->addComponent($this->object->getViewButton());
93
94 // lm properties
95 $this->initPropertiesForm();
97 $this->tpl->setContent($this->form->getHTML());
98 }
getPropertiesFormValues()
Get values for properties form.

References $DIC, ILIAS\Repository\form(), getPropertiesFormValues(), initPropertiesForm(), ILIAS\Repository\object(), and ilObjSAHSLearningModuleGUI\setSettingsSubTabs().

+ Here is the call graph for this function:

◆ resetUserTableFilter()

ilObjSCORMLearningModuleGUI::resetUserTableFilter ( )
protected

Reset table filter.

Exceptions
ilCtrlException

Definition at line 807 of file class.ilObjSCORMLearningModuleGUI.php.

807 : void
808 {
809 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
810 $tbl->resetFilter();
811 $tbl->resetOffset();
812 $this->modifyTrackingItems();
813 }

References modifyTrackingItems(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ saveProperties()

ilObjSCORMLearningModuleGUI::saveProperties ( )
Exceptions
ilCtrlException

Reimplemented from ilObjSAHSLearningModuleGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

Definition at line 580 of file class.ilObjSCORMLearningModuleGUI.php.

580 : void
581 {
582 $obj_service = $this->object_service;
583 $this->initPropertiesForm();
584 if ($this->form->checkInput()) {
585 $this->object->setTitle($this->dic->http()->wrapper()->post()->retrieve('Fobject_title', $this->dic->refinery()->kindlyTo()->string()));
586 $this->object->setDescription($this->dic->http()->wrapper()->post()->retrieve('Fobject_description', $this->dic->refinery()->kindlyTo()->string()));
587
588 if ($this->dic->http()->wrapper()->post()->has('mastery_score')) {
589 $sMasteryScore = $this->dic->http()->wrapper()->post()->retrieve('mastery_score', $this->dic->refinery()->kindlyTo()->string());
590 if ($sMasteryScore !== "") {
591 $this->object->setMasteryScore((int) $sMasteryScore);
592 } else {
593 $this->object->setMasteryScore(null);
594 }
595 }
596
597 $t_height = $this->object->getHeight();
598 if ($this->dic->http()->wrapper()->post()->retrieve('height_0', $this->dic->refinery()->kindlyTo()->int()) != $this->object->getHeight()) {
599 $t_height = $this->dic->http()->wrapper()->post()->retrieve('height_0', $this->dic->refinery()->kindlyTo()->int());
600 }
601 if ($this->dic->http()->wrapper()->post()->retrieve('height_1', $this->dic->refinery()->kindlyTo()->int()) != $this->object->getHeight()) {
602 $t_height = $this->dic->http()->wrapper()->post()->retrieve('height_1', $this->dic->refinery()->kindlyTo()->int());
603 }
604
605 $t_width = $this->object->getWidth();
606 if ($this->dic->http()->wrapper()->post()->retrieve('width_0', $this->dic->refinery()->kindlyTo()->int()) != $this->object->getWidth()) {
607 $t_width = $this->dic->http()->wrapper()->post()->retrieve('width_0', $this->dic->refinery()->kindlyTo()->int());
608 }
609 if ($this->dic->http()->wrapper()->post()->retrieve('width_1', $this->dic->refinery()->kindlyTo()->int()) != $this->object->getWidth()) {
610 $t_width = $this->dic->http()->wrapper()->post()->retrieve('width_1', $this->dic->refinery()->kindlyTo()->int());
611 }
612
613 $this->object->setOfflineStatus(!($this->dic->http()->wrapper()->post()->has('cobj_online')));
614 // $this->object->setOfflineMode($tmpOfflineMode);
615 $this->object->setOpenMode($this->dic->http()->wrapper()->post()->retrieve('open_mode', $this->dic->refinery()->kindlyTo()->int()));
616 $this->object->setWidth($t_width);
617 $this->object->setHeight($t_height);
618 $this->object->setAuto_last_visited($this->dic->http()->wrapper()->post()->has('cobj_auto_last_visited'));
619 $this->object->setAutoContinue($this->dic->http()->wrapper()->post()->has('auto_continue'));
620 // $this->object->setMaxAttempt((int) $_POST["max_attempt"]);
621 $this->object->setDefaultLessonMode($this->dic->http()->wrapper()->post()->retrieve('lesson_mode', $this->dic->refinery()->kindlyTo()->string()));
622 $this->object->setAutoReview(ilUtil::yn2tf($this->dic->http()->wrapper()->post()->retrieve('auto_review', $this->dic->refinery()->kindlyTo()->string())));
623 $this->object->setSession($this->dic->http()->wrapper()->post()->has('cobj_session'));
624 $this->object->setInteractions($this->dic->http()->wrapper()->post()->has('cobj_interactions'));
625 $this->object->setObjectives($this->dic->http()->wrapper()->post()->has('cobj_objectives'));
626 $this->object->setTime_from_lms($this->dic->http()->wrapper()->post()->has('cobj_time_from_lms'));
627 $this->object->setCheck_values($this->dic->http()->wrapper()->post()->has('cobj_check_values'));
628 $this->object->setAutoSuspend($this->dic->http()->wrapper()->post()->has('cobj_auto_suspend'));
629 $this->object->setDebug($this->dic->http()->wrapper()->post()->has('cobj_debug'));
630 $this->object->setIdSetting($this->dic->http()->wrapper()->post()->retrieve('id_setting', $this->dic->refinery()->kindlyTo()->int()));
631 $this->object->setNameSetting($this->dic->http()->wrapper()->post()->retrieve('name_setting', $this->dic->refinery()->kindlyTo()->int()));
632 $this->object->update();
633
634 // tile image
635 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
636 }
637 $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_obj_modified"), true);
638 $this->ctrl->redirect($this, "properties");
639 }
static yn2tf(string $a_yn)

References ilObjectGUI\$object_service, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), initPropertiesForm(), ILIAS\Repository\lng(), and ilUtil\yn2tf().

+ Here is the call graph for this function:

◆ setSubTabs()

ilObjSCORMLearningModuleGUI::setSubTabs ( )
Exceptions
ilCtrlException

Definition at line 967 of file class.ilObjSCORMLearningModuleGUI.php.

967 : void
968 {
969 global $DIC;
970 $lng = $DIC->language();
971 $ilTabs = $DIC->tabs();
972 $ilCtrl = $DIC->ctrl();
973 $ilAccess = $DIC->access();
974
975 if ($ilAccess->checkAccess("read_learning_progress", "", $this->refId)) {
976 $ilTabs->addSubTabTarget(
977 "cont_tracking_byuser",
978 $this->ctrl->getLinkTarget($this, "showTrackingItems"),
979 array("edit", ""),
980 get_class($this)
981 );
982
983 $ilTabs->addSubTabTarget(
984 "cont_tracking_bysco",
985 $this->ctrl->getLinkTarget($this, "showTrackingItemsBySco"),
986 array("edit", ""),
987 get_class($this)
988 );
989 }
990 if ($ilAccess->checkAccess("edit_learning_progress", "", $this->refId)) {
991 $ilTabs->addSubTabTarget(
992 "cont_tracking_modify",
993 $this->ctrl->getLinkTarget($this, "modifyTrackingItems"),
994 array("edit", ""),
995 get_class($this)
996 );
997 }
998 }
ilLanguage $lng

References $DIC, ilObjectGUI\$lng, and ILIAS\Repository\ctrl().

Referenced by modifyTrackingItems(), ilObjSCORM2004LearningModuleGUI\showTrackingItems(), showTrackingItems(), ilObjSCORM2004LearningModuleGUI\showTrackingItemsBySco(), and showTrackingItemsBySco().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTrackingItems()

ilObjSCORMLearningModuleGUI::showTrackingItems ( )

Show tracking table.

Exceptions
ilCtrlException

Reimplemented in ilObjSCORM2004LearningModuleGUI.

Definition at line 696 of file class.ilObjSCORMLearningModuleGUI.php.

696 : bool
697 {
698 global $DIC;
699 $ilTabs = $DIC->tabs();
700 $ilAccess = $DIC->access();
701
702 $ilTabs->setTabActive('cont_tracking_data');
703
704 if ($ilAccess->checkAccess("read_learning_progress", "", $this->refId)) {
705 $this->setSubTabs();
706 $ilTabs->setSubTabActive('cont_tracking_byuser');
707
708 $reports = array('exportSelectedSuccess','exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');
709
710 $userSelected = "all";
711 if ($this->dic->http()->wrapper()->query()->has('userSelected')) {
712 $userSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('userSelected', $this->dic->refinery()->kindlyTo()->string()));
713 }
714 if ($this->dic->http()->wrapper()->post()->has('userSelected')) {
715 $userSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('userSelected', $this->dic->refinery()->kindlyTo()->string()));
716 }
717 $this->ctrl->setParameter($this, 'userSelected', $userSelected);
718
719 $report = "choose";
720 if ($this->dic->http()->wrapper()->query()->has('report')) {
721 $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
722 }
723 if ($this->dic->http()->wrapper()->post()->has('report')) {
724 $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
725 }
726 $this->ctrl->setParameter($this, 'report', $report);
727 $filter = new ilSCORMTrackingItemsPerUserFilterGUI($this, 'showTrackingItems');
728 $filter->parse($userSelected, $report, $reports);
729 if ($report === "choose") {
730 $this->tpl->setContent($filter->form->getHTML());
731 } else {
732 $usersSelected = array();
733 if ($userSelected !== "all") {
734 $usersSelected[] = $userSelected;
735 } else {
736 $users = ilTrQuery::getParticipantsForObject($this->ref_id);
737 foreach ($users as $user) {
738 if (ilObject::_exists((int) $user) && ilObject::_lookUpType((int) $user) === 'usr') {
739 $usersSelected[] = (int) $user;
740 }
741 }
742 }
743 $scosSelected = array();
744 $scos = $this->object->getTrackedItems();
745 foreach ($scos as $row) {
746 $scosSelected[] = (int) $row->getId();
747 }
748 $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItems', $usersSelected, $scosSelected, $report);
749 $this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
750 }
751 } elseif ($ilAccess->checkAccess("edit_learning_progress", "", $this->refId)) {
752 $this->modifyTrackingItems();
753 }
754 return true;
755 }
Class ilSCORMTrackingItemsTableGUI.
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="")

References $DIC, ilObjectGUI\$user, ilObject\_exists(), ILIAS\Repository\ctrl(), ilTrQuery\getParticipantsForObject(), ILIAS\Repository\int(), modifyTrackingItems(), ILIAS\Repository\object(), setSubTabs(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ showTrackingItemsBySco()

ilObjSCORMLearningModuleGUI::showTrackingItemsBySco ( )
protected
Exceptions
ilCtrlException

Reimplemented in ilObjSCORM2004LearningModuleGUI.

Definition at line 644 of file class.ilObjSCORMLearningModuleGUI.php.

644 : bool
645 {
646 global $DIC;
647 $ilTabs = $DIC->tabs();
648
649 $this->setSubTabs();
650 $ilTabs->setTabActive("cont_tracking_data");
651 $ilTabs->setSubTabActive("cont_tracking_bysco");
652
653 $reports = array('exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');//,'tracInteractionItem','tracInteractionUser','tracInteractionUserAnswers'
654 $scoSelected = "all";
655 if ($this->dic->http()->wrapper()->query()->has('scoSelected')) {
656 $scoSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('scoSelected', $this->dic->refinery()->kindlyTo()->string()));
657 }
658 if ($this->dic->http()->wrapper()->post()->has('scoSelected')) {
659 $scoSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('scoSelected', $this->dic->refinery()->kindlyTo()->string()));
660 }
661 $this->ctrl->setParameter($this, 'scoSelected', $scoSelected);
662
663 $report = "choose";
664 if ($this->dic->http()->wrapper()->query()->has('report')) {
665 $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
666 }
667 if ($this->dic->http()->wrapper()->post()->has('report')) {
668 $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
669 }
670 $this->ctrl->setParameter($this, 'report', $report);
671 $filter = new ilSCORMTrackingItemsPerScoFilterGUI($this, 'showTrackingItemsBySco');
672 $filter->parse($scoSelected, $report, $reports);
673 if ($report === "choose") {
674 $this->tpl->setContent($filter->form->getHTML());
675 } else {
676 $scosSelected = array();
677 if ($scoSelected !== "all") {
678 $scosSelected[] = $scoSelected;
679 } else {
680 $scos = $this->object->getTrackedItems();
681 foreach ($scos as $row) {
682 $scosSelected[] = (int) $row->getId();
683 }
684 }
685 $a_users = ilTrQuery::getParticipantsForObject($this->ref_id);
686 $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItemsBySco', $a_users, $scosSelected, $report);
687 $this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
688 }
689 return true;
690 }

References $DIC, ILIAS\Repository\ctrl(), ilTrQuery\getParticipantsForObject(), ILIAS\Repository\int(), ILIAS\Repository\object(), setSubTabs(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ trackingImportForm()

ilObjSCORMLearningModuleGUI::trackingImportForm ( )
protected

Show import form.

Exceptions
ilCtrlException

Definition at line 907 of file class.ilObjSCORMLearningModuleGUI.php.

907 : void
908 {
909 global $DIC;
910 $ilTabs = $DIC->tabs();
911
912 $ilTabs->clearTargets();
913 $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showTrackingItems'));
914
915 $form = $this->initTrackingImportForm();
916 $this->tpl->setContent($form->getHTML());
917 }

References $DIC, $form, ilPropertyFormGUI\getHTML(), initTrackingImportForm(), and ILIAS\Repository\lng().

Referenced by importTracking().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

◆ $dic

ILIAS DI Container ilObjSCORMLearningModuleGUI::$dic
protected

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

◆ $form

ilPropertyFormGUI ilObjSCORMLearningModuleGUI::$form
private

◆ $refId

int ilObjSCORMLearningModuleGUI::$refId
protected

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


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