ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 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...
 

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
 
 $ilias
 
 $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
 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...
 
 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...
 
 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
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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, ilObjAICCLearningModuleGUI, and ilObjHACPLearningModuleGUI.

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

42 {
43 global $lng;
44
45 $lng->loadLanguageModule("content");
46 $lng->loadLanguageModule("search");
47
48 $this->type = "sahs";
49 parent::__construct($a_data,$a_id,$a_call_by_reference,false);
50 }

References ilObjectGUI\$lng.

Member Function Documentation

◆ applyUserTableFilter()

ilObjSCORMLearningModuleGUI::applyUserTableFilter ( )
protected

Apply table filter.

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

743 {
744 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
745 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
746 $tbl->writeFilterToSession();
747 $tbl->resetOffset();
748 $this->modifyTrackingItems();
749 }
$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, ilObjAICCLearningModuleGUI, and ilObjHACPLearningModuleGUI.

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

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

◆ cancel()

ilObjSCORMLearningModuleGUI::cancel ( )

overwrite..jump back to trackingdata not parent

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

818 {
819 ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
820 $this->ctrl->redirect($this, "properties");
821 }
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 802 of file class.ilObjSCORMLearningModuleGUI.php.

803 {
804 ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
805 $this->ctrl->redirect($this, "modifyTrackingItems");
806 }

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ cancelStopUserOfflineMode()

ilObjSCORMLearningModuleGUI::cancelStopUserOfflineMode ( )

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

1060 {
1061 ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
1062 $this->ctrl->redirect($this, "offlineModeManager");
1063 }

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ confirmedDeleteTracking()

ilObjSCORMLearningModuleGUI::confirmedDeleteTracking ( )

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

809 {
810 $this->object->deleteTrackingDataOfUsers($_POST["user"]);
811 $this->ctrl->redirect($this, "modifyTrackingItems");
812 }
$_POST["username"]

References $_POST.

◆ confirmedStopUserOfflineMode()

ilObjSCORMLearningModuleGUI::confirmedStopUserOfflineMode ( )

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

1066 {
1067
1068 include_once './Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php';
1069 foreach($_POST["user"] as $id)
1070 {
1071 ilSCORMOfflineMode::stopOfflineModeForUser($this->object->getId(),$id);
1072 }
1073
1074 $this->offlineModeManager();
1075 }
offlineModeManager()
Manage offline mode for users @global ilTabs $ilTabs $global ilToolbar $ilToolbar.
static stopOfflineModeForUser($obj_id, $user_id)

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

+ Here is the call graph for this function:

◆ decreaseAttempts()

ilObjSCORMLearningModuleGUI::decreaseAttempts ( )

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

