ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 initUploadForm ()
 
 uploadObject ()
 display status information or report errors messages in case of error More...
 
 upload ()
 
 getTemplate ()
 save new learning module to db More...
 
 certificate ()
 Shows the certificate editor. More...
 
 addLocatorItems ()
 
 setSettingsSubTabs ()
 List files. More...
 
 export ()
 
 exportModule ()
 
 getType ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 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] don't belong to the current 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 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...
 
 import ()
 gui functions for GUI export More...
 
 importForm ()
 Show import form. More...
 
 initImportForm (string $new_type)
 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 ()
 
 initCreationForms (string $a_new_type)
 no manual SCORM creation, only import at the time More...
 
 setTabs ()
 
 getTabs ()
 adds tabs to tab gui object More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 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 ()
 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...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. 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...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

ILIAS DI Container $dic
 
int $refId
 
ilCtrl $ctrl
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
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
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

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

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  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ applyUserTableFilter()

ilObjSCORMLearningModuleGUI::applyUserTableFilter ( )
protected
Exceptions
ilCtrlException

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

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

798  : void
799  {
800  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
801  $tbl->writeFilterToSession();
802  $tbl->resetOffset();
803  $this->modifyTrackingItems();
804  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ assignObject()

ilObjSCORMLearningModuleGUI::assignObject ( )
protected

assign scorm object to scorm gui object

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ cancel()

ilObjSCORMLearningModuleGUI::cancel ( )

overwrite..jump back to trackingdata not parent

Exceptions
ilCtrlException

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

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

874  : void
875  {
876  $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_cancel"), true);
877  $this->ctrl->redirect($this, "properties");
878  }
+ Here is the call graph for this function:

◆ cancelDeleteTracking()

ilObjSCORMLearningModuleGUI::cancelDeleteTracking ( )

cancel deletion of export files

Exceptions
ilCtrlException

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

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

855  : void
856  {
857  $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_cancel"), true);
858  $this->ctrl->redirect($this, "modifyTrackingItems");
859  }
+ Here is the call graph for this function:

◆ confirmedDeleteTracking()

ilObjSCORMLearningModuleGUI::confirmedDeleteTracking ( )
Exceptions
ilCtrlException

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

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

864  : void
865  {
866  $this->object->deleteTrackingDataOfUsers($this->post_wrapper->retrieve('user', $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())));
867  $this->ctrl->redirect($this, "modifyTrackingItems");
868  }
+ Here is the call graph for this function:

◆ deleteTrackingForUser()

ilObjSCORMLearningModuleGUI::deleteTrackingForUser ( )

display deletion confirmation screen

Exceptions
ilCtrlException

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

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

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

◆ exportAll()

ilObjSCORMLearningModuleGUI::exportAll ( )
protected

Show export section for all users.

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

945  : void
946  {
947  $this->object->exportSelected(true);
948  }

◆ exportSelectionUsers()

ilObjSCORMLearningModuleGUI::exportSelectionUsers ( )
protected

Export selection for selected users.

Exceptions
ilCtrlException

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

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

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

◆ getMaxFileSize()

ilObjSCORMLearningModuleGUI::getMaxFileSize ( )

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

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

◆ getPropertiesFormValues()

ilObjSCORMLearningModuleGUI::getPropertiesFormValues ( )

Get values for properties form.

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

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

Referenced by properties().

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

◆ import()

ilObjSCORMLearningModuleGUI::import ( )
protected

gui functions for GUI export

Exceptions
ilCtrlException

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

References $source, ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getInput(), importForm(), initImportForm(), ILIAS\Repository\lng(), and ilPropertyFormGUI\setValuesByPost().

