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

Class ilObjSCORMLearningModuleGUI. More...

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

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor. More...
 
 assignObject ()
 assign scorm object to scorm gui object More...
 
 properties ()
 scorm module properties More...
 
 newModuleVersion ()
 upload new version of module More...
 
 getMaxFileSize ()
 
 newModuleVersionUpload ()
 
 saveProperties ()
 save properties More...
 
 showTrackingItems ()
 Show tracking table @global ilTabs $ilTabs $global ilToolbar $ilToolbar. More...
 
 deleteTrackingForUser ()
 display deletion confirmation screen More...
 
 cancelDeleteTracking ()
 cancel deletion of export files More...
 
 confirmedDeleteTracking ()
 
 cancel ()
 overwrite..jump back to trackingdata not parent More...
 
 decreaseAttempts ()
 
 setSubTabs ()
 
 cancelStopUserOfflineMode ()
 
 confirmedStopUserOfflineMode ()
 
- Public Member Functions inherited from ilObjSAHSLearningModuleGUI
 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 viewObject ()
 list childs of current object More...
 
 properties ()
 module properties More...
 
 saveProperties ()
 save properties More...
 
 initCreationForms ($a_new_type)
 no manual SCORM creation, only import at the time More...
 
 initCreationForm ()
 Init form. More...
 
 initUploadForm ()
 Init upload form. More...
 
 uploadObject ()
 display status information or report errors messages in case of error More...
 
 upload ()
 
 saveObject ()
 save new learning module to db More...
 
 info ()
 permission form More...
 
 owner ()
 show owner of learning module More...
 
 getTemplate ()
 output main header (title and locator) More...
 
 setTabs ()
 output tabs More...
 
 certificate ()
 Shows the certificate editor. More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 editContent ()
 List files. More...
 
 setSettingsSubTabs ()
 set Tabs for settings More...
 
 export ()
 
 exportModule ()
 
 getType ()
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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 @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Data Fields

const EXPORT_UNDEF = 0
 
const EXPORT_ALL = 1
 
const EXPORT_SELECTED = 2
 
const EXPORT_TYPE_RAW = 1
 
const EXPORT_TYPE_SUCCESS = 2
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 showTrackingItemsBySco ()
 show tracking data More...
 
 modifyTrackingItems ()
 
 applyUserTableFilter ()
 Apply table filter. More...
 
 resetUserTableFilter ()
 Reset table filter. More...
 
 import ()
 gui functions for GUI export More...
 
 importForm ()
 Show import form. More...
 
 initImportForm ($a_new_type)
 Init import form. More...
 
 exportAll ()
 Show export section for all users. More...
 
 exportSelectionUsers ()
 Export selection for selected users. More...
 
 showTrackingItem ()
 show tracking data of item More...
 
 showTrackingItemSco ()
 show tracking data of item More...
 
 showTrackingItemPerUser ()
 show tracking data of item per user More...
 
 offlineModeManager ()
 Manage offline mode for users @global ilTabs $ilTabs $global ilToolbar $ilToolbar. More...
 
 stopUserOfflineMode ()
 Stop offline mode for selected users. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_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...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjSAHSLearningModuleGUI
static _goto ($a_target)
 goto target course More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSCORMLearningModuleGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor.

@access public

Reimplemented from ilObjSAHSLearningModuleGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

42 {
43 global $DIC;
44 $lng = $DIC['lng'];
45
46 $lng->loadLanguageModule("content");
47 $lng->loadLanguageModule("search");
48
49 $this->type = "sahs";
50 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
51 }
global $DIC
Definition: saml.php:7

References $DIC, and ilObjectGUI\$lng.

Member Function Documentation

◆ applyUserTableFilter()

ilObjSCORMLearningModuleGUI::applyUserTableFilter ( )
protected

Apply table filter.

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

806 {
807 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
808 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
809 $tbl->writeFilterToSession();
810 $tbl->resetOffset();
811 $this->modifyTrackingItems();
812 }
$tbl
Definition: example_048.php:81

References $tbl, and modifyTrackingItems().

+ Here is the call graph for this function:

◆ assignObject()

ilObjSCORMLearningModuleGUI::assignObject ( )

assign scorm object to scorm gui object

Reimplemented from ilObjectGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

57 {
58 if ($this->id != 0) {
59 if ($this->call_by_reference) {
60 $this->object = new ilObjSCORMLearningModule($this->id, true);
61 } else {
62 $this->object = new ilObjSCORMLearningModule($this->id, false);
63 }
64 }
65 }
Class ilObjSCORMLearningModule.

◆ cancel()

ilObjSCORMLearningModuleGUI::cancel ( )

overwrite..jump back to trackingdata not parent

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