909 {
910 if (!isset($_POST["user"])) {
911 ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
912 }
913 $this->object->decreaseAttemptsForUser($_POST["user"]);
914 $this->ctrl->redirect($this, "modifyTrackingItems");
915 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ deleteTrackingForUser()

ilObjSCORMLearningModuleGUI::deleteTrackingForUser ( )

display deletion confirmation screen

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

767 {
768 if(!isset($_POST["user"]))
769 {
770 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
771 }
772
773 // display confirmation message
774 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
775 $cgui = new ilConfirmationGUI();
776 $cgui->setFormAction($this->ctrl->getFormAction($this));
777 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
778 $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteTracking");
779 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeleteTracking");
780
781 foreach($_POST["user"] as $id)
782 {
783 if (ilObject::_exists($id) && ilObject::_lookUpType($id)=="usr" )
784 {
785 $user = new ilObjUser($id);
786
787 $caption = ilUtil::getImageTagByType("sahs", $this->tpl->tplPath).
788 " ".$this->lng->txt("cont_tracking_data").
789 ": ".$user->getLastname().", ".$user->getFirstname();
790
791
792 $cgui->addItem("user[]", $id, $caption);
793 }
794 }
795
796 $this->tpl->setContent($cgui->getHTML());
797 }
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, 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 887 of file class.ilObjSCORMLearningModuleGUI.php.

888 {
889 $this->object->exportSelected(1);
890 }

◆ exportSelectionUsers()

ilObjSCORMLearningModuleGUI::exportSelectionUsers ( )
protected

Export selection for selected users.

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

896 {
897 if(!count((array) $_POST['user']))
898 {
899 //ilUtil::sendFailure($this->lng->txt('select_one'),true);
900 ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
901 $this->ctrl->redirect($this,'modifyTrackingItems');
902 } else {
903 $this->object->exportSelected(0,$_POST["user"]);
904 }
905 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ getMaxFileSize()

ilObjSCORMLearningModuleGUI::getMaxFileSize ( )

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

391 {
392 // get the value for the maximal uploadable filesize from the php.ini (if available)
393 $umf=get_cfg_var("upload_max_filesize");
394 // get the value for the maximal post data from the php.ini (if available)
395 $pms=get_cfg_var("post_max_size");
396
397 //convert from short-string representation to "real" bytes
398 $multiplier_a=array("K"=>1024, "M"=>1024*1024, "G"=>1024*1024*1024);
399
400 $umf_parts=preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
401 $pms_parts=preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
402
403 if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
404 if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
405
406 // use the smaller one as limit
407 $max_filesize=min($umf, $pms);
408
409 if (!$max_filesize) $max_filesize=max($umf, $pms);
410
411 //format for display in mega-bytes
412 return $max_filesize=sprintf("%.1f MB",$max_filesize/1024/1024);
413 }
sprintf('%.4f', $callTime)
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, and sprintf.

◆ import()

ilObjSCORMLearningModuleGUI::import ( )
protected

gui functions for GUI export

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

827 {
828 $form = $this->initImportForm("");
829 if($form->checkInput())
830 {
831 $source = $form->getInput('csv');
832 $error = $this->object->importTrackingData($source['tmp_name']);
833 switch($error)
834 {
835 case 0 :
836 ilUtil::sendInfo('Tracking data imported', true);
837 $this->ctrl->redirect($this, "showTrackingItems");
838 break;
839 case -1 :
840 ilUtil::sendInfo($this->lng->txt('err_check_input'));
841 $this->importForm();
842 break;
843 }
844 }
845 ilUtil::sendInfo($this->lng->txt('err_check_input'));
846 $form->setValuesByPost();
847 $this->importForm();
848 }
$error
Definition: Error.php:17
initImportForm($a_new_type)
Init import form.

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

+ Here is the call graph for this function:

◆ importForm()

ilObjSCORMLearningModuleGUI::importForm ( )
protected

Show import form.

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

854 {
855 global $ilTabs;
856
857 $ilTabs->clearTargets();
858 $ilTabs->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,'showTrackingItems'));
859
860 $form = $this->initImportForm("");
861 $this->tpl->setContent($form->getHTML());
862 }

References 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 867 of file class.ilObjSCORMLearningModuleGUI.php.

868 {
869 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
870 $form = new ilPropertyFormGUI();
871 $form->setFormAction($this->ctrl->getFormAction($this));
872 $form->setTitle($this->lng->txt('cont_import_tracking'));
873 $form->addCommandButton('import', $this->lng->txt('import'));
874 $form->addCommandButton('showTrackingItems', $this->lng->txt('cancel'));
875
876 $csv = new ilFileInputGUI($this->lng->txt('select_file'),'csv');
877 $csv->setRequired(true);
878 $csv->setSuffixes(array('csv'));
879 $form->addItem($csv);
880
881 return $form;
882 }
This class represents a file property in a property form.
This class represents a property form user interface.

Referenced by import(), and importForm().

+ Here is the caller graph for this function:

◆ modifyTrackingItems()

ilObjSCORMLearningModuleGUI::modifyTrackingItems ( )
protected

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

705 {
706 global $ilAccess;
707 if($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
708 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
710 if(!$privacy->enabledSahsProtocolData())
711 {
712 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
713 }
714
715 global $ilTabs, $ilToolbar;
716
717 include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
718 $ilToolbar->addButton(
719 $this->lng->txt('import'),
720 $this->ctrl->getLinkTarget($this, 'importForm')
721 );
722 $ilToolbar->addButton(
723 $this->lng->txt('cont_export_all'),
724 $this->ctrl->getLinkTarget($this, 'exportAll')
725 );
726
728 $ilTabs->setTabActive('cont_tracking_data');
729 $ilTabs->setSubTabActive('cont_tracking_modify');
730
731 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
732 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
733 $tbl->parse();
734 $this->tpl->setContent($tbl->getHTML());
735 }
736 }
$_GET["client_id"]
static _getInstance()
Get instance of ilPrivacySettings.

References $_GET, $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 332 of file class.ilObjSCORMLearningModuleGUI.php.