884  : void
885  {
886  $form = $this->initImportForm("");
887  if ($form->checkInput()) {
888  $source = $form->getInput('csv');
889  $success = $this->object->importTrackingData($source['tmp_name']);
890  switch ($success) {
891  case true:
892  $this->tpl->setOnScreenMessage('info', 'Tracking data imported', true);
893  $this->ctrl->redirect($this, "showTrackingItems");
894  break;
895  case false:
896  $this->tpl->setOnScreenMessage('info', $this->lng->txt('err_check_input'));
897  $this->importForm();
898  break;
899  }
900  }
901  $this->tpl->setOnScreenMessage('info', $this->lng->txt('err_check_input'));
903  $this->importForm();
904  }
initImportForm(string $new_type)
Init import form.
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-...
$source
Definition: metadata.php:93
+ Here is the call graph for this function:

◆ importForm()

ilObjSCORMLearningModuleGUI::importForm ( )
protected

Show import form.

Exceptions
ilCtrlException

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

References $DIC, ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), initImportForm(), and ILIAS\Repository\lng().

Referenced by import().

910  : void
911  {
912  global $DIC;
913  $ilTabs = $DIC->tabs();
914 
915  $ilTabs->clearTargets();
916  $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showTrackingItems'));
917 
918  $form = $this->initImportForm("");
919  $this->tpl->setContent($form->getHTML());
920  }
initImportForm(string $new_type)
Init import form.
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImportForm()

ilObjSCORMLearningModuleGUI::initImportForm ( string  $new_type)
protected

Init import form.

Exceptions
ilCtrlException

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

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

Referenced by import(), and importForm().

927  {
928  $form = new ilPropertyFormGUI();
929  $form->setFormAction($this->ctrl->getFormAction($this));
930  $form->setTitle($this->lng->txt('cont_import_tracking'));
931  $form->addCommandButton('import', $this->lng->txt('import'));
932  $form->addCommandButton('showTrackingItems', $this->lng->txt('cancel'));
933 
934  $csv = new ilFileInputGUI($this->lng->txt('select_file'), 'csv');
935  $csv->setRequired(true);
936  $csv->setSuffixes(array('csv'));
937  $form->addItem($csv);
938 
939  return $form;
940  }
This class represents a file property in a property form.
setFormAction(string $a_formaction)
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPropertiesForm()

ilObjSCORMLearningModuleGUI::initPropertiesForm ( )

Init properties form.

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