878 {
879 ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
880 $this->ctrl->redirect($this, "properties");
881 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ cancelDeleteTracking()

ilObjSCORMLearningModuleGUI::cancelDeleteTracking ( )

cancel deletion of export files

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

863 {
864 ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
865 $this->ctrl->redirect($this, "modifyTrackingItems");
866 }

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ cancelStopUserOfflineMode()

ilObjSCORMLearningModuleGUI::cancelStopUserOfflineMode ( )

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

1136 {
1137 ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
1138 $this->ctrl->redirect($this, "offlineModeManager");
1139 }

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ confirmedDeleteTracking()

ilObjSCORMLearningModuleGUI::confirmedDeleteTracking ( )

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

869 {
870 $this->object->deleteTrackingDataOfUsers($_POST["user"]);
871 $this->ctrl->redirect($this, "modifyTrackingItems");
872 }
$_POST["username"]

References $_POST.

◆ confirmedStopUserOfflineMode()

ilObjSCORMLearningModuleGUI::confirmedStopUserOfflineMode ( )

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

1142 {
1143 include_once './Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php';
1144 foreach ($_POST["user"] as $id) {
1145 ilSCORMOfflineMode::stopOfflineModeForUser($this->object->getId(), $id);
1146 }
1147
1148 $this->offlineModeManager();
1149 }
offlineModeManager()
Manage offline mode for users @global ilTabs $ilTabs $global ilToolbar $ilToolbar.
static stopOfflineModeForUser($obj_id, $user_id)
if(!array_key_exists('StateId', $_REQUEST)) $id

References $_POST, $id, offlineModeManager(), and ilSCORMOfflineMode\stopOfflineModeForUser().

+ Here is the call graph for this function:

◆ decreaseAttempts()

ilObjSCORMLearningModuleGUI::decreaseAttempts ( )

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

967 {
968 if (!isset($_POST["user"])) {
969 ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
970 }
971 $this->object->decreaseAttemptsForUser($_POST["user"]);
972 $this->ctrl->redirect($this, "modifyTrackingItems");
973 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ deleteTrackingForUser()

ilObjSCORMLearningModuleGUI::deleteTrackingForUser ( )

display deletion confirmation screen

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

830 {
831 if (!isset($_POST["user"])) {
832 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
833 }
834
835 // display confirmation message
836 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
837 $cgui = new ilConfirmationGUI();
838 $cgui->setFormAction($this->ctrl->getFormAction($this));
839 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
840 $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteTracking");
841 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeleteTracking");
842
843 foreach ($_POST["user"] as $id) {
844 if (ilObject::_exists($id) && ilObject::_lookUpType($id) == "usr") {
845 $user = new ilObjUser($id);
846
847 $caption = ilUtil::getImageTagByType("sahs", $this->tpl->tplPath) .
848 " " . $this->lng->txt("cont_tracking_data") .
849 ": " . $user->getLastname() . ", " . $user->getFirstname();
850
851
852 $cgui->addItem("user[]", $id, $caption);
853 }
854 }
855
856 $this->tpl->setContent($cgui->getHTML());
857 }
Confirmation screen class.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
redirection script todo: (a better solution should control the processing via a xml file)

References $_POST, $id, ilObjectGUI\$user, ilObject\_exists(), and ilUtil\getImageTagByType().

+ Here is the call graph for this function:

◆ exportAll()

ilObjSCORMLearningModuleGUI::exportAll ( )
protected

Show export section for all users.

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

947 {
948 $this->object->exportSelected(1);
949 }

◆ exportSelectionUsers()

ilObjSCORMLearningModuleGUI::exportSelectionUsers ( )
protected

Export selection for selected users.

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

955 {
956 if (!count((array) $_POST['user'])) {
957 //ilUtil::sendFailure($this->lng->txt('select_one'),true);
958 ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
959 $this->ctrl->redirect($this, 'modifyTrackingItems');
960 } else {
961 $this->object->exportSelected(0, $_POST["user"]);
962 }
963 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ getMaxFileSize()

ilObjSCORMLearningModuleGUI::getMaxFileSize ( )

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

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

References PREG_SPLIT_DELIM_CAPTURE.

◆ import()

ilObjSCORMLearningModuleGUI::import ( )
protected

gui functions for GUI export

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

887 {
888 $form = $this->initImportForm("");
889 if ($form->checkInput()) {
890 $source = $form->getInput('csv');
891 $error = $this->object->importTrackingData($source['tmp_name']);
892 switch ($error) {
893 case 0:
894 ilUtil::sendInfo('Tracking data imported', true);
895 $this->ctrl->redirect($this, "showTrackingItems");
896 break;
897 case -1:
898 ilUtil::sendInfo($this->lng->txt('err_check_input'));
899 $this->importForm();
900 break;
901 }
902 }
903 ilUtil::sendInfo($this->lng->txt('err_check_input'));
904 $form->setValuesByPost();
905 $this->importForm();
906 }
$source
Definition: linkback.php:22
initImportForm($a_new_type)
Init import form.
if(isset($_POST['submit'])) $form

References $form, $source, importForm(), initImportForm(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ importForm()

ilObjSCORMLearningModuleGUI::importForm ( )
protected

Show import form.

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

912 {
913 global $DIC;
914 $ilTabs = $DIC['ilTabs'];
915
916 $ilTabs->clearTargets();
917 $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showTrackingItems'));
918
919 $form = $this->initImportForm("");
920 $this->tpl->setContent($form->getHTML());
921 }

References $DIC, $form, and initImportForm().

Referenced by import().

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

◆ initImportForm()

ilObjSCORMLearningModuleGUI::initImportForm (   $a_new_type)
protected

Init import form.

Reimplemented from ilObjectGUI.

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

927 {
928 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
929 $form = new ilPropertyFormGUI();
930 $form->setFormAction($this->ctrl->getFormAction($this));
931 $form->setTitle($this->lng->txt('cont_import_tracking'));
932 $form->addCommandButton('import', $this->lng->txt('import'));
933 $form->addCommandButton('showTrackingItems', $this->lng->txt('cancel'));
934
935 $csv = new ilFileInputGUI($this->lng->txt('select_file'), 'csv');
936 $csv->setRequired(true);
937 $csv->setSuffixes(array('csv'));
938 $form->addItem($csv);
939
940 return $form;
941 }
This class represents a file property in a property form.
This class represents a property form user interface.

References $form.

Referenced by import(), and importForm().

+ Here is the caller graph for this function:

◆ modifyTrackingItems()

ilObjSCORMLearningModuleGUI::modifyTrackingItems ( )
protected

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

766 {
767 global $DIC;
768 $ilAccess = $DIC['ilAccess'];
769 if ($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
770 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
772 if (!$privacy->enabledSahsProtocolData()) {
773 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
774 }
775
776 global $DIC;
777 $ilTabs = $DIC['ilTabs'];
778 $ilToolbar = $DIC['ilToolbar'];
779
780 include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
781 $ilToolbar->addButton(
782 $this->lng->txt('import'),
783 $this->ctrl->getLinkTarget($this, 'importForm')
784 );
785 $ilToolbar->addButton(
786 $this->lng->txt('cont_export_all'),
787 $this->ctrl->getLinkTarget($this, 'exportAll')
788 );
789
791 $ilTabs->setTabActive('cont_tracking_data');
792 $ilTabs->setSubTabActive('cont_tracking_modify');
793
794 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
795 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
796 $tbl->parse();
797 $this->tpl->setContent($tbl->getHTML());
798 }
799 }
$_GET["client_id"]
static _getInstance()
Get instance of ilPrivacySettings.

References $_GET, $DIC, $tbl, ilPrivacySettings\_getInstance(), 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 365 of file class.ilObjSCORMLearningModuleGUI.php.

366 {
367 global $DIC;
368 $ilTabs = $DIC['ilTabs'];
370 $ilTabs->setSubTabActive('cont_sc_new_version');
371
374
375 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
376 $this->form = new ilPropertyFormGUI();
377 //title
378 $this->form->setTitle($this->lng->txt("import_sahs"));
379
380 // SCORM-type
381 $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
382 $ne->setValue($this->lng->txt("lm_type_" . ilObjSAHSLearningModule::_lookupSubType($this->object->getID())));
383 $this->form->addItem($ne);
384
385 $options = array();
386 include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
388 $options[""] = $this->lng->txt("cont_select_from_upload_dir");
390 foreach ($files as $file) {
391 $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
392 $options[$file] = $file;
393 }
394 }
395 if (count($options) > 1) {
396 // choose upload directory
397 $radg = new ilRadioGroupInputGUI($this->lng->txt("cont_choose_file_source"), "file_source");
398 $op0 = new ilRadioOption($this->lng->txt("cont_choose_local"), "local");
399 $radg->addOption($op0);
400 $op1 = new ilRadioOption($this->lng->txt("cont_choose_upload_dir"), "upload_dir");
401 $radg->addOption($op1);
402 $radg->setValue("local");
403
404 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
405 $fi->setRequired(true);
406 $op0->addSubItem($fi);
407
408 $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
409 $si->setOptions($options);
410 $op1->addSubItem($si);
411
412 $this->form->addItem($radg);
413 } else {
414 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
415 $fi->setRequired(true);
416 $this->form->addItem($fi);
417 }
418 $this->form->addCommandButton("newModuleVersionUpload", $this->lng->txt("upload"));
419 $this->form->addCommandButton("cancel", $this->lng->txt("cancel"));
420 $this->form->setFormAction($DIC['ilCtrl']->getFormAction($this, "newModuleVersionUpload"));
421 $DIC['tpl']->setContent($this->form->getHTML());
422 }
This class represents a non editable value in a property form.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
getFormAction($a_cmd, $a_formaction="")
get form action for command (command is method name without "Object", e.g.
static _lookupObjectId($a_ref_id)
lookup object id
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.
static _getUploadFiles()
Get a list of readable files in the upload directory.
static _getUploadDirectory()
Get the directory with uploaded files.
$files
Definition: metarefresh.php:49
$type

References $_GET, $DIC, $files, ilObjectGUI\$obj_id, PHPMailer\PHPMailer\$options, $si, $type, ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilObjectGUI\getFormAction(), 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 ( )

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

458 {
459 global $DIC;
460 $rbacsystem = $DIC['rbacsystem'];
461
462 $unzip = PATH_TO_UNZIP;
463 $tocheck = "imsmanifest.xml";
464
465 include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
466
467 // check create permission before because the uploaded file will be copied
468 if (!$rbacsystem->checkAccess("write", $_GET["ref_id"])) {
469 $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
470 } elseif ($_FILES["scormfile"]["name"]) {
471 // check if file was uploaded
472 $source = $_FILES["scormfile"]["tmp_name"];
473 if (($source == 'none') || (!$source)) {
474 ilUtil::sendInfo($this->lng->txt("upload_error_file_not_found"), true);
475 $this->newModuleVersion();
476 return;
477 }
478 } elseif ($_POST["uploaded_file"]) {
479 // check if the file is in the ftp directory and readable
480 if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"])) {
481 $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"), $this->ilias->error_obj->MESSAGE);
482 }
483 // copy the uploaded file to the client web dir to analyze the imsmanifest
484 // the copy will be moved to the lm directory or deleted
485 $source = CLIENT_WEB_DIR . "/" . $_POST["uploaded_file"];
487 $source_is_copy = true;
488 } else {
489 ilUtil::sendInfo($this->lng->txt("upload_error_file_not_found"), true);
490 $this->newModuleVersion();
491 return;
492 }
493 // fim.
494
495 //unzip the imsmanifest-file from new uploaded file
496 $pathinfo = pathinfo($source);
497 $dir = $pathinfo["dirname"];
498 $file = $pathinfo["basename"];
499 $cdir = getcwd();
500 chdir($dir);
501
502 //we need more flexible unzip here than ILIAS standard classes allow
503 $unzipcmd = $unzip . " -o " . ilUtil::escapeShellArg($source) . " " . $tocheck;
504 exec($unzipcmd);
505 chdir($cdir);
506 $tmp_file = $dir . "/" . $_GET["ref_id"] . "." . $tocheck;
507
508 ilFileUtils::rename($dir . "/" . $tocheck, $tmp_file);
509 $new_manifest = file_get_contents($tmp_file);
510
511 //remove temp file
512 unlink($tmp_file);
513
514 //get old manifest file
515 $old_manifest = file_get_contents($this->object->getDataDirectory() . "/" . $tocheck);
516
517 //reload fixed version of file
518 $check = '/xmlns="http:\/\/www.imsglobal.org\/xsd\/imscp_v1p1"/';
519 $replace = "xmlns=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2\"";
520 $reload_manifest = preg_replace($check, $replace, $new_manifest);
521
522 //do testing for converted versions as well as earlier ILIAS version messed up utf8 conversion
523 if (strcmp($new_manifest, $old_manifest) == 0 || strcmp(utf8_encode($new_manifest), $old_manifest) == 0 ||
524 strcmp($reload_manifest, $old_manifest) == 0 || strcmp(utf8_encode($reload_manifest), $old_manifest) == 0) {
525
526 //get exisiting module version
527 $module_version = $this->object->getModuleVersion() + 1;
528
529 if ($_FILES["scormfile"]["name"]) {
530 //build targetdir in lm_data
531 $file_path = $this->object->getDataDirectory() . "/" . $_FILES["scormfile"]["name"] . "." . $module_version;
532 $file_path = str_replace(".zip." . $module_version, "." . $module_version . ".zip", $file_path);
533 //move to data directory and add subfix for versioning
534 ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"], $_FILES["scormfile"]["name"], $file_path);
535 } else {
536 //build targetdir in lm_data
537 $file_path = $this->object->getDataDirectory() . "/" . $_POST["uploaded_file"] . "." . $module_version;
538 $file_path = str_replace(".zip." . $module_version, "." . $module_version . ".zip", $file_path);
539 // move the already copied file to the lm_data directory
540 ilFileUtils::rename($source, $file_path);
541 }
542
543 //unzip and replace old extracted files
544 ilUtil::unzip($file_path, true);
545 ilUtil::renameExecutables($this->object->getDataDirectory()); //(security)
546
547 //increase module version
548 $this->object->setModuleVersion($module_version);
549 $this->object->update();
550
551 //redirect to properties and display success
552 ilUtil::sendInfo($this->lng->txt("cont_new_module_added"), true);
553 ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $_GET["ref_id"]);
554 exit;
555 } else {
556 if ($source_is_copy) {
557 unlink($source);
558 }
559
560 ilUtil::sendInfo($this->lng->txt("cont_invalid_new_module"), true);
561 $this->newModuleVersion();
562 }
563 }
exit
Definition: backend.php:16
static rename($a_source, $a_target)
Rename a file.
newModuleVersion()
upload new version of module
static _copyUploadFile($a_file, $a_target, $a_raise_errors=true)
copy an uploaded file to the target directory (including virus check)
static _checkUploadFile($a_file)
Check if a file exists in the upload directory and is readable.
static escapeShellArg($a_arg)
static redirect($a_script)
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.

References $_GET, $_POST, $DIC, $source, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_copyUploadFile(), ilUtil\escapeShellArg(), exit, newModuleVersion(), ilUtil\redirect(), ilFileUtils\rename(), ilUtil\renameExecutables(), ilUtil\sendInfo(), and ilUtil\unzip().

+ Here is the call graph for this function:

◆ offlineModeManager()

ilObjSCORMLearningModuleGUI::offlineModeManager ( )
protected

Manage offline mode for users @global ilTabs $ilTabs $global ilToolbar $ilToolbar.

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

1087 {
1088 global $DIC;
1089 $rbacsystem = $DIC['rbacsystem'];
1090 $tree = $DIC['tree'];
1091 $tpl = $DIC['tpl'];
1092 $lng = $DIC['lng'];
1093 $ilToolbar = $DIC['ilToolbar'];
1094 $ilCtrl = $DIC['ilCtrl'];
1095 $ilSetting = $DIC['ilSetting'];
1096
1097 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1098 if (!ilLearningProgressAccess::checkAccess($this->object->getRefId()) && !$rbacsystem->checkAccess("edit_permission", "", $this->object->getRefId())) {
1099 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
1100 }
1101
1102 include_once './Modules/ScormAicc/classes/class.ilSCORMOfflineModeUsersTableGUI.php';
1103 $tbl = new ilSCORMOfflineModeUsersTableGUI($this->object->getId(), $this, 'offlineModeManager');
1104 $tbl->parse();
1105 $this->tpl->setContent($tbl->getHTML());
1106 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
GUI class ilSCORMOfflineModeUsersTableGUI.
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:17

References $DIC, $ilCtrl, $ilSetting, ilObjectGUI\$lng, $tbl, ilObjectGUI\$tpl, ilObjectGUI\$tree, and ilLearningProgressAccess\checkAccess().

Referenced by confirmedStopUserOfflineMode().

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

◆ properties()

ilObjSCORMLearningModuleGUI::properties ( )

scorm module properties

Reimplemented from ilObjSAHSLearningModuleGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

71 {
72 global $DIC;
73 $rbacsystem = $DIC['rbacsystem'];
74 $tree = $DIC['tree'];
75 $tpl = $DIC['tpl'];
76 $lng = $DIC['lng'];
77 $ilToolbar = $DIC['ilToolbar'];
78 $ilCtrl = $DIC['ilCtrl'];
79 $ilSetting = $DIC['ilSetting'];
80 $ilTabs = $DIC['ilTabs'];
81
82 $obj_service = $this->getObjectService();
83
84 $lng->loadLanguageModule("style");
85
87 $ilTabs->setSubTabActive('cont_settings');
88
89 // view
90 $ilToolbar->addButtonInstance($this->object->getViewButton());
91
92 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
93 $this->form = new ilPropertyFormGUI();
94 $this->form->setFormAction($ilCtrl->getFormAction($this));
95 $this->form->setTitle($this->lng->txt("cont_lm_properties"));
96
97 //check/select only once
98 $this->object->checkMasteryScoreValues();
99
100 //title
101 $ti = new ilTextInputGUI($this->lng->txt("title"), "Fobject_title");
102 $ti->setMaxLength(200);
103 $ti->setValue($this->object->getTitle());
104 $this->form->addItem($ti);
105
106 //description
107 $ti = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject_description");
108 $ti->setValue($this->object->getDescription());
109 $this->form->addItem($ti);
110
111 // SCORM-type
112 $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
113 $ne->setValue($this->lng->txt("lm_type_" . ilObjSAHSLearningModule::_lookupSubType($this->object->getID())));
114 $this->form->addItem($ne);
115
116 // version
117 $ne = new ilNonEditableValueGUI($this->lng->txt("cont_sc_version"), "");
118 $ne->setValue($this->object->getModuleVersion());
119 $ne->setInfo($this->lng->txt("cont_sc_version_info"));
120 $this->form->addItem($ne);
121
122 //
123 // activation
124 //
125 $sh = new ilFormSectionHeaderGUI();
126 $sh->setTitle($this->lng->txt("activation"));
127 $this->form->addItem($sh);
128
129 // online
130 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_online"), "cobj_online");
131 if (!$this->object->getOfflineStatus()) {
132 $cb->setChecked(true);
133 }
134 $cb->setInfo($this->lng->txt("cont_online_info"));
135 $this->form->addItem($cb);
136
137 // offline Mode
138 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_offline_mode_allow"), "cobj_offline_mode");
139 $cb->setValue("y");
140 $cb->setChecked($this->object->getOfflineMode());
141 include_once("./Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php");
142 if ($this->object->getOfflineMode() == true && ilSCORMOfflineMode::checkIfAnyoneIsInOfflineMode($this->object->getID()) == true) {
143 $cb->setDisabled(true);
144 $cb->setInfo($this->lng->txt("cont_offline_mode_disable_not_allowed_info"));
145 } else {
146 $cb->setInfo($this->lng->txt("cont_offline_mode_allow_info"));
147 }
148 $this->form->addItem($cb);
149
150 //
151 // presentation
152 //
153 $sh = new ilFormSectionHeaderGUI();
154 $sh->setTitle($this->lng->txt("cont_presentation"));
155 $this->form->addItem($sh);
156
157 $radg = new ilRadioGroupInputGUI($lng->txt("cont_open"), "open_mode");
158 $op0 = new ilRadioOption($this->lng->txt("cont_open_normal"), "0");
159 $radg->addOption($op0);
160 $op1 = new ilRadioOption($this->lng->txt("cont_open_iframe"), "1");
161 $radg->addOption($op1);
162 $op2 = new ilRadioOption($this->lng->txt("cont_open_window"), "5");
163 $radg->addOption($op2);
164 $radg->setValue($this->object->getOpenMode());
165
166 // width
167 $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width_0");
168 $ni->setMaxLength(4);
169 $ni->setSize(4);
170 $ni->setValue($this->object->getWidth());
171 $op1->addSubItem($ni);
172 $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width_1");
173 $ni->setMaxLength(4);
174 $ni->setSize(4);
175 $ni->setValue($this->object->getWidth());
176 $op2->addSubItem($ni);
177 // height
178 $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height_0");
179 $ni->setMaxLength(4);
180 $ni->setSize(4);
181 $ni->setValue($this->object->getHeight());
182 $ni->setInfo($this->lng->txt("cont_width_height_info"));
183 $op1->addSubItem($ni);
184 $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height_1");
185 $ni->setMaxLength(4);
186 $ni->setSize(4);
187 $ni->setValue($this->object->getHeight());
188 $ni->setInfo($this->lng->txt("cont_width_height_info"));
189 $op2->addSubItem($ni);
190
191 $this->form->addItem($radg);
192
193 // auto navigation to last visited item
194 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_last_visited"), "cobj_auto_last_visited");
195 $cb->setValue("y");
196 $cb->setChecked($this->object->getAuto_last_visited());
197 $cb->setInfo($this->lng->txt("cont_auto_last_visited_info"));
198 $this->form->addItem($cb);
199
200 // auto continue
201 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_auto_continue"), "auto_continue");
202 $cb->setValue("y");
203 $cb->setChecked($this->object->getAutoContinue());
204 $cb->setInfo($this->lng->txt("cont_sc_auto_continue_info"));
205 $this->form->addItem($cb);
206
207 // tile image
208 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
209
210 //
211 // scorm options
212 //
213 $sh = new ilFormSectionHeaderGUI();
214 $sh->setTitle($this->lng->txt("cont_scorm_options"));
215 $this->form->addItem($sh);
216
217 // lesson mode
218 $options = array("normal" => $this->lng->txt("cont_sc_less_mode_normal"),
219 "browse" => $this->lng->txt("cont_sc_less_mode_browse"));
220 $si = new ilSelectInputGUI($this->lng->txt("cont_def_lesson_mode"), "lesson_mode");
221 $si->setOptions($options);
222 $si->setValue($this->object->getDefaultLessonMode());
223 $this->form->addItem($si);
224
225 // credit mode
226 $options = array("credit" => $this->lng->txt("cont_credit_on"),
227 "no_credit" => $this->lng->txt("cont_credit_off"));
228 $si = new ilSelectInputGUI($this->lng->txt("cont_credit_mode"), "credit_mode");
229 $si->setOptions($options);
230 $si->setValue($this->object->getCreditMode());
231 $si->setInfo($this->lng->txt("cont_credit_mode_info"));
232 $this->form->addItem($si);
233
234 // set lesson mode review when completed
235 $options = array(
236 "n" => $this->lng->txt("cont_sc_auto_review_no"),
237// "r" => $this->lng->txt("cont_sc_auto_review_completed_not_failed_or_passed"),
238// "p" => $this->lng->txt("cont_sc_auto_review_passed"),
239// "q" => $this->lng->txt("cont_sc_auto_review_passed_or_failed"),
240// "c" => $this->lng->txt("cont_sc_auto_review_completed"),
241// "d" => $this->lng->txt("cont_sc_auto_review_completed_and_passed"),
242 "y" => $this->lng->txt("cont_sc_auto_review_completed_or_passed"),
243 );
244 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_auto_review_2004"), "auto_review");
245 $si->setOptions($options);
246 $si->setValue($this->object->getAutoReviewChar());
247 // $si->setInfo($this->lng->txt("cont_sc_auto_review_info_12"));
248 $this->form->addItem($si);
249
250 // mastery_score
251 if ($this->object->getMasteryScoreValues() != "") {
252 $ni = new ilNumberInputGUI($this->lng->txt("cont_mastery_score_12"), "mastery_score");
253 $ni->setMaxLength(3);
254 $ni->setSize(3);
255 $ni->setValue($this->object->getMasteryScore());
256 $ni->setInfo($this->lng->txt("cont_mastery_score_12_info") . $this->object->getMasteryScoreValues());
257 $this->form->addItem($ni);
258 }
259
260 //
261 // rte settings
262 //
263 $sh = new ilFormSectionHeaderGUI();
264 $sh->setTitle($this->lng->txt("cont_rte_settings"));
265 $this->form->addItem($sh);
266
267 // unlimited session timeout
268 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_usession"), "cobj_session");
269 $cb->setValue("y");
270 $cb->setChecked($this->object->getSession());
271 $cb->setInfo($this->lng->txt("cont_sc_usession_info"));
272 $this->form->addItem($cb);
273
274 // storage of interactions
275 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_interactions"), "cobj_interactions");
276 $cb->setValue("y");
277 $cb->setChecked($this->object->getInteractions());
278 $cb->setInfo($this->lng->txt("cont_interactions_info_12"));
279 $this->form->addItem($cb);
280
281 // objectives
282 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_objectives"), "cobj_objectives");
283 $cb->setValue("y");
284 $cb->setChecked($this->object->getObjectives());
285 $cb->setInfo($this->lng->txt("cont_objectives_info"));
286 $this->form->addItem($cb);
287
288 // time from lms
289 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_time_from_lms"), "cobj_time_from_lms");
290 $cb->setValue("y");
291 $cb->setChecked($this->object->getTime_from_lms());
292 $cb->setInfo($this->lng->txt("cont_time_from_lms_info"));
293 $this->form->addItem($cb);
294
295 // check values
296 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_check_values"), "cobj_check_values");
297 $cb->setValue("y");
298 $cb->setChecked($this->object->getCheck_values());
299 $cb->setInfo($this->lng->txt("cont_check_values_info"));
300 $this->form->addItem($cb);
301
302 // auto cmi.core.exit to suspend
303 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_suspend"), "cobj_auto_suspend");
304 $cb->setValue("y");
305 $cb->setChecked($this->object->getAutoSuspend());
306 $cb->setInfo($this->lng->txt("cont_auto_suspend_info"));
307 $this->form->addItem($cb);
308
309 // settings for student_id
310 $options = array(
311 0 => $this->lng->txt("cont_sc_id_setting_user_id"),
312 1 => $this->lng->txt("cont_sc_id_setting_user_login"),
313 2 => $this->lng->txt("cont_sc_id_setting_user_id_plus_ref_id"),
314 3 => $this->lng->txt("cont_sc_id_setting_user_login_plus_ref_id"),
315 4 => $this->lng->txt("cont_sc_id_setting_user_id_plus_obj_id"),
316 5 => $this->lng->txt("cont_sc_id_setting_user_login_plus_obj_id")
317 );
318 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_id_setting"), "id_setting");
319 $si->setOptions($options);
320 $si->setValue($this->object->getIdSetting());
321 $si->setInfo($this->lng->txt("cont_sc_id_setting_info"));
322 $this->form->addItem($si);
323
324 // settings for student_name
325 $options = array(
326 0 => $this->lng->txt("cont_sc_name_setting_last_firstname"),
327 1 => $this->lng->txt("cont_sc_name_setting_first_lastname"),
328 2 => $this->lng->txt("cont_sc_name_setting_fullname"),
329 3 => $this->lng->txt("cont_sc_name_setting_salutation_lastname"),
330 4 => $this->lng->txt("cont_sc_name_setting_first_name"),
331 9 => $this->lng->txt("cont_sc_name_setting_no_name")
332 );
333 $si = new ilSelectInputGUI($this->lng->txt("cont_sc_name_setting"), "name_setting");
334 $si->setOptions($options);
335 $si->setValue($this->object->getNameSetting());
336 $si->setInfo($this->lng->txt("cont_sc_name_setting_info"));
337 $this->form->addItem($si);
338
339 //
340 // debugging
341 //
342 $sh = new ilFormSectionHeaderGUI();
343 $sh->setTitle($this->lng->txt("cont_debugging"));
344 $this->form->addItem($sh);
345
346 // test tool
347 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_debug"), "cobj_debug");
348 $cb->setValue("y");
349 $cb->setChecked($this->object->getDebug());
350 if ($this->object->getDebugActivated() == false) {
351 $cb->setDisabled(true);
352 $cb->setInfo($this->lng->txt("cont_debug_deactivated"));
353 } else {
354 $cb->setInfo($this->lng->txt("cont_debug_deactivate12"));
355 }
356 $this->form->addItem($cb);
357 $this->form->addCommandButton("saveProperties", $lng->txt("save"));
358
359 $tpl->setContent($this->form->getHTML());
360 }
This class represents a checkbox property in a property form.
This class represents a section header in a property form.
This class represents a number property in a property form.
getObjectService()
Get object service.
static checkIfAnyoneIsInOfflineMode($obj_id)
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $DIC, $ilCtrl, $ilSetting, ilObjectGUI\$lng, PHPMailer\PHPMailer\$options, $si, ilObjectGUI\$tpl, ilObjectGUI\$tree, ilObjSAHSLearningModule\_lookupSubType(), ilSCORMOfflineMode\checkIfAnyoneIsInOfflineMode(), ilObjectGUI\getObjectService(), and ilObjSAHSLearningModuleGUI\setSettingsSubTabs().

Referenced by saveProperties().

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

◆ resetUserTableFilter()

ilObjSCORMLearningModuleGUI::resetUserTableFilter ( )
protected

Reset table filter.

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

818 {
819 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
820 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
821 $tbl->resetFilter();
822 $tbl->resetOffset();
823 $this->modifyTrackingItems();
824 }

References $tbl, and modifyTrackingItems().

+ Here is the call graph for this function:

◆ saveProperties()

ilObjSCORMLearningModuleGUI::saveProperties ( )

save properties

Reimplemented from ilObjSAHSLearningModuleGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

569 {
570 $this->object->setTitle($_POST["Fobject_title"]);
571 $this->object->setDescription($_POST["Fobject_description"]);
572
573 $obj_service = $this->getObjectService();
574 $this->properties();
575 $this->form->checkInput();
576
577 //check if OfflineMode-Zip has to be created
578 $tmpOfflineMode = ilUtil::yn2tf($_POST["cobj_offline_mode"]);
579 if ($tmpOfflineMode == true) {
580 if ($this->object->getOfflineMode() == false) {
581 $this->object->zipLmForOfflineMode();
582 }
583 }
584 if (isset($_POST["mastery_score"])) {
585 $this->object->setMasteryScore($_POST["mastery_score"]);
586 // $this->object->updateMasteryScoreValues();
587 }
588
589 $t_height = $this->object->getHeight();
590 if ($_POST["height_0"] != $this->object->getHeight()) {
591 $t_height = $_POST["height_0"];
592 }
593 if ($_POST["height_1"] != $this->object->getHeight()) {
594 $t_height = $_POST["height_1"];
595 }
596
597 $t_width = $this->object->getWidth();
598 if ($_POST["width_0"] != $this->object->getWidth()) {
599 $t_width = $_POST["width_0"];
600 }
601 if ($_POST["width_1"] != $this->object->getWidth()) {
602 $t_width = $_POST["width_1"];
603 }
604 $this->object->setOfflineStatus(!($_POST['cobj_online']));
605 $this->object->setOfflineMode($tmpOfflineMode);
606 $this->object->setOpenMode($_POST["open_mode"]);
607 $this->object->setWidth($t_width);
608 $this->object->setHeight($t_height);
609 $this->object->setAuto_last_visited(ilUtil::yn2tf($_POST["cobj_auto_last_visited"]));
610 $this->object->setAutoContinue(ilUtil::yn2tf($_POST["auto_continue"]));
611 $this->object->setMaxAttempt($_POST["max_attempt"]);
612 $this->object->setDefaultLessonMode($_POST["lesson_mode"]);
613 $this->object->setCreditMode($_POST["credit_mode"]);
614 $this->object->setAutoReview(ilUtil::yn2tf($_POST["auto_review"]));
615 $this->object->setSession(ilUtil::yn2tf($_POST["cobj_session"]));
616 $this->object->setInteractions(ilUtil::yn2tf($_POST["cobj_interactions"]));
617 $this->object->setObjectives(ilUtil::yn2tf($_POST["cobj_objectives"]));
618 $this->object->setTime_from_lms(ilUtil::yn2tf($_POST["cobj_time_from_lms"]));
619 $this->object->setCheck_values(ilUtil::yn2tf($_POST["cobj_check_values"]));
620 $this->object->setAutoSuspend(ilUtil::yn2tf($_POST["cobj_auto_suspend"]));
621 $this->object->setDebug(ilUtil::yn2tf($_POST["cobj_debug"]));
622 $this->object->setIdSetting($_POST["id_setting"]);
623 $this->object->setNameSetting($_POST["name_setting"]);
624 $this->object->update();
625
626 // tile image
627 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
628
629 ilUtil::sendInfo($this->lng->txt("msg_obj_modified"), true);
630 $this->ctrl->redirect($this, "properties");
631 }
static yn2tf($a_yn)
convert "y"/"n" to true/false

References $_POST, ilObjectGUI\getObjectService(), properties(), ilUtil\sendInfo(), and ilUtil\yn2tf().

+ Here is the call graph for this function:

◆ setSubTabs()

ilObjSCORMLearningModuleGUI::setSubTabs ( )

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

1048 {
1049 global $DIC;
1050 $lng = $DIC['lng'];
1051 $ilTabs = $DIC['ilTabs'];
1052 $ilCtrl = $DIC['ilCtrl'];
1053 $ilAccess = $DIC['ilAccess'];
1054
1055 if ($ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"])) {
1056 $ilTabs->addSubTabTarget(
1057 "cont_tracking_byuser",
1058 $this->ctrl->getLinkTarget($this, "showTrackingItems"),
1059 array("edit", ""),
1060 get_class($this)
1061 );
1062
1063 $ilTabs->addSubTabTarget(
1064 "cont_tracking_bysco",
1065 $this->ctrl->getLinkTarget($this, "showTrackingItemsBySco"),
1066 array("edit", ""),
1067 get_class($this)
1068 );
1069 }
1070 if ($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
1071 $ilTabs->addSubTabTarget(
1072 "cont_tracking_modify",
1073 $this->ctrl->getLinkTarget($this, "modifyTrackingItems"),
1074 array("edit", ""),
1075 get_class($this)
1076 );
1077 }
1078 }

References $_GET, $DIC, $ilCtrl, and ilObjectGUI\$lng.

Referenced by ilObjSCORM2004LearningModuleGUI\initStylePropertiesForm(), modifyTrackingItems(), ilObjSCORM2004LearningModuleGUI\properties(), showTrackingItem(), showTrackingItemPerUser(), ilObjSCORM2004LearningModuleGUI\showTrackingItems(), showTrackingItems(), ilObjSCORM2004LearningModuleGUI\showTrackingItemsBySco(), showTrackingItemsBySco(), and showTrackingItemSco().

+ Here is the caller graph for this function:

◆ showTrackingItem()

ilObjSCORMLearningModuleGUI::showTrackingItem ( )
protected

show tracking data of item

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

980 {
981 global $DIC;
982 $ilTabs = $DIC['ilTabs'];
983
984 include_once "./Services/Table/classes/class.ilTableGUI.php";
985
986 $this->setSubTabs();
987 $ilTabs->setTabActive("cont_tracking_data");
988 $ilTabs->setSubTabActive("cont_tracking_byuser");
989
990 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerUserTableGUI.php';
991 $tbl = new ilSCORMTrackingItemsPerUserTableGUI($this->object->getId(), $this, 'showTrackingItem');
992 $tbl->setUserId((int) $_REQUEST['user_id']);
993 $tbl->parse();
994 $this->tpl->setContent($tbl->getHTML());
995 return true;
996 }

References $DIC, $tbl, and setSubTabs().

+ Here is the call graph for this function:

◆ showTrackingItemPerUser()

ilObjSCORMLearningModuleGUI::showTrackingItemPerUser ( )
protected

show tracking data of item per user

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

1024 {
1025 global $DIC;
1026 $ilTabs = $DIC['ilTabs'];
1027
1028 include_once "./Services/Table/classes/class.ilTableGUI.php";
1029
1030 $this->setSubTabs();
1031 $ilTabs->setTabActive("cont_tracking_data");
1032 $ilTabs->setSubTabActive("cont_tracking_byuser");
1033
1034 $this->ctrl->setParameter($this, 'obj_id', (int) $_REQUEST['obj_id']);
1035 $this->ctrl->setParameter($this, 'user_id', (int) $_REQUEST['user_id']);
1036
1037 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemPerUserTableGUI.php';
1038 $tbl = new ilSCORMTrackingItemPerUserTableGUI($this->object->getId(), $this, 'showTrackingItemPerUser');
1039 $tbl->setUserId((int) $_REQUEST['user_id']);
1040 $tbl->setScoId((int) $_REQUEST['obj_id']);
1041 $tbl->parse();
1042 $this->tpl->setContent($tbl->getHTML());
1043 return true;
1044 }

References $DIC, $tbl, and setSubTabs().

+ Here is the call graph for this function:

◆ showTrackingItems()

ilObjSCORMLearningModuleGUI::showTrackingItems ( )

Show tracking table @global ilTabs $ilTabs $global ilToolbar $ilToolbar.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

697 {
698 global $DIC;
699 $ilTabs = $DIC['ilTabs'];
700 $ilAccess = $DIC['ilAccess'];
701
702 $ilTabs->setTabActive('cont_tracking_data');
703
704 if ($ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"])) {
706 $ilTabs->setSubTabActive('cont_tracking_byuser');
707
708 $reports = array('exportSelectedSuccess','exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');
709
710 $userSelected = "all";
711 if (isset($_GET["userSelected"])) {
712 $userSelected = ilUtil::stripSlashes($_GET["userSelected"]);
713 }
714 if (isset($_POST["userSelected"])) {
715 $userSelected = ilUtil::stripSlashes($_POST["userSelected"]);
716 }
717 $this->ctrl->setParameter($this, 'userSelected', $userSelected);
718
719 $report = "choose";
720 if (isset($_GET["report"])) {
721 $report = ilUtil::stripSlashes($_GET["report"]);
722 }
723 if (isset($_POST["report"])) {
724 $report = ilUtil::stripSlashes($_POST["report"]);
725 }
726 $this->ctrl->setParameter($this, 'report', $report);
727
728 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerUserFilterGUI.php';
729 $filter = new ilSCORMTrackingItemsPerUserFilterGUI($this, 'showTrackingItems');
730 $filter->parse($userSelected, $report, $reports);
731 if ($report == "choose") {
732 $this->tpl->setContent($filter->form->getHTML());
733 } else {
734 $usersSelected = array();
735 if ($userSelected != "all") {
736 $usersSelected[] = $userSelected;
737 } else {
738 include_once "Services/Tracking/classes/class.ilTrQuery.php";
740 foreach ($users as $user) {
741 if (ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
742 $usersSelected[] = $user;
743 }
744 }
745 }
746 $scosSelected = array();
747 $scos = $this->object->getTrackedItems();
748 foreach ($scos as $row) {
749 $scosSelected[] = (int) $row->getId();
750 }
751
752 //with check for course ...
753 // include_once "Services/Tracking/classes/class.ilTrQuery.php";
754 // $a_users=ilTrQuery::getParticipantsForObject($this->ref_id);
755 // var_dump($this->object->getTrackedUsers(""));
756 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsTableGUI.php';
757 $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItems', $usersSelected, $scosSelected, $report);
758 $this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
759 }
760 } elseif ($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
761 $this->modifyTrackingItems();
762 }
763 return true;
764 }
$users
Definition: authpage.php:44
Class ilSCORMTrackingItemsTableGUI.
static getParticipantsForObject($a_ref_id)
Get participant ids for given object.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$row

References $_GET, $_POST, $DIC, $row, $tbl, ilObjectGUI\$user, $users, ilObject\_exists(), ilTrQuery\getParticipantsForObject(), modifyTrackingItems(), setSubTabs(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ showTrackingItemsBySco()

ilObjSCORMLearningModuleGUI::showTrackingItemsBySco ( )
protected

show tracking data

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

637 {
638 global $DIC;
639 $ilTabs = $DIC['ilTabs'];
640
642 $ilTabs->setTabActive("cont_tracking_data");
643 $ilTabs->setSubTabActive("cont_tracking_bysco");
644
645 $reports = array('exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');//,'tracInteractionItem','tracInteractionUser','tracInteractionUserAnswers'
646 $scoSelected = "all";
647 if (isset($_GET["scoSelected"])) {
648 $scoSelected = ilUtil::stripSlashes($_GET["scoSelected"]);
649 }
650 if (isset($_POST["scoSelected"])) {
651 $scoSelected = ilUtil::stripSlashes($_POST["scoSelected"]);
652 }
653 $this->ctrl->setParameter($this, 'scoSelected', $scoSelected);
654
655 $report = "choose";
656 if (isset($_GET["report"])) {
657 $report = ilUtil::stripSlashes($_GET["report"]);
658 }
659 if (isset($_POST["report"])) {
660 $report = ilUtil::stripSlashes($_POST["report"]);
661 }
662 $this->ctrl->setParameter($this, 'report', $report);
663
664 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerScoFilterGUI.php';
665 $filter = new ilSCORMTrackingItemsPerScoFilterGUI($this, 'showTrackingItemsBySco');
666 $filter->parse($scoSelected, $report, $reports);
667 if ($report == "choose") {
668 $this->tpl->setContent($filter->form->getHTML());
669 } else {
670 $scosSelected = array();
671 if ($scoSelected != "all") {
672 $scosSelected[] = $scoSelected;
673 } else {
674 $scos = $this->object->getTrackedItems();
675 foreach ($scos as $row) {
676 $scosSelected[] = (int) $row->getId();
677 }
678 }
679 //with check for course ...
680 include_once "Services/Tracking/classes/class.ilTrQuery.php";
681 $a_users = ilTrQuery::getParticipantsForObject($this->ref_id);
682 // var_dump($this->object->getTrackedUsers(""));
683 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsTableGUI.php';
684 $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItemsBySco', $a_users, $scosSelected, $report);
685 $this->tpl->setContent($filter->form->getHTML() . $tbl->getHTML());
686 }
687 return true;
688 }

References $_GET, $_POST, $DIC, $row, $tbl, ilTrQuery\getParticipantsForObject(), setSubTabs(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ showTrackingItemSco()

ilObjSCORMLearningModuleGUI::showTrackingItemSco ( )
protected

show tracking data of item

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

1002 {
1003 global $DIC;
1004 $ilTabs = $DIC['ilTabs'];
1005
1006 include_once "./Services/Table/classes/class.ilTableGUI.php";
1007
1008 $this->setSubTabs();
1009 $ilTabs->setTabActive("cont_tracking_data");
1010 $ilTabs->setSubTabActive("cont_tracking_bysco");
1011
1012 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsScoTableGUI.php';
1013 $tbl = new ilSCORMTrackingItemsScoTableGUI($this->object->getId(), $this, 'showTrackingItemSco');
1014 $tbl->setScoId((int) $_GET['obj_id']);
1015 $tbl->parse();
1016 $this->tpl->setContent($tbl->getHTML());
1017 return true;
1018 }

References $_GET, $DIC, $tbl, and setSubTabs().

+ Here is the call graph for this function:

◆ stopUserOfflineMode()

ilObjSCORMLearningModuleGUI::stopUserOfflineMode ( )
protected

Stop offline mode for selected users.

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

1111 {
1112 if (!count((array) $_POST['user'])) {
1113 ilUtil::sendFailure($this->lng->txt('select_one'), true);
1114 $this->ctrl->redirect($this, 'offlineModeManager');
1115 }
1116 // display confirmation message
1117 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1118 $cgui = new ilConfirmationGUI();
1119 $cgui->setFormAction($this->ctrl->getFormAction($this));
1120 $cgui->setHeaderText($this->lng->txt("info_stop_offline_mode_sure"));
1121 $cgui->setCancel($this->lng->txt("cancel"), "cancelStopUserOfflineMode");
1122 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedStopUserOfflineMode");
1123 foreach ($_POST["user"] as $id) {
1124 if (ilObject::_exists($id) && ilObject::_lookUpType($id) == "usr") {
1125 $user = new ilObjUser($id);
1126 $caption = ilUtil::getImageTagByType("sahs_offline", $this->tpl->tplPath) .
1127 " " . $this->lng->txt("stop_user_offline_mode_for_user") .
1128 ": " . $user->getLastname() . ", " . $user->getFirstname();
1129 $cgui->addItem("user[]", $id, $caption);
1130 }
1131 }
1132 $this->tpl->setContent($cgui->getHTML());
1133 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_POST, $id, ilObjectGUI\$user, ilObject\_exists(), ilUtil\getImageTagByType(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

Field Documentation

◆ EXPORT_ALL

const ilObjSCORMLearningModuleGUI::EXPORT_ALL = 1

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

◆ EXPORT_SELECTED

const ilObjSCORMLearningModuleGUI::EXPORT_SELECTED = 2

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

◆ EXPORT_TYPE_RAW

const ilObjSCORMLearningModuleGUI::EXPORT_TYPE_RAW = 1

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

◆ EXPORT_TYPE_SUCCESS

const ilObjSCORMLearningModuleGUI::EXPORT_TYPE_SUCCESS = 2

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

◆ EXPORT_UNDEF

const ilObjSCORMLearningModuleGUI::EXPORT_UNDEF = 0

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


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