333 {
334 global $ilTabs;
336 $ilTabs->setSubTabActive('cont_sc_new_version');
337
340
341 // display import form
342 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scorm_new_version_import.html", "Modules/ScormAicc");
343
344 $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_lm.svg'));
345 $this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_sahs"));
346
347 $this->ctrl->setParameter($this, "new_type", "sahs");
348 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
349
350 $this->tpl->setVariable("BTN_NAME", "newModuleVersionUpload");
351 $this->tpl->setVariable("TARGET", ' target="'.
352 ilFrameTargetInfo::_getFrame("MainContent").'" ');
353
354 $this->tpl->setVariable("TXT_SELECT_LMTYPE", $this->lng->txt("type"));
355
356 if ($type == "scorm2004") {
357 $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm2004"));
358 } else {
359 $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm"));
360 }
361
362 include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
364 {
366 foreach($files as $file)
367 {
368 $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
369 $this->tpl->setCurrentBlock("option_uploaded_file");
370 $this->tpl->setVariable("UPLOADED_FILENAME", $file);
371 $this->tpl->setVariable("TXT_UPLOADED_FILENAME", $file);
372 $this->tpl->parseCurrentBlock();
373 }
374 $this->tpl->setCurrentBlock("select_uploaded_file");
375 $this->tpl->setVariable("TXT_SELECT_FROM_UPLOAD_DIR", $this->lng->txt("cont_select_from_upload_dir"));
376 $this->tpl->setVariable("TXT_UPLOADED_FILE", $this->lng->txt("cont_uploaded_file"));
377 $this->tpl->parseCurrentBlock();
378 }
379
380 $this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("upload"));
381 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
382 $this->tpl->setVariable("TXT_IMPORT_LM", $this->lng->txt("import_sahs"));
383 $this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file"));
384
385 // gives out the limit as a little notice
386 $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice")." ".$this->getMaxFileSize());
387 }
$files
Definition: add-vimline.php:18
static _getFrame($a_class, $a_type='')
Get content frame name.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
static _lookupObjectId($a_ref_id)
lookup object id
static _getUploadFiles()
Get a list of readable files in the upload directory.
static _getUploadDirectory()
Get the directory with uploaded files.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $_GET, $file, $files, ilObjectGUI\$obj_id, ilFrameTargetInfo\_getFrame(), ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilUtil\getImagePath(), 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 416 of file class.ilObjSCORMLearningModuleGUI.php.