References ilObjectGUI\$object_service, ilObjSAHSLearningModule\_lookupSubType(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilFormPropertyGUI\setInfo(), ilNumberInputGUI\setMaxLength(), ilCheckboxInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by properties(), and saveProperties().

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

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

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

763  : void
764  {
765  global $DIC;
766  $ilAccess = $DIC->access();
767  $ilErr = $DIC["ilErr"];
768  if ($ilAccess->checkAccess("edit_learning_progress", "", $this->refId)) {
769  $privacy = ilPrivacySettings::getInstance();
770  if (!$privacy->enabledSahsProtocolData()) {
771  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
772  }
773 
774  global $DIC;
775  $ilTabs = $DIC->tabs();
776  $ilToolbar = $DIC->toolbar();
777  $ilToolbar->addButton(
778  $this->lng->txt('import'),
779  $this->ctrl->getLinkTarget($this, 'importForm')
780  );
781  $ilToolbar->addButton(
782  $this->lng->txt('cont_export_all'),
783  $this->ctrl->getLinkTarget($this, 'exportAll')
784  );
785 
786  $this->setSubTabs();
787  $ilTabs->setTabActive('cont_tracking_data');
788  $ilTabs->setSubTabActive('cont_tracking_modify');
789  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
790  $tbl->parse();
791  $this->tpl->setContent($tbl->getHTML());
792  }
793  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilErr
Definition: raiseError.php:17
global $DIC
Definition: feed.php:28
+ 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 375 of file class.ilObjSCORMLearningModuleGUI.php.

References $DIC, ilObjectGUI\$obj_id, ilObjectGUI\$type, ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilSubEnabledFormPropertyGUI\addSubItem(), ILIAS\Repository\form(), ILIAS\Repository\lng(), ilFormPropertyGUI\setRequired(), ilObjSAHSLearningModuleGUI\setSettingsSubTabs(), ilRadioOption\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by newModuleVersionUpload().

375  : void
376  {
377  global $DIC;
378  $ilTabs = $DIC->tabs();
379  $this->setSettingsSubTabs();
380  $ilTabs->setSubTabActive('cont_sc_new_version');
381 
382  $obj_id = ilObject::_lookupObjectId($this->refId);
384  $this->form = new ilPropertyFormGUI();
385  //title
386  $this->form->setTitle($this->lng->txt("import_sahs"));
387 
388  // SCORM-type
389  $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
390  $ne->setValue($this->lng->txt("lm_type_" . ilObjSAHSLearningModule::_lookupSubType($this->object->getID())));
391  $this->form->addItem($ne);
392 
393  $options = array();
395  $options[""] = $this->lng->txt("cont_select_from_upload_dir");
397  foreach ($files as $file) {
398  $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
399  $options[$file] = $file;
400  }
401  }
402  if (count($options) > 1) {
403  // choose upload directory
404  $radg = new ilRadioGroupInputGUI($this->lng->txt("cont_choose_file_source"), "file_source");
405  $op0 = new ilRadioOption($this->lng->txt("cont_choose_local"), "local");
406  $radg->addOption($op0);
407  $op1 = new ilRadioOption($this->lng->txt("cont_choose_upload_dir"), "upload_dir");
408  $radg->addOption($op1);
409  $radg->setValue("local");
410 
411  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
412  $fi->setRequired(true);
413  $op0->addSubItem($fi);
414 
415  $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
416  $si->setOptions($options);
417  $op1->addSubItem($si);
418 
419  $this->form->addItem($radg);
420  } else {
421  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
422  $fi->setRequired(true);
423  $this->form->addItem($fi);
424  }
425  $this->form->addCommandButton("newModuleVersionUpload", $this->lng->txt("upload"));
426  $this->form->addCommandButton("cancel", $this->lng->txt("cancel"));
427  $this->form->setFormAction($DIC->ctrl()->getFormAction($this, "newModuleVersionUpload"));
428  $DIC['tpl']->setContent($this->form->getHTML());
429  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a file property in a property form.
static _getUploadDirectory()
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
global $DIC
Definition: feed.php:28
This class represents a property in a property form.
setValue(string $a_value)
static _lookupObjectId(int $ref_id)
setRequired(bool $a_required)
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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 466 of file class.ilObjSCORMLearningModuleGUI.php.

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

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

◆ properties()

ilObjSCORMLearningModuleGUI::properties ( )

scorm module properties

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

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

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('cont_settings');
90 
91  // view
92  $ilToolbar->addButtonInstance($this->object->getViewButton());
93 
94  // lm properties
95  $this->initPropertiesForm();
96  $this->getPropertiesFormValues();
97  $this->tpl->setContent($this->form->getHTML());
98  }
getPropertiesFormValues()
Get values for properties form.
global $DIC
Definition: feed.php:28
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ resetUserTableFilter()

ilObjSCORMLearningModuleGUI::resetUserTableFilter ( )
protected

Reset table filter.

Exceptions
ilCtrlException

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

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

810  : void
811  {
812  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
813  $tbl->resetFilter();
814  $tbl->resetOffset();
815  $this->modifyTrackingItems();
816  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveProperties()

ilObjSCORMLearningModuleGUI::saveProperties ( )
Exceptions
ilCtrlException

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

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

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

◆ setSubTabs()

ilObjSCORMLearningModuleGUI::setSubTabs ( )
Exceptions
ilCtrlException

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

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

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

970  : void
971  {
972  global $DIC;
973  $lng = $DIC->language();
974  $ilTabs = $DIC->tabs();
975  $ilCtrl = $DIC->ctrl();
976  $ilAccess = $DIC->access();
977 
978  if ($ilAccess->checkAccess("read_learning_progress", "", $this->refId)) {
979  $ilTabs->addSubTabTarget(
980  "cont_tracking_byuser",
981  $this->ctrl->getLinkTarget($this, "showTrackingItems"),
982  array("edit", ""),
983  get_class($this)
984  );
985 
986  $ilTabs->addSubTabTarget(
987  "cont_tracking_bysco",
988  $this->ctrl->getLinkTarget($this, "showTrackingItemsBySco"),
989  array("edit", ""),
990  get_class($this)
991  );
992  }
993  if ($ilAccess->checkAccess("edit_learning_progress", "", $this->refId)) {
994  $ilTabs->addSubTabTarget(
995  "cont_tracking_modify",
996  $this->ctrl->getLinkTarget($this, "modifyTrackingItems"),
997  array("edit", ""),
998  get_class($this)
999  );
1000  }
1001  }
global $DIC
Definition: feed.php:28
ilLanguage $lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTrackingItems()

ilObjSCORMLearningModuleGUI::showTrackingItems ( )

Show tracking table.

Exceptions
ilCtrlException

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

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

699  : bool
700  {
701  global $DIC;
702  $ilTabs = $DIC->tabs();
703  $ilAccess = $DIC->access();
704 
705  $ilTabs->setTabActive('cont_tracking_data');
706 
707  if ($ilAccess->checkAccess("read_learning_progress", "", $this->refId)) {
708  $this->setSubTabs();
709  $ilTabs->setSubTabActive('cont_tracking_byuser');
710 
711  $reports = array('exportSelectedSuccess','exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');
712 
713  $userSelected = "all";
714  if ($this->dic->http()->wrapper()->query()->has('userSelected')) {
715  $userSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('userSelected', $this->dic->refinery()->kindlyTo()->string()));
716  }
717  if ($this->dic->http()->wrapper()->post()->has('userSelected')) {
718  $userSelected = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('userSelected', $this->dic->refinery()->kindlyTo()->string()));
719  }
720  $this->ctrl->setParameter($this, 'userSelected', $userSelected);
721 
722  $report = "choose";
723  if ($this->dic->http()->wrapper()->query()->has('report')) {
724  $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->query()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
725  }
726  if ($this->dic->http()->wrapper()->post()->has('report')) {
727  $report = ilUtil::stripSlashes($this->dic->http()->wrapper()->post()->retrieve('report', $this->dic->refinery()->kindlyTo()->string()));
728  }
729  $this->ctrl->setParameter($this, 'report', $report);
730  $filter = new ilSCORMTrackingItemsPerUserFilterGUI($this, 'showTrackingItems');
731  $filter->parse($userSelected, $report, $reports);
732  if ($report === "choose") {
733  $this->tpl->setContent($filter->form->getHTML());
734  } else {
735  $usersSelected = array();
736  if ($userSelected !== "all") {
737  $usersSelected[] = $userSelected;
738  } else {
739  $users = ilTrQuery::getParticipantsForObject($this->ref_id);
740  foreach ($users as $user) {
741  if (ilObject::_exists((int) $user) && ilObject::_lookUpType((int) $user) === 'usr') {
742  $usersSelected[] = (int) $user;
743  }
744  }
745  }
746  $scosSelected = array();
747  $scos = $this->object->getTrackedItems();
748  foreach ($scos as $row) {
749  $scosSelected[] = (int) $row->getId();
750  }
751  $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItems', $usersSelected, $scosSelected, $report);
752  $this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
753  }
754  } elseif ($ilAccess->checkAccess("edit_learning_progress", "", $this->refId)) {
755  $this->modifyTrackingItems();
756  }
757  return true;
758  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
global $DIC
Definition: feed.php:28
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static getParticipantsForObject(int $a_ref_id)
Get participant ids for given object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ showTrackingItemsBySco()

ilObjSCORMLearningModuleGUI::showTrackingItemsBySco ( )
protected
Exceptions
ilCtrlException

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

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

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

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

Referenced by initImportForm().

◆ $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: