5 require_once
"classes/class.ilObjectGUI.php";
6 require_once(
"classes/class.ilFileSystemGUI.php");
7 require_once(
"classes/class.ilTabsGUI.php");
8 require_once(
"Services/User/classes/class.ilObjUser.php");
10 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleGUI.php");
11 require_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
37 $lng->loadLanguageModule(
"content");
38 $lng->loadLanguageModule(
"search");
41 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
42 #$this->tabs_gui =& new ilTabsGUI();
52 if ($this->call_by_reference)
71 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
74 $this->tpl->setCurrentBlock(
"btn_cell");
75 $this->tpl->setVariable(
"BTN_LINK",
76 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID());
77 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"ilContObj".$this->object->getID().
"\" ");
78 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
79 $this->tpl->parseCurrentBlock();
83 $this->tpl->setCurrentBlock(
"btn_cell");
84 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"newModuleVersion"));
85 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"cont_sc_new_version"));
86 $this->tpl->parseCurrentBlock();
90 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.sahs_properties.html",
"Modules/ScormAicc");
91 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
92 $this->tpl->setVariable(
"TXT_PROPERTIES", $this->lng->txt(
"cont_lm_properties"));
95 $this->tpl->setVariable(
"TXT_ONLINE", $this->lng->txt(
"cont_online"));
96 $this->tpl->setVariable(
"CBOX_ONLINE",
"cobj_online");
97 $this->tpl->setVariable(
"VAL_ONLINE",
"y");
98 if ($this->object->getOnline())
100 $this->tpl->setVariable(
"CHK_ONLINE",
"checked");
104 $this->tpl->setVariable(
"TXT_API_ADAPTER", $this->lng->txt(
"cont_api_adapter"));
105 $this->tpl->setVariable(
"VAL_API_ADAPTER", $this->object->getAPIAdapterName());
108 $this->tpl->setVariable(
"TXT_API_PREFIX", $this->lng->txt(
"cont_api_func_prefix"));
109 $this->tpl->setVariable(
"VAL_API_PREFIX", $this->object->getAPIFunctionsPrefix());
112 $this->tpl->setVariable(
"TXT_LESSON_MODE", $this->lng->txt(
"cont_def_lesson_mode"));
113 $lesson_modes = array(
"normal" => $this->lng->txt(
"cont_sc_less_mode_normal"),
114 "browse" => $this->lng->txt(
"cont_sc_less_mode_browse"));
116 "lesson_mode", $lesson_modes,
false,
true);
117 $this->tpl->setVariable(
"SEL_LESSON_MODE", $sel_lesson);
120 $this->tpl->setVariable(
"TXT_CREDIT_MODE", $this->lng->txt(
"cont_credit_mode"));
121 $credit_modes = array(
"credit" => $this->lng->txt(
"cont_credit_on"),
122 "no_credit" => $this->lng->txt(
"cont_credit_off"));
124 "credit_mode", $credit_modes,
false,
true);
125 $this->tpl->setVariable(
"SEL_CREDIT_MODE", $sel_credit);
128 $this->tpl->setVariable(
"TXT_AUTO_REVIEW", $this->lng->txt(
"cont_sc_auto_review"));
129 $this->tpl->setVariable(
"CBOX_AUTO_REVIEW",
"auto_review");
130 $this->tpl->setVariable(
"VAL_AUTO_REVIEW",
"y");
131 if ($this->object->getAutoReview())
133 $this->tpl->setVariable(
"CHK_AUTO_REVIEW",
"checked");
137 $this->tpl->setVariable(
"MAX_ATTEMPTS", $this->lng->txt(
"cont_sc_max_attempt"));
138 $this->tpl->setVariable(
"VAL_MAX_ATTEMPT", $this->object->getMaxAttempt());
141 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"cont_sc_version"));
142 $this->tpl->setVariable(
"VAL_VERSION", $this->object->getModuleVersion());
145 $this->tpl->setVariable(
"TXT_SESSION", $this->lng->txt(
"cont_sc_usession"));
146 $this->tpl->setVariable(
"CBOX_SESSION",
"cobj_session");
147 $this->tpl->setVariable(
"VAL_SESSION",
"y");
148 if ($this->object->getSession())
150 $this->tpl->setVariable(
"CHK_SESSION",
"checked");
154 $this->tpl->setVariable(
"TXT_AUTO_CONTINUE", $this->lng->txt(
"cont_sc_auto_continue"));
155 $this->tpl->setVariable(
"CBOX_AUTO_CONTINUE",
"auto_continue");
156 $this->tpl->setVariable(
"VAL_AUTO_CONTINUE",
"y");
157 if ($this->object->getAutoContinue())
159 $this->tpl->setVariable(
"CHK_AUTO_CONTINUE",
"checked");
163 $this->tpl->setVariable(
"TXT_DEBUG", $this->lng->txt(
"cont_debug"));
164 $this->tpl->setVariable(
"CBOX_DEBUG",
"cobj_debug");
165 $this->tpl->setVariable(
"VAL_DEBUG",
"y");
166 if ($this->object->getDebug())
168 $this->tpl->setVariable(
"CHK_DEBUG",
"checked");
172 $this->tpl->setCurrentBlock(
"commands");
173 $this->tpl->setVariable(
"BTN_NAME",
"saveProperties");
174 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
175 $this->tpl->parseCurrentBlock();
189 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.scorm_new_version_import.html",
"Modules/ScormAicc");
192 $this->tpl->setVariable(
"ALT_IMG", $this->lng->txt(
"obj_sahs"));
194 $this->ctrl->setParameter($this,
"new_type",
"sahs");
195 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
197 $this->tpl->setVariable(
"BTN_NAME",
"newModuleVersionUpload");
198 $this->tpl->setVariable(
"TARGET",
' target="'.
201 $this->tpl->setVariable(
"TXT_SELECT_LMTYPE", $this->lng->txt(
"type"));
203 if (
$type ==
"scorm2004") {
204 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"lm_type_scorm2004"));
206 $this->tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"lm_type_scorm"));
209 include_once
'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
215 $file = htmlspecialchars($file, ENT_QUOTES,
"utf-8");
216 $this->tpl->setCurrentBlock(
"option_uploaded_file");
217 $this->tpl->setVariable(
"UPLOADED_FILENAME", $file);
218 $this->tpl->setVariable(
"TXT_UPLOADED_FILENAME", $file);
219 $this->tpl->parseCurrentBlock();
221 $this->tpl->setCurrentBlock(
"select_uploaded_file");
222 $this->tpl->setVariable(
"TXT_SELECT_FROM_UPLOAD_DIR", $this->lng->txt(
"cont_select_from_upload_dir"));
223 $this->tpl->setVariable(
"TXT_UPLOADED_FILE", $this->lng->txt(
"cont_uploaded_file"));
224 $this->tpl->parseCurrentBlock();
227 $this->tpl->setVariable(
"TXT_UPLOAD", $this->lng->txt(
"upload"));
228 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
229 $this->tpl->setVariable(
"TXT_IMPORT_LM", $this->lng->txt(
"import_sahs"));
230 $this->tpl->setVariable(
"TXT_SELECT_FILE", $this->lng->txt(
"select_file"));
233 $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").
" ".$this->
getMaxFileSize());
240 $umf=get_cfg_var(
"upload_max_filesize");
242 $pms=get_cfg_var(
"post_max_size");
245 $multiplier_a=array(
"K"=>1024,
"M"=>1024*1024,
"G"=>1024*1024*1024);
247 $umf_parts=preg_split(
"/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
248 $pms_parts=preg_split(
"/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
250 if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
251 if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
254 $max_filesize=min($umf, $pms);
256 if (!$max_filesize) $max_filesize=max($umf, $pms);
259 return $max_filesize=sprintf(
"%.1f MB",$max_filesize/1024/1024);
265 global $_FILES, $rbacsystem;
267 $unzip = PATH_TO_UNZIP;
268 $tocheck =
"imsmanifest.xml";
270 include_once
'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
273 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
275 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->WARNING);
277 elseif ($_FILES[
"scormfile"][
"name"])
280 $source = $_FILES[
"scormfile"][
"tmp_name"];
281 if (($source ==
'none') || (!$source))
288 elseif (
$_POST[
"uploaded_file"])
293 $this->ilias->raiseError($this->lng->txt(
"upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
298 $source = CLIENT_WEB_DIR .
"/" .
$_POST[
"uploaded_file"];
300 $source_is_copy =
true;
311 $pathinfo = pathinfo($source);
312 $dir = $pathinfo[
"dirname"];
313 $file = $pathinfo[
"basename"];
321 $tmp_file =
$dir.
"/".$tocheck.
".".
$_GET[
"ref_id"];
323 rename(
$dir.
"/".$tocheck,$tmp_file);
324 $new_manifest = file_get_contents($tmp_file);
330 $old_manifest = file_get_contents($this->object->getDataDirectory().
"/".$tocheck);
333 $check =
'/xmlns="http:\/\/www.imsglobal.org\/xsd\/imscp_v1p1"/';
334 $replace=
"xmlns=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2\"";
335 $reload_manifest = preg_replace($check, $replace, $new_manifest);
338 if (strcmp($new_manifest,$old_manifest) == 0 || strcmp(utf8_encode($new_manifest),$old_manifest) == 0 ||
339 strcmp ($reload_manifest, $old_manifest) == 0 || strcmp(utf8_encode($reload_manifest),$old_manifest) == 0 ){
342 $module_version = $this->
object->getModuleVersion();
344 if ($_FILES[
"scormfile"][
"name"])
347 $file_path = $this->
object->getDataDirectory().
"/".$_FILES[
"scormfile"][
"name"].
".".$module_version;
355 $file_path = $this->
object->getDataDirectory().
"/".
$_POST[
"uploaded_file"].
".".$module_version;
358 rename($source, $file_path);
366 $this->
object->setModuleVersion($module_version+1);
367 $this->
object->update();
394 $this->
object->setAPIAdapterName(
$_POST[
"api_adapter"]);
395 $this->
object->setAPIFunctionsPrefix(
$_POST[
"api_func_prefix"]);
396 $this->
object->setCreditMode(
$_POST[
"credit_mode"]);
397 $this->
object->setDefaultLessonMode(
$_POST[
"lesson_mode"]);
398 $this->
object->setMaxAttempt(
$_POST[
"max_attempt"]);
402 $this->
object->update();
404 $this->ctrl->redirect($this,
"properties");
417 include_once
"./Services/Table/classes/class.ilTableGUI.php";
421 $ilTabs->setSubTabActive(
"cont_tracking_bysco");
422 $ilTabs->setTabActive(
"cont_tracking_data");
426 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
428 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.scorm_track_items_sco.html",
"Modules/ScormAicc");
432 $this->tpl->setVariable(
"FORMACTION",
"adm_object.php?ref_id=".$this->ref_id.
"$obj_str&cmd=gateway");
438 $tbl->setTitle($this->lng->txt(
"cont_tracking_items"));
440 $tbl->setHeaderNames(array($this->lng->txt(
"title")));
442 $header_params = array(
"ref_id" => $this->ref_id,
"cmd" =>
$_GET[
"cmd"],
443 "cmdClass" => get_class($this),
"baseClass"=>
"ilSAHSEditGUI");
444 $cols = array(
"title");
445 $tbl->setHeaderVars($cols, $header_params);
446 $tbl->setColumnWidth(array(
"100%"));
449 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
450 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
451 $tbl->setLimit(
$_GET[
"limit"]);
452 $tbl->setOffset(
$_GET[
"offset"]);
453 $tbl->setMaxCount($this->maxcount);
459 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
460 #$tbl->disable("footer");
463 $items = $this->
object->getTrackedItems();
465 $item_array = array();
466 foreach($items as $item)
468 $tmp[
'title'] = $item->getTitle();
469 $tmp[
'id'] = $item->getId();
471 $item_array[] = $tmp;
475 $tbl->setMaxCount(count($items));
476 $items = array_slice($items,
$_GET[
"offset"],
$_GET[
"limit"]);
480 if (count($items) > 0)
482 foreach ($items as $item)
484 $this->tpl->setCurrentBlock(
"tbl_content");
485 $this->tpl->setVariable(
"TXT_ITEM_TITLE", $item[
'title']);
486 $this->ctrl->setParameter($this,
"obj_id", $item[
'id']);
487 $this->tpl->setVariable(
"LINK_ITEM",
488 $this->ctrl->getLinkTarget($this,
"showTrackingItemSco"));
491 $this->tpl->setVariable(
"CSS_ROW", $css_row);
492 $this->tpl->parseCurrentBlock();
497 $this->tpl->setCurrentBlock(
"notfound");
498 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
499 $this->tpl->setVariable(
"NUM_COLS", $num);
500 $this->tpl->parseCurrentBlock();
512 include_once
"./Services/Table/classes/class.ilTableGUI.php";
516 $ilTabs->setSubTabActive(
"cont_tracking_byuser");
517 $ilTabs->setTabActive(
"cont_tracking_data");
521 if (
$_POST[
"search_string"] !=
"")
524 }
else if (isset(
$_POST[
"search_string"]) &&
$_POST[
"search_string"] ==
"") {
530 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl_scorm_track_items_search.html",
"Modules/ScormAicc");
532 $this->tpl->addBlockfile(
"USR_TABLE",
"usr_table",
"tpl.table.html");
534 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.scorm_track_items.html",
"Modules/ScormAicc");
538 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
544 if (isset(
$_SESSION[
"scorm_search_string"])) {
545 $tbl->setTitle($this->lng->txt(
"cont_tracking_items").
' - Aktive Suche: "'.
$_SESSION[
"scorm_search_string"].
'"');
547 $tbl->setTitle($this->lng->txt(
"cont_tracking_items"));
551 $tbl->setHeaderNames(array(
"",$this->lng->txt(
"name"), $this->lng->txt(
"last_access"), $this->lng->txt(
"attempts"), $this->lng->txt(
"version") ));
553 $header_params = $this->ctrl->getParameterArray($this,
"showTrackingItems");
555 $tbl->setColumnWidth(array(
"1%",
"35%",
"20%",
"15%",
"15%",
"15%"));
558 $cols = array(
"user_id",
"username",
"last_access",
"attempts",
"version");
560 $tbl->setHeaderVars($cols, $header_params);
563 $_GET[
"sort_order"] =
$_GET[
"sort_order"] ?
$_GET[
"sort_order"] :
"asc";
567 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
568 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
569 $tbl->setLimit(
$_GET[
"limit"]);
570 $tbl->setOffset(
$_GET[
"offset"]);
571 $tbl->setMaxCount($this->maxcount);
573 $this->tpl->setVariable(
"COLUMN_COUNTS", 6);
577 $this->tpl->setCurrentBlock(
"tbl_action_btn");
578 $this->tpl->setVariable(
"BTN_NAME",
"deleteTrackingForUser");
579 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
580 $this->tpl->parseCurrentBlock();
583 $this->tpl->setCurrentBlock(
"tbl_action_btn");
584 $this->tpl->setVariable(
"BTN_NAME",
"decreaseAttempts");
585 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"decrease_attempts"));
586 $this->tpl->parseCurrentBlock();
589 $this->tpl->setCurrentBlock(
"tbl_action_btn");
590 $this->tpl->setVariable(
"BTN_NAME",
"exportSelected");
591 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"export"));
592 $this->tpl->parseCurrentBlock();
596 $this->tpl->setVariable(
"EXPORT_ACTION",$this->ctrl->getFormAction($this));
598 $this->tpl->setVariable(
"EXPORT_ALL_VALUE", $this->lng->txt(
'cont_export_all'));
599 $this->tpl->setVariable(
"EXPORT_ALL_NAME",
"exportAll");
600 $this->tpl->setVariable(
"IMPORT_VALUE", $this->lng->txt(
'import'));
601 $this->tpl->setVariable(
"IMPORT_NAME",
"Import");
603 $this->tpl->setVariable(
"SEARCH_TXT_SEARCH",$this->lng->txt(
'search'));
604 $this->tpl->setVariable(
"SEARCH_ACTION",$this->ctrl->getFormAction($this));
605 $this->tpl->setVariable(
"SEARCH_NAME",
'showTrackingItems');
606 if (isset(
$_SESSION[
"scorm_search_string"])) {
607 $this->tpl->setVariable(
"STYLE",
'display:inline;');
609 $this->tpl->setVariable(
"STYLE",
'display:none;');
611 $this->tpl->setVariable(
"SEARCH_VAL",
$_SESSION[
"scorm_search_string"]);
612 $this->tpl->setVariable(
"SEARCH_VALUE",$this->lng->txt(
'search_users'));
613 $this->tpl->parseCurrentBlock();
616 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
618 $items = $this->
object->getTrackedUsers(
$_SESSION[
"scorm_search_string"]);
619 $tbl->setMaxCount(count($items));
622 $items = array_slice($items,
$_GET[
"offset"],
$_GET[
"limit"]);
626 if (count($items) > 0)
628 foreach ($items as $item)
630 if (
ilObject::_exists($item[
"user_id"]) && ilObject::_lookUpType($item[
"user_id"])==
"usr")
632 $this->tpl->setCurrentBlock(
"tbl_content");
633 $this->tpl->setVariable(
"VAL_USERNAME",$item[
"username"]);
634 $this->tpl->setVariable(
"VAL_LAST", $item[
"last_access"]);
635 $this->tpl->setVariable(
"VAL_ATTEMPT",$item[
"attempts"]);
636 $this->tpl->setVariable(
"VAL_VERSION", $item[
"version"]);
638 $this->ctrl->setParameter($this,
"user_id", $item[
"user_id"]);
639 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
640 $this->tpl->setVariable(
"LINK_ITEM",
641 $this->ctrl->getLinkTarget($this,
"showTrackingItem"));
642 $this->tpl->setVariable(
"CHECKBOX_ID", $item[
"user_id"]);
644 $this->tpl->setVariable(
"CSS_ROW", $css_row);
645 $this->tpl->parseCurrentBlock();
648 $this->tpl->setCurrentBlock(
"selectall");
649 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
650 $this->tpl->setVariable(
"CSS_ROW", $css_row);
651 $this->tpl->parseCurrentBlock();
656 $this->tpl->setCurrentBlock(
"notfound");
657 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
658 $this->tpl->setVariable(
"NUM_COLS", $num);
659 $this->tpl->parseCurrentBlock();
667 $this->ctrl->redirect($this,
"showTrackingItems");
677 if(!isset(
$_POST[
"user"]))
679 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
685 $this->data[
"cols"] = array(
"type",
"title",
"description");
687 foreach(
$_POST[
"user"] as $id)
691 $this->data[
"data"][
"$id"] = array(
693 "title" => $user->getLastname().
", ".$user->getFirstname(),
694 "desc" => $this->lng->txt(
"cont_trackinging_data")
699 $this->data[
"buttons"] = array(
"cancelDelete" => $this->lng->txt(
"cancel"),
700 "confirmedDelete" => $this->lng->txt(
"confirm"));
706 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
709 foreach ($this->data[
"cols"] as $key)
711 $this->tpl->setCurrentBlock(
"table_header");
712 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
713 $this->tpl->parseCurrentBlock();
720 foreach($this->data[
"data"] as $key => $value)
723 foreach($value as $key => $cell_data)
725 $this->tpl->setCurrentBlock(
"table_cell");
734 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
736 $this->tpl->parseCurrentBlock();
739 $this->tpl->setCurrentBlock(
"table_row");
741 $this->tpl->parseCurrentBlock();
747 foreach($this->data[
"buttons"] as
$name => $value)
749 $this->tpl->setCurrentBlock(
"operation_btn");
750 $this->tpl->setVariable(
"BTN_NAME",
$name);
751 $this->tpl->setVariable(
"BTN_VALUE",$value);
752 $this->tpl->parseCurrentBlock();
760 session_unregister(
"scorm_user_delete");
762 $this->ctrl->redirect($this,
"showTrackingItems");
767 global
$ilDB, $ilUser;
770 foreach (
$_SESSION[
"scorm_user_delete"] as $user)
772 $ret = $ilDB->manipulateF(
'
773 DELETE FROM scorm_tracking
776 array(
'integer',
'integer'),
777 array($user,$this->object->getID()));
781 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
784 $this->ctrl->redirect($this,
"showTrackingItems");
793 $this->ctrl->redirect($this,
"properties");
803 if (!isset(
$_POST[
"type"])) {
809 $source = $_FILES[
"datafile"][
"tmp_name"];
810 if (($source ==
'none') || (!$source))
815 $error = $this->
object->importTrackingData($source);
819 $this->ctrl->redirect($this,
"showTrackingItems");
837 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.scorm_tracking_data_import.html",
"Modules/ScormAicc");
840 $this->tpl->setVariable(
"ALT_IMG", $this->lng->txt(
"obj_sahs"));
842 $this->ctrl->setParameter($this,
"new_type",
"sahs");
843 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
845 $this->tpl->setVariable(
"BTN_NAME",
"import");
846 $this->tpl->setVariable(
"TARGET",
' target="'.
849 $this->tpl->setVariable(
"TXT_SELECT_LMTYPE", $this->lng->txt(
"type"));
851 $this->tpl->setVariable(
"TXT_TYPE",
"CSV");
853 $this->tpl->setVariable(
"TXT_UPLOAD", $this->lng->txt(
"upload"));
854 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
855 $this->tpl->setVariable(
"TXT_IMPORT_TRACKING", $this->lng->txt(
"cont_import_tracking"));
856 $this->tpl->setVariable(
"TXT_SELECT_FILE", $this->lng->txt(
"select_file"));
858 $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").
" ".$this->
getMaxFileSize());
868 if (!isset(
$_POST[
"user"]))
871 $this->ctrl->redirect($this,
"showTrackingItems");
879 if (!isset(
$_POST[
"export_type"])) {
883 if (isset(
$_POST[
"cancel"])) {
884 $this->ctrl->redirect($this,
"showTrackingItems");
886 $a_export_all =
$_POST[
"export_all"];
887 if (
$_POST[
"export_type"]==
"raw") {
888 $this->
object->exportSelectedRaw($a_export_all, unserialize(stripslashes(
$_POST[
"user"])));
890 $this->
object->exportSelected($a_export_all, unserialize(stripslashes(
$_POST[
"user"])));
903 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.scorm_tracking_data_export.html",
"Modules/ScormAicc");
906 $this->tpl->setVariable(
"ALT_IMG", $this->lng->txt(
"obj_sahs"));
908 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"cont_export_options"));
910 $this->ctrl->setParameter($this,
"new_type",
"sahs");
911 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
913 $this->tpl->setVariable(
"BTN_NAME",
"export");
915 $this->tpl->setVariable(
"TARGET",
' target="'.
918 $this->tpl->setVariable(
"TXT_SELECT_TYPE", $this->lng->txt(
"cont_export_type"));
919 $this->tpl->setVariable(
"TXT_EXPORT_RAW", $this->lng->txt(
"cont_export_raw"));
920 $this->tpl->setVariable(
"TXT_EXPORT_SUCCESS", $this->lng->txt(
"cont_export_success"));
921 $this->tpl->setVariable(
"TXT_EXPORT_TRACKING", $this->lng->txt(
"cont_export_tracking"));
923 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
924 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
925 $this->tpl->setVariable(
"VAL_USER", htmlentities(serialize($a_users)));
926 $this->tpl->setVariable(
"VAL_EXPORTALL",$a_export_all);
934 global
$ilDB, $ilUser;
936 if (!isset(
$_POST[
"user"]))
941 foreach (
$_POST[
"user"] as $user)
946 $val_set = $ilDB->queryF(
'
947 SELECT * FROM scorm_tracking
952 array(
'integer',
'integer',
'text',
'integer'),
953 array($user,0,
'package_attempts',$this->object->getID()));
955 $val_rec = $ilDB->fetchAssoc($val_set);
957 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
958 if ($val_rec[
"rvalue"] != null && $val_rec[
"rvalue"] != 0)
960 $new_rec = $val_rec[
"rvalue"]-1;
962 if(
$res = $ilDB->numRows($val_set) > 0)
964 $ilDB->update(
'scorm_tracking',
966 'rvalue' => array(
'clob', $new_rec)
969 'user_id' => array(
'integer', $user),
970 'sco_id' => array(
'integer', 0),
971 'obj_id' => array(
'integer', $this->object->getId()),
972 'lvalue' => array(
'text',
'package_attempts')
978 $ilDB->insert(
'scorm_tracking', array(
979 'rvalue' => array(
'clob', $new_rec),
980 'user_id' => array(
'integer', $user),
981 'sco_id' => array(
'integer', 0),
982 'obj_id' => array(
'integer', $this->object->getId()),
983 'lvalue' => array(
'text',
'package_attempts')
987 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
993 $this->ctrl->redirect($this,
"showTrackingItems");
1004 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1007 $ilTabs->setTabActive(
"cont_tracking_data");
1008 $ilTabs->setSubTabActive(
"cont_tracking_byuser");
1011 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1013 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.scorm_track_item.html",
"Modules/ScormAicc");
1018 $this->tpl->setVariable(
"FORMACTION",
"adm_object.php?ref_id=".$this->ref_id.
"$obj_str&cmd=gateway");
1023 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
1028 $tbl->setTitle($user->getLastname().
", ".$user->getFirstname());
1030 $tbl->setHeaderNames(array($this->lng->txt(
"title"),
1031 $this->lng->txt(
"cont_status"), $this->lng->txt(
"cont_time"),
1032 $this->lng->txt(
"cont_score")));
1034 $header_params = array(
"ref_id" => $this->ref_id,
"cmd" =>
$_GET[
"cmd"],
1035 "cmdClass" => get_class($this),
"obj_id" =>
$_GET[
"obj_id"],
"baseClass"=>
"ilSAHSEditGUI",
'user_id'=>
$_GET[
"user_id"]);
1036 $cols = array(
"title",
"status",
"time",
"score");
1037 $tbl->setHeaderVars($cols, $header_params);
1041 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1042 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1043 $tbl->setLimit(
$_GET[
"limit"]);
1044 $tbl->setOffset(
$_GET[
"offset"]);
1045 $tbl->setMaxCount($this->maxcount);
1051 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1052 #$tbl->disable("footer");
1054 $tr_data = $this->
object->getTrackingDataAgg(
$_GET[
"user_id"]);
1058 $tbl->setMaxCount(count($tr_data));
1059 $tr_data = array_slice($tr_data,
$_GET[
"offset"],
$_GET[
"limit"]);
1062 if (count($tr_data) > 0)
1064 foreach ($tr_data as
$data)
1066 $this->tpl->setCurrentBlock(
"tbl_content");
1067 $this->tpl->setVariable(
"VAL_TITLE", $data[
"title"]);
1068 $this->ctrl->setParameter($this,
"user_id",
$_GET[
"user_id"]);
1069 $this->ctrl->setParameter($this,
"obj_id", $data[
"sco_id"]);
1071 $this->tpl->setVariable(
"LINK_SCO",
1072 $this->ctrl->getLinkTarget($this,
"showTrackingItemPerUser"));
1073 $this->tpl->setVariable(
"VAL_TIME", $data[
"time"]);
1074 $this->tpl->setVariable(
"VAL_STATUS", $data[
"status"]);
1075 $this->tpl->setVariable(
"VAL_SCORE", $data[
"score"]);
1078 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1079 $this->tpl->parseCurrentBlock();
1085 $this->tpl->setCurrentBlock(
"notfound");
1086 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1087 $this->tpl->setVariable(
"NUM_COLS", $num);
1088 $this->tpl->parseCurrentBlock();
1100 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1103 $ilTabs->setTabActive(
"cont_tracking_data");
1104 $ilTabs->setSubTabActive(
"cont_tracking_bysco");
1107 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1109 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.scorm_track_item_sco.html",
"Modules/ScormAicc");
1113 $this->tpl->setVariable(
"FORMACTION",
"adm_object.php?ref_id=".$this->ref_id.
"$obj_str&cmd=gateway");
1118 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
1122 $tbl->setTitle($sc_item->getTitle());
1124 $tbl->setHeaderNames(array($this->lng->txt(
"name"),
1125 $this->lng->txt(
"cont_status"), $this->lng->txt(
"cont_time"),
1126 $this->lng->txt(
"cont_score")));
1128 $header_params = $this->ctrl->getParameterArray($this,
"showTrackingItemSco");
1129 $header_params[
'obj_id'] = (int)
$_GET[
'obj_id'];
1131 $cols = array(
"name",
"status",
"time",
"score");
1132 $tbl->setHeaderVars($cols, $header_params);
1136 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1137 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1138 $tbl->setLimit(
$_GET[
"limit"]);
1139 $tbl->setOffset(
$_GET[
"offset"]);
1140 $tbl->setMaxCount($this->maxcount);
1146 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1147 #$tbl->disable("footer");
1149 $tr_data = $this->
object->getTrackingDataAggSco(
$_GET[
"obj_id"]);
1152 foreach($tr_data as
$data)
1155 $data[
'name'] =
$name[
'lastname'].
', '.
$name[
'firstname'];
1162 $tbl->setMaxCount(count($tr_data));
1166 $tr_data = array_slice($tr_data,
$_GET[
"offset"],
$_GET[
"limit"]);
1169 if (count($tr_data) > 0)
1171 foreach ($tr_data as $data)
1175 $this->tpl->setCurrentBlock(
"tbl_content");
1176 $user =
new ilObjUser($data[
"user_id"]);
1177 $this->tpl->setVariable(
"VAL_USERNAME", $user->getLastname().
", ".
1178 $user->getFirstname());
1179 $this->ctrl->setParameter($this,
"user_id", $data[
"user_id"]);
1180 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
1181 $this->tpl->setVariable(
"LINK_USER",
1182 $this->ctrl->getLinkTarget($this,
"showTrackingItemPerUser"));
1183 $this->tpl->setVariable(
"VAL_TIME", $data[
"time"]);
1184 $this->tpl->setVariable(
"VAL_STATUS", $data[
"status"]);
1185 $this->tpl->setVariable(
"VAL_SCORE", $data[
"score"]);
1188 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1189 $this->tpl->parseCurrentBlock();
1195 $this->tpl->setCurrentBlock(
"notfound");
1196 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1197 $this->tpl->setVariable(
"NUM_COLS", $num);
1198 $this->tpl->parseCurrentBlock();
1209 $ilTabs->setTabActive(
"cont_tracking_data");
1211 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1214 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1216 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.scorm_track_item_per_user.html",
"Modules/ScormAicc");
1220 $this->tpl->setVariable(
"FORMACTION",
"adm_object.php?ref_id=".$this->ref_id.
"$obj_str&cmd=gateway");
1225 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
1230 $tbl->setTitle($sc_item->getTitle().
" - ".$user->getLastname().
", ".$user->getFirstname());
1232 $tbl->setHeaderNames(array($this->lng->txt(
"cont_lvalue"), $this->lng->txt(
"cont_rvalue")));
1234 $header_params = array(
"ref_id" => $this->ref_id,
"cmd" =>
$_GET[
"cmd"],
1235 "cmdClass" => get_class($this),
"obj_id" =>
$_GET[
"obj_id"],
1236 "user_id" =>
$_GET[
"user_id"],
"baseClass"=>
"ilSAHSEditGUI");
1237 $cols = array(
"lvalue",
"rvalue");
1238 $tbl->setHeaderVars($cols, $header_params);
1242 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1243 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1244 $tbl->setLimit(
$_GET[
"limit"]);
1245 $tbl->setOffset(
$_GET[
"offset"]);
1246 $tbl->setMaxCount($this->maxcount);
1252 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1253 #$tbl->disable("footer");
1255 $tr_data = $this->
object->getTrackingDataPerUser(
$_GET[
"obj_id"],
$_GET[
"user_id"]);
1258 $tbl->setMaxCount(count($tr_data));
1259 $tr_data = array_slice($tr_data,
$_GET[
"offset"],
$_GET[
"limit"]);
1262 if (count($tr_data) > 0)
1264 foreach ($tr_data as
$data)
1266 $this->tpl->setCurrentBlock(
"tbl_content");
1267 $this->tpl->setVariable(
"VAR", $data[
"lvalue"]);
1268 $this->tpl->setVariable(
"VAL", $data[
"rvalue"]);
1271 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1272 $this->tpl->parseCurrentBlock();
1277 $this->tpl->setCurrentBlock(
"notfound");
1278 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1279 $this->tpl->setVariable(
"NUM_COLS", $num);
1280 $this->tpl->parseCurrentBlock();
1289 $ilTabs->addSubTabTarget(
"cont_tracking_byuser",
1290 $this->ctrl->getLinkTarget($this,
"showTrackingItems"), array(
"edit",
""),
1293 $ilTabs->addSubTabTarget(
"cont_tracking_bysco",
1294 $this->ctrl->getLinkTarget($this,
"showTrackingItemsBySco"), array(
"edit",
""),