417 {
418 global $_FILES, $rbacsystem;
419
420 $unzip = PATH_TO_UNZIP;
421 $tocheck = "imsmanifest.xml";
422
423 include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
424
425 // check create permission before because the uploaded file will be copied
426 if (!$rbacsystem->checkAccess("write", $_GET["ref_id"]))
427 {
428 $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
429 }
430 elseif ($_FILES["scormfile"]["name"])
431 {
432 // check if file was uploaded
433 $source = $_FILES["scormfile"]["tmp_name"];
434 if (($source == 'none') || (!$source))
435 {
436 ilUtil::sendInfo($this->lng->txt("upload_error_file_not_found"),true);
437 $this->newModuleVersion();
438 return;
439 }
440 }
441 elseif ($_POST["uploaded_file"])
442 {
443 // check if the file is in the ftp directory and readable
444 if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"]))
445 {
446 $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
447 }
448 // copy the uploaded file to the client web dir to analyze the imsmanifest
449 // the copy will be moved to the lm directory or deleted
450 $source = CLIENT_WEB_DIR . "/" . $_POST["uploaded_file"];
451 ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $source);
452 $source_is_copy = true;
453 }
454 else
455 {
456 ilUtil::sendInfo($this->lng->txt("upload_error_file_not_found"),true);
457 $this->newModuleVersion();
458 return;
459 }
460 // fim.
461
462 //unzip the imsmanifest-file from new uploaded file
463 $pathinfo = pathinfo($source);
464 $dir = $pathinfo["dirname"];
465 $file = $pathinfo["basename"];
466 $cdir = getcwd();
467 chdir($dir);
468
469 //we need more flexible unzip here than ILIAS standard classes allow
470 $unzipcmd = $unzip." -o ".ilUtil::escapeShellArg($source)." ".$tocheck;
471 exec($unzipcmd);
472 chdir($cdir);
473 $tmp_file = $dir."/".$_GET["ref_id"].".".$tocheck;
474 require_once('./Services/Utilities/classes/class.ilFileUtils.php');
475 ilFileUtils::rename($dir."/".$tocheck,$tmp_file);
476 $new_manifest = file_get_contents($tmp_file);
477
478 //remove temp file
479 unlink($tmp_file);
480
481 //get old manifest file
482 $old_manifest = file_get_contents($this->object->getDataDirectory()."/".$tocheck);
483
484 //reload fixed version of file
485 $check ='/xmlns="http:\/\/www.imsglobal.org\/xsd\/imscp_v1p1"/';
486 $replace="xmlns=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2\"";
487 $reload_manifest = preg_replace($check, $replace, $new_manifest);
488
489 //do testing for converted versions as well as earlier ILIAS version messed up utf8 conversion
490 if (strcmp($new_manifest,$old_manifest) == 0 || strcmp(utf8_encode($new_manifest),$old_manifest) == 0 ||
491 strcmp ($reload_manifest, $old_manifest) == 0 || strcmp(utf8_encode($reload_manifest),$old_manifest) == 0 ){
492
493 //get exisiting module version
494 $module_version = $this->object->getModuleVersion();
495
496 if ($_FILES["scormfile"]["name"])
497 {
498 //build targetdir in lm_data
499 $file_path = $this->object->getDataDirectory()."/".$_FILES["scormfile"]["name"].".".$module_version;
500 $file_path = str_replace(".zip.".$module_version, ".".$module_version.".zip",$file_path);
501 //move to data directory and add subfix for versioning
502 ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"],$_FILES["scormfile"]["name"], $file_path);
503 }
504 else
505 {
506 //build targetdir in lm_data
507 $file_path = $this->object->getDataDirectory()."/".$_POST["uploaded_file"].".".$module_version;
508 $file_path = str_replace(".zip.".$module_version, ".".$module_version.".zip",$file_path);
509 // move the already copied file to the lm_data directory
510 require_once('./Services/Utilities/classes/class.ilFileUtils.php');
511 ilFileUtils::rename($source, $file_path);
512 }
513
514 //unzip and replace old extracted files
515 ilUtil::unzip($file_path, true);
516 ilUtil::renameExecutables($this->object->getDataDirectory()); //(security)
517
518 //increase module version
519 $this->object->setModuleVersion($module_version+1);
520 $this->object->update();
521
522 //redirect to properties and display success
523 ilUtil::sendInfo( $this->lng->txt("cont_new_module_added"), true);
524 ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$_GET["ref_id"]);
525 exit;
526 }
527 else
528 {
529 if ($source_is_copy)
530 {
531 unlink($source);
532 }
533
534 ilUtil::sendInfo($this->lng->txt("cont_invalid_new_module"),true);
535 $this->newModuleVersion();
536 }
537 }
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 moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static escapeShellArg($a_arg)
static redirect($a_script)
http redirect to other 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, $file, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_copyUploadFile(), ilUtil\escapeShellArg(), exit, ilUtil\moveUploadedFile(), 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 1012 of file class.ilObjSCORMLearningModuleGUI.php.

1013 {
1014 global $rbacsystem, $tree, $tpl, $lng, $ilToolbar, $ilCtrl, $ilSetting;
1015
1016 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1017 if(!ilLearningProgressAccess::checkAccess($this->object->getRefId()))
1018 {
1019 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
1020 }
1021
1022 include_once './Modules/ScormAicc/classes/class.ilSCORMOfflineModeUsersTableGUI.php';
1023 $tbl = new ilSCORMOfflineModeUsersTableGUI($this->object->getId(), $this, 'offlineModeManager');
1024 $tbl->parse();
1025 $this->tpl->setContent($tbl->getHTML());
1026
1027 }
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 $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 73 of file class.ilObjSCORMLearningModuleGUI.php.

