19 declare(strict_types=1);
46 public function __construct(
int $a_obj_id, ?
object $a_parent_obj,
string $a_parent_cmd, array $a_userSelected, array $a_scosSelected,
string $a_report)
50 $this->
ctrl = $DIC->ctrl();
51 $lng = $DIC->language();
54 $this->
access = $DIC->access();
55 $this->rbacsystem = $DIC->rbac()->system();
57 $this->obj_id = $a_obj_id;
58 $this->report = $a_report;
59 $this->scosSelected = $a_scosSelected;
60 $this->userSelected = $a_userSelected;
61 if ($a_parent_cmd ===
"showTrackingItemsBySco") {
64 if ($a_parent_obj !==
null) {
65 $this->lmTitle = $a_parent_obj->getObject()->getTitle();
66 $this->
setId(
'2004' . $this->report);
70 $this->allowExportPrivacy = $privacy->enabledExportSCORM();
79 if (in_array($l, array(
"status",
"time",
"score"))) {
84 $s = $this->
lng->txt($l);
85 if (substr($l, 0, 14) ===
"interaction_id") {
86 $s = $this->
lng->txt(substr($l, 0, 14)) .
' ' . substr($l, 14);
88 if (substr($l, 0, 17) ===
"interaction_value") {
89 $s = sprintf($this->
lng->txt(substr($l, 0, 17)), substr($l, 17, (strpos($l,
' ') - 17))) . substr($l, strpos($l,
' '));
91 if (substr($l, 0, 23) ===
"interaction_description") {
92 $s = $this->
lng->txt(substr($l, 0, 23)) .
' ' . substr($l, 23);
97 $this->
setRowTemplate(
'tpl.scorm2004_tracking_items.html',
'components/ILIAS/Scorm2004');
121 switch ($this->report) {
122 case "exportSelectedCore":
125 case "exportSelectedInteractions":
128 case "exportSelectedObjectives":
131 case "exportObjGlobalToSystem":
134 case "tracInteractionItem":
137 case "tracInteractionUser":
140 case "tracInteractionUserAnswers":
143 case "exportSelectedSuccess":
162 switch ($this->report) {
163 case "exportSelectedCore":
164 $tr_data = $ilSCORM2004TrackingItems->exportSelectedCore((array) $this->userSelected, (array) $this->scosSelected, $this->bySCO, $this->allowExportPrivacy, $this->
getObjId(), $this->lmTitle);
166 case "exportSelectedInteractions":
167 $tr_data = $ilSCORM2004TrackingItems->exportSelectedInteractions((array) $this->userSelected, (array) $this->scosSelected, $this->bySCO, $this->allowExportPrivacy, $this->
getObjId(), $this->lmTitle);
169 case "exportSelectedObjectives":
170 $tr_data = $ilSCORM2004TrackingItems->exportSelectedObjectives((array) $this->userSelected, (array) $this->scosSelected, $this->bySCO, $this->allowExportPrivacy, $this->
getObjId(), $this->lmTitle);
172 case "exportObjGlobalToSystem":
173 $tr_data = $ilSCORM2004TrackingItems->exportObjGlobalToSystem((array) $this->userSelected, $this->allowExportPrivacy, $this->
getObjId(), $this->lmTitle);
175 case "tracInteractionItem":
176 $tr_data = $ilSCORM2004TrackingItems->tracInteractionItem((array) $this->userSelected, (array) $this->scosSelected, $this->bySCO, $this->allowExportPrivacy, $this->
getObjId(), $this->lmTitle);
178 case "tracInteractionUser":
179 $tr_data = $ilSCORM2004TrackingItems->tracInteractionUser((array) $this->userSelected, (array) $this->scosSelected, $this->bySCO, $this->allowExportPrivacy, $this->
getObjId(), $this->lmTitle);
181 case "tracInteractionUserAnswers":
182 $tr_data = $ilSCORM2004TrackingItems->tracInteractionUserAnswers((array) $this->userSelected, (array) $this->scosSelected, $this->bySCO, $this->allowExportPrivacy, $this->
getObjId(), $this->lmTitle);
184 case "exportSelectedSuccess":
185 $tr_data = $ilSCORM2004TrackingItems->exportSelectedSuccess((array) $this->userSelected, $this->allowExportPrivacy, $this->
getObjId(), $this->lmTitle);
209 if ($id ===
"status") {
211 $path = $icons->getImagePathForStatus((
int) $value);
216 elseif ($id ===
"launch_data" || $id ===
"suspend_data") {
219 if (is_numeric($value)) {
220 return round((
float) $value, 2);
229 protected function fillRow(array $a_set): void
232 $this->tpl->setCurrentBlock(
"user_field");
233 $val = $this->
parseValue($c, $a_set[$c],
"scormtrac");
234 $this->tpl->setVariable(
"VAL_UF", $val);
235 $this->tpl->parseCurrentBlock();
244 $a_excel->
setCell($a_row, $cnt, $labels[$c][
"txt"]);
255 if ($c !==
'status') {
256 $val = $this->
parseValue($c, $a_set[$c],
"user");
260 $a_excel->
setCell($a_row, $cnt, $val);
280 if ($c !==
'status') {
281 $val = $this->
parseValue($c, $a_set[$c],
"user");
Class ilSCORM2004TrackingItems.
setExportFormats(array $formats)
Set available export formats.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
static exportSelectedObjectivesColumns()
static exportSelectedCoreColumns(bool $b_orderBySCO, bool $b_allowExportPrivacy)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
loadLanguageModule(string $a_module)
Load language module.
static exportSelectedSuccessColumns()
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static tracInteractionItemColumns(bool $b_orderBySCO, bool $b_allowExportPrivacy)
__construct(int $a_obj_id, ?object $a_parent_obj, string $a_parent_cmd, array $a_userSelected, array $a_scosSelected, string $a_report)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setExternalSorting(bool $a_val)
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
Class ilSCORM2004TrackingItemsTableGUI.
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static tracInteractionUserAnswersColumns(array $a_user, array $a_sco, bool $b_orderBySCO, bool $b_allowExportPrivacy)
static stableSortArray(array $array, string $a_array_sortby, string $a_array_sortorder="asc", bool $a_numeric=false)
Sort an aray using a stable sort algorithm, which preveserves the sequence of array elements which ha...
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
parseValue(string $id, float|int|string|null $value, string $type)
fillHeaderExcel(ilExcel $a_excel, int &$a_row)
fillRow(array $a_set)
Fill table row.
__construct(Container $dic, ilPlugin $plugin)
static tracInteractionUserColumns(bool $b_orderBySCO, bool $b_allowExportPrivacy)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
fillHeaderCSV(ilCSVWriter $a_csv)
static exportSelectedInteractionsColumns()
determineOffsetAndOrder(bool $a_omit_offset=false)
setEnableHeader(bool $a_enableheader)
static exportObjGlobalToSystemColumns()