74 {
75 global $rbacsystem, $tree, $tpl, $lng, $ilToolbar, $ilCtrl, $ilSetting, $ilTabs;
76
77 $lng->loadLanguageModule("style");
78
80 $ilTabs->setSubTabActive('cont_settings');
81
82 // view
83 $ilToolbar->addButton($this->lng->txt("view"),
84 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
85 "_blank");
86
87 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
88 $this->form = new ilPropertyFormGUI();
89 $this->form->setFormAction($ilCtrl->getFormAction($this));
90 $this->form->setTitle($this->lng->txt("cont_lm_properties"));
91
92 //check/select only once
93 $this->object->checkMasteryScoreValues();
94
95 //title
96 $ti = new ilTextInputGUI($this->lng->txt("title"), "Fobject_title");
97 $ti->setMaxLength(200);
98 $ti->setValue($this->object->getTitle());
99 $this->form->addItem($ti);
100
101 //description
102 $ti = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject_description");
103 $ti->setValue($this->object->getDescription());
104 $this->form->addItem($ti);
105
106 // SCORM-type
107 $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
108 $ne->setValue($this->lng->txt( "lm_type_" . ilObjSAHSLearningModule::_lookupSubType( $this->object->getID() ) ) );
109 $this->form->addItem($ne);
110
111 // version
112 $ne = new ilNonEditableValueGUI($this->lng->txt("cont_sc_version"), "");
113 $ne->setValue($this->object->getModuleVersion());
114 $ne->setInfo($this->lng->txt("cont_sc_version_info"));
115 $this->form->addItem($ne);
116
117 //
118 // activation
119 //
120 $sh = new ilFormSectionHeaderGUI();
121 $sh->setTitle($this->lng->txt("activation"));
122 $this->form->addItem($sh);
123
124 // online
125 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_online"), "cobj_online");
126 $cb->setValue("y");
127 if ($this->object->getOnline())
128 {
129 $cb->setChecked(true);
130 }
131 $cb->setInfo($this->lng->txt("cont_online_info"));
132 $this->form->addItem($cb);
133
134 // offline Mode
135 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_offline_mode_allow"), "cobj_offline_mode");
136 $cb->setValue("y");
137 $cb->setChecked($this->object->getOfflineMode());
138 include_once("./Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php");
139 if ($this->object->getOfflineMode()== true && ilSCORMOfflineMode::checkIfAnyoneIsInOfflineMode($this->object->getID()) == true) {
140 $cb->setDisabled(true);
141 $cb->setInfo($this->lng->txt("cont_offline_mode_disable_not_allowed_info"));
142 } else {
143 $cb->setInfo($this->lng->txt("cont_offline_mode_allow_info"));
144 }
145 $this->form->addItem($cb);
146
147 //
148 // presentation
149 //
150 $sh = new ilFormSectionHeaderGUI();
151 $sh->setTitle($this->lng->txt("cont_presentation"));
152 $this->form->addItem($sh);
153
154 $radg = new ilRadioGroupInputGUI($lng->txt("cont_open"), "open_mode");
155 $op0 = new ilRadioOption($this->lng->txt("cont_open_normal"), "0");
156 $radg->addOption($op0);
157 $op1 = new ilRadioOption($this->lng->txt("cont_open_iframe"), "1");
158 $radg->addOption($op1);
159 $op2 = new ilRadioOption($this->lng->txt("cont_open_window"), "5");
160 $radg->addOption($op2);
161 $radg->setValue($this->object->getOpenMode());
162
163 // width
164 $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width_0");
165 $ni->setMaxLength(4);
166 $ni->setSize(4);
167 $ni->setValue($this->object->getWidth());
168 $op1->addSubItem($ni);
169 $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width_1");
170 $ni->setMaxLength(4);
171 $ni->setSize(4);
172 $ni->setValue($this->object->getWidth());
173 $op2->addSubItem($ni);
174 // height
175 $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height_0");
176 $ni->setMaxLength(4);
177 $ni->setSize(4);
178 $ni->setValue($this->object->getHeight());
179 $ni->setInfo($this->lng->txt("cont_width_height_info"));
180 $op1->addSubItem($ni);
181 $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height_1");
182 $ni->setMaxLength(4);
183 $ni->setSize(4);
184 $ni->setValue($this->object->getHeight());
185 $ni->setInfo($this->lng->txt("cont_width_height_info"));
186 $op2->addSubItem($ni);
187
188 $this->form->addItem($radg);
189
190 // auto navigation to last visited item
191 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_last_visited"), "cobj_auto_last_visited");
192 $cb->setValue("y");
193 $cb->setChecked($this->object->getAuto_last_visited());
194 $cb->setInfo($this->lng->txt("cont_auto_last_visited_info"));
195 $this->form->addItem($cb);
196
197 // auto continue
198 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_auto_continue"), "auto_continue");
199 $cb->setValue("y");
200 $cb->setChecked($this->object->getAutoContinue());
201 $this->form->addItem($cb);
202
203 //
204 // scorm options
205 //
206 $sh = new ilFormSectionHeaderGUI();
207 $sh->setTitle($this->lng->txt("cont_scorm_options"));
208 $this->form->addItem($sh);
209
210 // max attempts
211 // $ni = new ilNumberInputGUI($this->lng->txt("cont_sc_max_attempt"), "max_attempt");
212 // $ni->setMaxLength(3);
213 // $ni->setSize(3);
214 // $ni->setValue($this->object->getMaxAttempt());
215 // $this->form->addItem($ni);
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 //
303 // debugging
304 //
305 $sh = new ilFormSectionHeaderGUI();
306 $sh->setTitle($this->lng->txt("cont_debugging"));
307 $this->form->addItem($sh);
308
309 // test tool
310 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_debug"), "cobj_debug");
311 $cb->setValue("y");
312 $cb->setChecked($this->object->getDebug());
313 if ($this->object->getDebugActivated() == false)
314 {
315 $cb->setDisabled(true);
316 $cb->setInfo($this->lng->txt("cont_debug_deactivated"));
317 }
318 else
319 {
320 $cb->setInfo($this->lng->txt("cont_debug_deactivate"));
321 }
322 $this->form->addItem($cb);
323 $this->form->addCommandButton("saveProperties", $lng->txt("save"));
324
325 $tpl->setContent($this->form->getHTML());
326
327 }
This class represents a checkbox property in a property form.
This class represents a section header in a property form.
This class represents a non editable value in a property form.
This class represents a number property in a property form.
This class represents a property in a property form.
This class represents an option in a radio group.
static checkIfAnyoneIsInOfflineMode($obj_id)
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.
if(!is_array($argv)) $options

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

+ Here is the call graph for this function:

◆ resetUserTableFilter()

ilObjSCORMLearningModuleGUI::resetUserTableFilter ( )
protected

Reset table filter.

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

755 {
756 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
757 $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
758 $tbl->resetFilter();
759 $tbl->resetOffset();
760 $this->modifyTrackingItems();
761 }

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 542 of file class.ilObjSCORMLearningModuleGUI.php.

543 {
544 $this->object->setTitle($_POST["Fobject_title"]);
545 $this->object->setDescription($_POST["Fobject_description"]);
546
547 //check if OfflineMode-Zip has to be created
548 $tmpOfflineMode= ilUtil::yn2tf($_POST["cobj_offline_mode"]);
549 if ($tmpOfflineMode == true) {
550 if ($this->object->getOfflineMode() == false) {
551 $this->object->zipLmForOfflineMode();
552 }
553 }
554 if (isset($_POST["mastery_score"])){
555 $this->object->setMasteryScore($_POST["mastery_score"]);
556 // $this->object->updateMasteryScoreValues();
557 }
558
559 $t_height = $this->object->getHeight();
560 if ($_POST["height_0"] != $this->object->getHeight()) $t_height = $_POST["height_0"];
561 if ($_POST["height_1"] != $this->object->getHeight()) $t_height = $_POST["height_1"];
562
563 $t_width = $this->object->getWidth();
564 if ($_POST["width_0"] != $this->object->getWidth()) $t_width = $_POST["width_0"];
565 if ($_POST["width_1"] != $this->object->getWidth()) $t_width = $_POST["width_1"];
566
567 $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
568 $this->object->setOfflineMode($tmpOfflineMode);
569 $this->object->setOpenMode($_POST["open_mode"]);
570 $this->object->setWidth($t_width);
571 $this->object->setHeight($t_height);
572 $this->object->setAuto_last_visited(ilUtil::yn2tf($_POST["cobj_auto_last_visited"]));
573 $this->object->setAutoContinue(ilUtil::yn2tf($_POST["auto_continue"]));
574 $this->object->setMaxAttempt($_POST["max_attempt"]);
575 $this->object->setDefaultLessonMode($_POST["lesson_mode"]);
576 $this->object->setCreditMode($_POST["credit_mode"]);
577 $this->object->setAutoReview(ilUtil::yn2tf($_POST["auto_review"]));
578 $this->object->setSession(ilUtil::yn2tf($_POST["cobj_session"]));
579 $this->object->setInteractions(ilUtil::yn2tf($_POST["cobj_interactions"]));
580 $this->object->setObjectives(ilUtil::yn2tf($_POST["cobj_objectives"]));
581 $this->object->setTime_from_lms(ilUtil::yn2tf($_POST["cobj_time_from_lms"]));
582 $this->object->setCheck_values(ilUtil::yn2tf($_POST["cobj_check_values"]));
583 $this->object->setDebug(ilUtil::yn2tf($_POST["cobj_debug"]));
584 $this->object->update();
585 ilUtil::sendInfo($this->lng->txt("msg_obj_modified"), true);
586 $this->ctrl->redirect($this, "properties");
587 }
static yn2tf($a_yn)
convert "y"/"n" to true/false

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

+ Here is the call graph for this function:

◆ setSubTabs()

ilObjSCORMLearningModuleGUI::setSubTabs ( )

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

987 {
988 global $lng, $ilTabs, $ilCtrl, $ilAccess;
989
990 if($ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"])) {
991 $ilTabs->addSubTabTarget("cont_tracking_byuser",
992 $this->ctrl->getLinkTarget($this, "showTrackingItems"), array("edit", ""),
993 get_class($this));
994
995 $ilTabs->addSubTabTarget("cont_tracking_bysco",
996 $this->ctrl->getLinkTarget($this, "showTrackingItemsBySco"), array("edit", ""),
997 get_class($this));
998 }
999 if($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
1000 $ilTabs->addSubTabTarget("cont_tracking_modify",
1001 $this->ctrl->getLinkTarget($this, "modifyTrackingItems"), array("edit", ""),
1002 get_class($this));
1003 }
1004 }

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

Reimplemented in ilObjAICCLearningModuleGUI.

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

922 {
923 global $ilTabs;
924
925 include_once "./Services/Table/classes/class.ilTableGUI.php";
926
927 $this->setSubTabs();
928 $ilTabs->setTabActive("cont_tracking_data");
929 $ilTabs->setSubTabActive("cont_tracking_byuser");
930
931 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerUserTableGUI.php';
932 $tbl = new ilSCORMTrackingItemsPerUserTableGUI($this->object->getId(), $this, 'showTrackingItem');
933 $tbl->setUserId((int) $_REQUEST['user_id']);
934 $tbl->parse();
935 $this->tpl->setContent($tbl->getHTML());
936 return true;
937 }

References $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 963 of file class.ilObjSCORMLearningModuleGUI.php.

964 {
965 global $ilTabs;
966
967 include_once "./Services/Table/classes/class.ilTableGUI.php";
968
969 $this->setSubTabs();
970 $ilTabs->setTabActive("cont_tracking_data");
971 $ilTabs->setSubTabActive("cont_tracking_byuser");
972
973 $this->ctrl->setParameter($this,'obj_id',(int) $_REQUEST['obj_id']);
974 $this->ctrl->setParameter($this,'user_id',(int) $_REQUEST['user_id']);
975
976 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemPerUserTableGUI.php';
977 $tbl = new ilSCORMTrackingItemPerUserTableGUI($this->object->getId(), $this, 'showTrackingItemPerUser');
978 $tbl->setUserId((int) $_REQUEST['user_id']);
979 $tbl->setScoId((int) $_REQUEST['obj_id']);
980 $tbl->parse();
981 $this->tpl->setContent($tbl->getHTML());
982 return true;
983 }

References $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, and ilObjAICCLearningModuleGUI.

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

644 {
645 global $ilTabs, $ilAccess;
646
647 $ilTabs->setTabActive('cont_tracking_data');
648
649 if($ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"])) {
650
652 $ilTabs->setSubTabActive('cont_tracking_byuser');
653
654 $reports = array('exportSelectedSuccess','exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');
655
656 $userSelected = "all";
657 if (isset($_GET["userSelected"])) $userSelected = ilUtil::stripSlashes($_GET["userSelected"]);
658 if (isset($_POST["userSelected"])) $userSelected = ilUtil::stripSlashes($_POST["userSelected"]);
659 $this->ctrl->setParameter($this,'userSelected',$userSelected);
660
661 $report = "choose";
662 if (isset($_GET["report"])) $report = ilUtil::stripSlashes($_GET["report"]);
663 if (isset($_POST["report"])) $report = ilUtil::stripSlashes($_POST["report"]);
664 $this->ctrl->setParameter($this,'report',$report);
665
666 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerUserFilterGUI.php';
667 $filter = new ilSCORMTrackingItemsPerUserFilterGUI($this, 'showTrackingItems');
668 $filter->parse($userSelected,$report,$reports);
669 if($report == "choose") {
670 $this->tpl->setContent($filter->form->getHTML());
671 } else {
672 $usersSelected = array();
673 if ($userSelected != "all") $usersSelected[] = $userSelected;
674 else {
675 include_once "Services/Tracking/classes/class.ilTrQuery.php";
676 $users=ilTrQuery::getParticipantsForObject($this->ref_id);
677 foreach($users as $user) {
678 if(ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
679 $usersSelected[] = $user;
680 }
681 }
682 }
683 $scosSelected = array();
684 $scos=$this->object->getTrackedItems();
685 foreach($scos as $row)
686 {
687 $scosSelected[]=(int)$row->getId();
688 }
689
690 //with check for course ...
691 // include_once "Services/Tracking/classes/class.ilTrQuery.php";
692 // $a_users=ilTrQuery::getParticipantsForObject($this->ref_id);
693 // var_dump($this->object->getTrackedUsers(""));
694 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsTableGUI.php';
695 $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItems', $usersSelected, $scosSelected, $report);
696 $this->tpl->setContent($filter->form->getHTML().$tbl->getHTML());
697 }
698 }
699 else if($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
700 $this->modifyTrackingItems();
701 }
702 return true;
703 }
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

References $_GET, $_POST, $row, $tbl, 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 592 of file class.ilObjSCORMLearningModuleGUI.php.

593 {
594 global $ilTabs;
595
597 $ilTabs->setTabActive("cont_tracking_data");
598 $ilTabs->setSubTabActive("cont_tracking_bysco");
599
600 $reports = array('exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');//,'tracInteractionItem','tracInteractionUser','tracInteractionUserAnswers'
601 $scoSelected = "all";
602 if (isset($_GET["scoSelected"])) $scoSelected = ilUtil::stripSlashes($_GET["scoSelected"]);
603 if (isset($_POST["scoSelected"])) $scoSelected = ilUtil::stripSlashes($_POST["scoSelected"]);
604 $this->ctrl->setParameter($this,'scoSelected',$scoSelected);
605
606 $report = "choose";
607 if (isset($_GET["report"])) $report = ilUtil::stripSlashes($_GET["report"]);
608 if (isset($_POST["report"])) $report = ilUtil::stripSlashes($_POST["report"]);
609 $this->ctrl->setParameter($this,'report',$report);
610
611 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerScoFilterGUI.php';
612 $filter = new ilSCORMTrackingItemsPerScoFilterGUI($this, 'showTrackingItemsBySco');
613 $filter->parse($scoSelected,$report,$reports);
614 if($report == "choose") {
615 $this->tpl->setContent($filter->form->getHTML());
616 } else {
617 $scosSelected = array();
618 if ($scoSelected != "all") $scosSelected[] = $scoSelected;
619 else {
620 $scos=$this->object->getTrackedItems();
621 foreach($scos as $row)
622 {
623 $scosSelected[]=(int)$row->getId();
624 }
625 }
626 //with check for course ...
627 include_once "Services/Tracking/classes/class.ilTrQuery.php";
628 $a_users=ilTrQuery::getParticipantsForObject($this->ref_id);
629 // var_dump($this->object->getTrackedUsers(""));
630 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsTableGUI.php';
631 $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItemsBySco', $a_users, $scosSelected, $report);
632 $this->tpl->setContent($filter->form->getHTML().$tbl->getHTML());
633 }
634 return true;
635 }

References $_GET, $_POST, $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 942 of file class.ilObjSCORMLearningModuleGUI.php.

943 {
944 global $ilTabs;
945
946 include_once "./Services/Table/classes/class.ilTableGUI.php";
947
948 $this->setSubTabs();
949 $ilTabs->setTabActive("cont_tracking_data");
950 $ilTabs->setSubTabActive("cont_tracking_bysco");
951
952 include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsScoTableGUI.php';
953 $tbl = new ilSCORMTrackingItemsScoTableGUI($this->object->getId(), $this, 'showTrackingItemSco');
954 $tbl->setScoId((int) $_GET['obj_id']);
955 $tbl->parse();
956 $this->tpl->setContent($tbl->getHTML());
957 return true;
958 }

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

+ Here is the call graph for this function:

◆ stopUserOfflineMode()

ilObjSCORMLearningModuleGUI::stopUserOfflineMode ( )
protected

Stop offline mode for selected users.

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

1032 {
1033 if(!count((array) $_POST['user']))
1034 {
1035 ilUtil::sendFailure($this->lng->txt('select_one'),true);
1036 $this->ctrl->redirect($this,'offlineModeManager');
1037 }
1038 // display confirmation message
1039 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1040 $cgui = new ilConfirmationGUI();
1041 $cgui->setFormAction($this->ctrl->getFormAction($this));
1042 $cgui->setHeaderText($this->lng->txt("info_stop_offline_mode_sure"));
1043 $cgui->setCancel($this->lng->txt("cancel"), "cancelStopUserOfflineMode");
1044 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedStopUserOfflineMode");
1045 foreach($_POST["user"] as $id)
1046 {
1047 if (ilObject::_exists($id) && ilObject::_lookUpType($id)=="usr" )
1048 {
1049 $user = new ilObjUser($id);
1050 $caption = ilUtil::getImageTagByType("sahs_offline", $this->tpl->tplPath).
1051 " ".$this->lng->txt("stop_user_offline_mode_for_user").
1052 ": ".$user->getLastname().", ".$user->getFirstname();
1053 $cgui->addItem("user[]", $id, $caption);
1054 }
1055 }
1056 $this->tpl->setContent($cgui->getHTML());
1057 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_POST, 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: