19 declare(strict_types=1);
43 $this->db = $DIC->database();
44 $this->
lng = $DIC->language();
54 $query =
'SELECT cp_item.cp_node_id, cp_item.title ' 55 .
'FROM cp_item, cmi_node, cp_node ' 56 .
'WHERE cp_node.slm_id = %s ' 57 .
'AND cp_item.cp_node_id = cmi_node.cp_node_id ' 58 .
'AND cp_node.cp_node_id = cmi_node.cp_node_id ' 59 .
'GROUP BY cp_item.cp_node_id, cp_item.title';
66 $scoTitles[$row[
'cp_node_id']] = $row[
'title'];
78 $lng = $DIC->language();
82 $udh = self::userDataHeaderForExport();
85 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,' . $udh[
"cols"]
86 .
',audio_captioning,audio_level,completion_status,completion_threshold,credit,delivery_speed' 87 .
',c_entry,c_exit,c_language,c_location,c_mode,progress_measure,c_max,c_min,c_raw,scaled' 88 .
',scaled_passing_score,session_time,session_time_seconds,success_status,total_time,total_time_seconds,c_timestamp,suspend_data,launch_data' 90 $a_true = explode(
',', $udh[
"default"] .
",sco_title,success_status,completion_status");
91 for ($i = 0, $iMax = count($a_cols); $i < $iMax; $i++) {
92 $cols[$a_cols[$i]] = array(
"txt" => $lng->
txt($a_cols[$i]),
"default" =>
false);
94 for ($i = 0, $iMax = count($a_true); $i < $iMax; $i++) {
95 $cols[$a_true[$i]][
"default"] =
true;
107 bool $allowExportPrivacy,
115 $returnData = array();
123 $query =
'SELECT user_id, cp_node_id, ' 124 .
'audio_captioning, audio_level, completion_status, completion_threshold, credit, delivery_speed, ' 125 .
'c_entry, c_exit, c_language, location as c_location, c_mode, progress_measure, c_max, c_min, c_raw, scaled, ' 126 .
'scaled_passing_score, session_time, success_status, total_time, c_timestamp, suspend_data, launch_data ' 128 .
'WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' ' 129 .
'AND ' .
$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 132 $query .=
'cp_node_id, user_id';
134 $query .=
'user_id, cp_node_id';
140 foreach ($dbdata as
$data) {
141 $data[
"lm_id"] = $obj_id;
142 $data[
"lm_title"] = $lmTitle;
143 $data = array_merge($data, self::userDataArrayForExport((
int) $data[
"user_id"], $allowExportPrivacy));
144 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
145 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
146 $data[
"audio_captioning"] =
"" . $data[
"audio_captioning"];
147 $data[
"audio_level"] =
"" . $data[
"audio_level"];
148 $data[
"completion_status"] =
"" . $data[
"completion_status"];
149 $data[
"completion_threshold"] =
"" . $data[
"completion_threshold"];
150 $data[
"credit"] =
"" . $data[
"credit"];
151 $data[
"delivery_speed"] =
"" . $data[
"delivery_speed"];
152 $data[
"c_entry"] =
"" . $data[
"c_entry"];
153 $data[
"c_exit"] =
"" . $data[
"c_exit"];
154 $data[
"c_language"] =
"" . $data[
"c_language"];
155 $data[
"c_location"] =
"" . str_replace(
'"',
'', (
string) $data[
"c_location"]);
156 $data[
"c_mode"] =
"" . $data[
"c_mode"];
157 $data[
"progress_measure"] =
"" . $data[
"progress_measure"];
158 $data[
"c_max"] =
"" . $data[
"c_max"];
159 $data[
"c_min"] =
"" . $data[
"c_min"];
160 $data[
"c_raw"] =
"" . $data[
"c_raw"];
161 $data[
"scaled"] =
"" . $data[
"scaled"];
162 $data[
"scaled_passing_score"] =
"" . $data[
"scaled_passing_score"];
163 $data[
"session_time"] =
"" . $data[
"session_time"];
164 $data[
"session_time_seconds"] =
"";
165 if ($data[
"session_time"] !=
"") {
168 $data[
"success_status"] =
"" . $data[
"success_status"];
169 $data[
"total_time"] =
"" . $data[
"total_time"];
170 $data[
"total_time_seconds"] =
"";
171 if ($data[
"total_time"] !=
"") {
174 $data[
"c_timestamp"] = $data[
"c_timestamp"];
175 $data[
"suspend_data"] =
"" . $data[
"suspend_data"];
176 $data[
"launch_data"] =
"" . $data[
"launch_data"];
186 $returnData[] =
$data;
199 $lng = $DIC->language();
202 $udh = self::userDataHeaderForExport();
205 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,' . $udh[
"cols"]
206 .
',id,description,weighting,c_type,result,latency,latency_seconds,c_timestamp,learner_response' 210 $udh[
"default"] .
",sco_title,id,result,learner_response" 212 for ($i = 0, $iMax = count($a_cols); $i < $iMax; $i++) {
213 $cols[$a_cols[$i]] = array(
"txt" => $lng->
txt($a_cols[$i]),
"default" =>
false);
215 for ($i = 0, $iMax = count($a_true); $i < $iMax; $i++) {
216 $cols[$a_true[$i]][
"default"] =
true;
228 bool $allowExportPrivacy,
236 $returnData = array();
243 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, 244 cmi_interaction.cmi_interaction_id, 246 cmi_interaction.description, 247 cmi_interaction.weighting, 248 cmi_interaction.c_type, 249 cmi_interaction.result, 250 cmi_interaction.latency, 251 cmi_interaction.c_timestamp, 252 cmi_interaction.learner_response, 253 cmi_interaction.cmi_interaction_id, 254 cmi_interaction.cmi_node_id 255 FROM cmi_interaction, cmi_node 256 WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 257 AND ' .
$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 258 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 261 $query .=
'cmi_node.cp_node_id, cmi_node.user_id';
263 $query .=
'cmi_node.user_id, cmi_node.cp_node_id';
265 $query .=
', cmi_interaction.cmi_interaction_id, cmi_interaction.cmi_node_id';
270 foreach ($dbdata as
$data) {
271 $data[
"lm_id"] = $obj_id;
272 $data[
"lm_title"] = $lmTitle;
273 $data = array_merge($data, self::userDataArrayForExport((
int) $data[
"user_id"], $allowExportPrivacy));
274 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
275 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
276 $data[
"description"] =
"" . $data[
"description"];
277 $data[
"weighting"] =
"" . $data[
"weighting"];
278 $data[
"c_type"] =
"" . $data[
"c_type"];
279 $data[
"result"] =
"" . $data[
"result"];
280 $data[
"latency"] =
"" . $data[
"latency"];
281 $data[
"latency_seconds"] =
"";
282 if ($data[
"latency"] !=
"") {
285 $data[
"c_timestamp"] =
"" . $data[
"c_timestamp"];
286 $data[
"learner_response"] =
"" . str_replace(
'"',
'', $data[
"learner_response"]);
287 $returnData[] =
$data;
300 $lng = $DIC->language();
303 $udh = self::userDataHeaderForExport();
306 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,' . $udh[
"cols"]
307 .
',id,description,completion_status,progress_measure,success_status,scaled,c_max,c_min,c_raw,scope' 309 $a_true = explode(
',', $udh[
"default"] .
",sco_title,id,completion_status,success_status");
310 for ($i = 0, $iMax = count($a_cols); $i < $iMax; $i++) {
311 $cols[$a_cols[$i]] = array(
"txt" => $lng->
txt($a_cols[$i]),
"default" =>
false);
313 for ($i = 0, $iMax = count($a_true); $i < $iMax; $i++) {
314 $cols[$a_true[$i]][
"default"] =
true;
326 bool $allowExportPrivacy,
334 $returnData = array();
341 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, 342 cmi_objective.cmi_objective_id, 344 cmi_objective.description, 345 cmi_objective.completion_status, 346 cmi_objective.progress_measure, 347 cmi_objective.success_status, 348 cmi_objective.scaled, 353 FROM cmi_objective, cmi_node 354 WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 355 AND ' .
$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 356 AND cmi_node.cmi_node_id = cmi_objective.cmi_node_id 357 AND cmi_interaction_id is null 360 $query .=
'cmi_node.cp_node_id, cmi_node.user_id';
362 $query .=
'cmi_node.user_id, cmi_node.cp_node_id';
364 $query .=
', cmi_objective.cmi_node_id';
369 foreach ($dbdata as
$data) {
370 $data[
"lm_id"] = $obj_id;
371 $data[
"lm_title"] = $lmTitle;
372 $data = array_merge($data, self::userDataArrayForExport((
int) $data[
"user_id"], $allowExportPrivacy));
373 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
374 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
375 $data[
"description"] =
"" . $data[
"description"];
376 $data[
"completion_status"] =
"" . $data[
"completion_status"];
377 $data[
"progress_measure"] =
"" . $data[
"progress_measure"];
378 $data[
"success_status"] =
"" . $data[
"success_status"];
379 $data[
"scaled"] =
"" . $data[
"scaled"];
380 $data[
"c_max"] =
"" . $data[
"c_max"];
381 $data[
"c_min"] =
"" . $data[
"c_min"];
382 $data[
"c_raw"] =
"" . $data[
"c_raw"];
383 $data[
"scope"] =
"" . $data[
"scope"];
384 $returnData[] =
$data;
397 $lng = $DIC->language();
400 $udh = self::userDataHeaderForExport();
403 'lm_id,lm_title,' . $udh[
"cols"]
404 .
',Status,satisfied,measure,c_raw,c_min,c_max,completion_status,progress_measure' 406 $a_true = explode(
',', $udh[
"default"] .
",lm_title,Status,satisfied,completion_status");
407 for ($i = 0, $iMax = count($a_cols); $i < $iMax; $i++) {
408 $cols[$a_cols[$i]] = array(
"txt" => $lng->
txt($a_cols[$i]),
"default" =>
false);
410 for ($i = 0, $iMax = count($a_true); $i < $iMax; $i++) {
411 $cols[$a_true[$i]][
"default"] =
true;
424 $returnData = array();
426 $query =
'SELECT user_id, scope_id, 437 AND ' .
$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' 438 ORDER BY user_id, scope_id';
439 $res =
$ilDB->queryF($query, array(
'integer'), array($obj_id));
443 foreach ($dbdata as
$data) {
444 $data[
"lm_id"] = $data[
"scope_id"];
445 $data[
"lm_title"] = $lmTitle;
446 $data = array_merge($data, self::userDataArrayForExport((
int) $data[
"user_id"], $allowExportPrivacy));
447 $data[
"Status"] =
"" . $data[
"status"];
448 $data[
"satisfied"] =
"" . $data[
"satisfied"];
449 $data[
"measure"] =
"" . $data[
"measure"];
450 $data[
"c_raw"] =
"" . $data[
"c_raw"];
451 $data[
"c_min"] =
"" . $data[
"c_min"];
452 $data[
"c_max"] =
"" . $data[
"c_max"];
453 $data[
"completion_status"] =
"" . $data[
"completion_status"];
454 $data[
"progress_measure"] =
"" . $data[
"progress_measure"];
455 $returnData[] =
$data;
468 $lng = $DIC->language();
473 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title' 474 .
',id,description,counter_all' 475 .
',counter_correct,counter_correct_percent' 476 .
',counter_incorrect,counter_incorrect_percent' 477 .
',counter_other,counter_other_percent' 479 $a_true = explode(
',',
"sco_title,description,counter_correct,counter_incorrect");
480 for ($i = 0, $iMax = count($a_cols); $i < $iMax; $i++) {
481 $cols[$a_cols[$i]] = array(
"txt" => $lng->
txt($a_cols[$i]),
"default" =>
false);
483 for ($i = 0, $iMax = count($a_true); $i < $iMax; $i++) {
484 $cols[$a_true[$i]][
"default"] =
true;
496 bool $allowExportPrivacy,
504 $returnData = array();
510 $a_correct = array();
511 $a_incorrect = array();
512 $query =
'SELECT cmi_node.cp_node_id, cmi_interaction.id, count(*) as counter 513 FROM cmi_interaction, cmi_node 514 WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 515 AND ' .
$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 516 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 517 AND cmi_interaction.result = %s 518 GROUP BY cmi_node.cp_node_id,cmi_interaction.id';
520 $res =
$ilDB->queryF($query, array(
'text'), array(
'correct'));
522 $a_correct[$row[
'cp_node_id'] .
':' . $row[
'id']] = $row[
'counter'];
525 $res =
$ilDB->queryF($query, array(
'text'), array(
'incorrect'));
527 $a_incorrect[$row[
'cp_node_id'] .
':' . $row[
'id']] = $row[
'counter'];
531 $query =
'SELECT cmi_node.cp_node_id, cmi_interaction.id, cmi_interaction.description, count(*) as counter_all 532 FROM cmi_interaction, cmi_node 533 WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 534 AND ' .
$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 535 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 536 GROUP BY cmi_node.cp_node_id,cmi_interaction.id,cmi_interaction.description';
541 foreach ($dbdata as
$data) {
542 $skey = $data[
"cp_node_id"] .
':' . $data[
"id"];
543 $all = $data[
"counter_all"];
545 if ($a_correct[$skey] !=
null) {
546 $correct = $a_correct[$skey];
549 if ($a_incorrect[$skey] !=
null) {
550 $incorrect = $a_incorrect[$skey];
552 $other = $all - ($correct + $incorrect);
553 $data[
"lm_id"] = $obj_id;
554 $data[
"lm_title"] = $lmTitle;
555 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
556 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
558 $data[
"description"] =
"" . $data[
"description"];
560 $data[
"counter_correct"] = $correct;
561 $data[
"counter_correct_percent"] = $correct * 100 / $all;
562 $data[
"counter_incorrect"] = $incorrect;
563 $data[
"counter_incorrect_percent"] = $incorrect * 100 / $all;
564 $data[
"counter_other"] = $other;
565 $data[
"counter_other_percent"] = $other * 100 / $all;
566 $returnData[] =
$data;
578 $lng = $DIC->language();
582 $udh = self::userDataHeaderForExport();
585 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,' . $udh[
"cols"]
586 .
',counter_i_correct,counter_i_correct_percent' 587 .
',counter_i_incorrect,counter_i_incorrect_percent' 588 .
',counter_i_other,counter_i_other_percent' 589 .
',audio_captioning,audio_level,completion_status,completion_threshold,credit,delivery_speed' 590 .
',c_entry,c_exit,c_language,c_location,c_mode,progress_measure,c_max,c_min,c_raw,scaled' 591 .
',scaled_passing_score,session_time,session_time_seconds,success_status,total_time,total_time_seconds,c_timestamp,suspend_data,launch_data' 593 $a_true = explode(
',', $udh[
"default"] .
',sco_title' 594 .
',counter_i_correct,counter_i_correct_percent' 595 .
',counter_i_incorrect,counter_i_incorrect_percent' 596 .
',counter_i_other,counter_i_other_percent' 598 for ($i = 0, $iMax = count($a_cols); $i < $iMax; $i++) {
599 $cols[$a_cols[$i]] = array(
"txt" => $lng->
txt($a_cols[$i]),
"default" =>
false);
601 for ($i = 0, $iMax = count($a_true); $i < $iMax; $i++) {
602 $cols[$a_true[$i]][
"default"] =
true;
614 bool $allowExportPrivacy,
622 $returnData = array();
628 $a_correct = array();
629 $a_incorrect = array();
631 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, count(*) as counter 632 FROM cmi_interaction, cmi_node 633 WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 634 AND ' .
$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 635 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 636 AND cmi_interaction.result = %s 637 GROUP BY cmi_node.user_id,cmi_node.cp_node_id';
639 $res =
$ilDB->queryF($query, array(
'text'), array(
'correct'));
641 $a_correct[$row[
'user_id'] .
':' . $row[
'cp_node_id']] = $row[
'counter'];
644 $res =
$ilDB->queryF($query, array(
'text'), array(
'incorrect'));
646 $a_incorrect[$row[
'user_id'] .
':' . $row[
'cp_node_id']] = $row[
'counter'];
649 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, count(*) as counter 650 FROM cmi_interaction, cmi_node 651 WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 652 AND ' .
$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 653 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 654 AND cmi_interaction.result <> %s AND cmi_interaction.result <> %s 655 GROUP BY cmi_node.user_id,cmi_node.cp_node_id';
656 $res =
$ilDB->queryF($query, array(
'text',
'text'), array(
'correct',
'incorrect'));
658 $a_other[$row[
'user_id'] .
':' . $row[
'cp_node_id']] = $row[
'counter'];
662 $query =
'SELECT user_id, cp_node_id, ' 663 .
'audio_captioning, audio_level, completion_status, completion_threshold, credit, delivery_speed, ' 664 .
'c_entry, c_exit, c_language, location as c_location, c_mode, progress_measure, c_max, c_min, c_raw, scaled, ' 665 .
'scaled_passing_score, session_time, success_status, total_time, c_timestamp, suspend_data, launch_data ' 667 .
'WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' ' 668 .
'AND ' .
$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 671 $query .=
'cp_node_id, user_id';
673 $query .=
'user_id, cp_node_id';
679 foreach ($dbdata as
$data) {
680 $skey = $data[
"user_id"] .
':' . $data[
"cp_node_id"];
682 if ($a_correct[$skey] !=
null) {
683 $correct = $a_correct[$skey];
686 if ($a_incorrect[$skey] !=
null) {
687 $incorrect = $a_incorrect[$skey];
690 if ($a_other[$skey] !=
null) {
691 $other = $a_other[$skey];
693 $all = $correct + $incorrect + $other;
694 $data[
"lm_id"] = $obj_id;
695 $data[
"lm_title"] = $lmTitle;
696 $data = array_merge($data, self::userDataArrayForExport((
int) $data[
"user_id"], $allowExportPrivacy));
697 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
698 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
699 $data[
"counter_i_correct"] = $correct;
701 $data[
"counter_i_correct_percent"] = $correct * 100 / $all;
703 $data[
"counter_i_correct_percent"] = 0;
705 $data[
"counter_i_incorrect"] = $incorrect;
707 $data[
"counter_i_incorrect_percent"] = $incorrect * 100 / $all;
709 $data[
"counter_i_incorrect_percent"] = 0;
711 $data[
"counter_i_other"] = $other;
713 $data[
"counter_i_other_percent"] = $other * 100 / $all;
715 $data[
"counter_i_other_percent"] = 0;
717 $data[
"audio_captioning"] =
"" . $data[
"audio_captioning"];
718 $data[
"audio_level"] =
"" . $data[
"audio_level"];
719 $data[
"completion_status"] =
"" . $data[
"completion_status"];
720 $data[
"completion_threshold"] =
"" . $data[
"completion_threshold"];
721 $data[
"credit"] =
"" . $data[
"credit"];
722 $data[
"delivery_speed"] =
"" . $data[
"delivery_speed"];
723 $data[
"c_entry"] =
"" . $data[
"c_entry"];
724 $data[
"c_exit"] =
"" . $data[
"c_exit"];
725 $data[
"c_language"] =
"" . $data[
"c_language"];
726 $data[
"c_location"] =
"" . str_replace(
'"',
'', $data[
"c_location"]);
727 $data[
"c_mode"] =
"" . $data[
"c_mode"];
728 $data[
"progress_measure"] =
"" . $data[
"progress_measure"];
729 $data[
"c_max"] =
"" . $data[
"c_max"];
730 $data[
"c_min"] =
"" . $data[
"c_min"];
731 $data[
"c_raw"] =
"" . $data[
"c_raw"];
732 $data[
"scaled"] =
"" . $data[
"scaled"];
733 $data[
"scaled_passing_score"] =
"" . $data[
"scaled_passing_score"];
734 $data[
"session_time"] =
"" . $data[
"session_time"];
735 $data[
"session_time_seconds"] =
"";
736 if ($data[
"session_time"] !=
"") {
739 $data[
"success_status"] =
"" . $data[
"success_status"];
740 $data[
"total_time"] =
"" . $data[
"total_time"];
741 $data[
"total_time_seconds"] =
"";
742 if ($data[
"total_time"] !=
"") {
745 $data[
"c_timestamp"] = $data[
"c_timestamp"];
746 $data[
"suspend_data"] =
"" . $data[
"suspend_data"];
747 $data[
"launch_data"] =
"" . $data[
"launch_data"];
757 $returnData[] =
$data;
769 bool $b_allowExportPrivacy
773 $lng = $DIC->language();
774 $ilDB = $DIC->database();
778 $a_interaction = array();
779 $a_interactionDescription = array();
781 $query =
'SELECT cmi_node.cp_node_id, 782 cmi_interaction.cmi_interaction_id, 784 cmi_interaction.description 785 FROM cmi_interaction, cmi_node 786 WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 787 AND ' .
$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 788 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 791 $query .=
'cmi_node.cp_node_id, cmi_node.user_id';
793 $query .=
'cmi_node.user_id, cmi_node.cp_node_id';
795 $query .=
', cmi_interaction.cmi_interaction_id, cmi_interaction.id';
801 foreach ($dbdata as
$data) {
802 $key = $data[
"cp_node_id"] .
':' . $data[
"id"];
804 for ($i = 0, $iMax = count($a_interaction); $i < $iMax; $i++) {
805 if ($a_interaction[$i] == $key) {
809 if ($exist ==
false) {
810 $a_interaction[] = $key;
812 if ($a_interactionDescription[$key] ==
null) {
813 $a_interactionDescription[$key] =
"" . $data[
"description"];
816 $udh = self::userDataHeaderForExport();
817 $a_cols = explode(
',',
'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,' . $udh[
"cols"]);
818 $a_true = explode(
',', $udh[
"default"] .
",sco_title");
819 for ($i = 0, $iMax = count($a_cols); $i < $iMax; $i++) {
820 $cols[$a_cols[$i]] = array(
"txt" => $lng->
txt($a_cols[$i]),
"default" =>
false);
822 for ($i = 0, $iMax = count($a_true); $i < $iMax; $i++) {
823 $cols[$a_true[$i]][
"default"] =
true;
825 for ($i = 0, $iMax = count($a_interaction); $i < $iMax; $i++) {
831 $cols[
"interaction_value" . $i .
" " . $a_interactionDescription[$a_interaction[$i]]] = array(
833 $lng->
txt(
"interaction_value"),
835 ) .
" " . $a_interactionDescription[$a_interaction[$i]],
849 bool $allowExportPrivacy,
857 $returnData = array();
863 $a_interaction = array();
864 $a_interactionId = array();
865 $a_interactionDescription = array();
866 $a_interactionUser = array();
868 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, 869 cmi_interaction.cmi_interaction_id, 871 cmi_interaction.result, 872 cmi_interaction.description 873 FROM cmi_interaction, cmi_node 874 WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 875 AND ' .
$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 876 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 879 $query .=
'cmi_node.cp_node_id, cmi_node.user_id';
881 $query .=
'cmi_node.user_id, cmi_node.cp_node_id';
883 $query .=
', cmi_interaction.cmi_interaction_id, cmi_interaction.id';
888 foreach ($dbdata as
$data) {
889 $key = $data[
"cp_node_id"] .
':' . $data[
"id"];
891 for ($i = 0, $iMax = count($a_interaction); $i < $iMax; $i++) {
892 if ($a_interaction[$i] == $key) {
899 if ($exist ==
false) {
900 $a_interaction[] = $key;
901 $a_interactionId[$key] =
"" . $data[
"id"];
902 $a_interactionDescription[$key] =
"" . $data[
"description"];
904 $key .=
':' . $data[
"user_id"];
905 $a_interactionUser[$key] =
"" . $data[
"result"];
910 $query =
'SELECT user_id, cp_node_id ' 912 .
'WHERE ' .
$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' ' 913 .
'AND ' .
$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 917 $query .=
'cp_node_id, user_id';
919 $query .=
'user_id, cp_node_id';
925 foreach ($dbdata as $data) {
926 for ($i = 0, $iMax = count($a_interaction); $i < $iMax; $i++) {
932 $intdesc =
"interaction_value" . $i .
" " . $a_interactionDescription[$a_interaction[$i]];
933 $data[$intdesc] =
"";
934 $ukey = $a_interaction[$i] .
':' . $data[
"user_id"];
935 if ($a_interactionUser[$ukey] !=
null) {
936 $data[$intdesc] = $a_interactionUser[$ukey];
939 $data[
"lm_id"] = $obj_id;
940 $data[
"lm_title"] = $lmTitle;
941 $data = array_merge($data, self::userDataArrayForExport((
int) $data[
"user_id"], $allowExportPrivacy));
942 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
943 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
944 $returnData[] =
$data;
958 $query =
'SELECT count(distinct(cp_node.cp_node_id)) counter ' 959 .
'FROM cp_node, cp_resource, cp_item ' 960 .
'WHERE cp_item.cp_node_id = cp_node.cp_node_id ' 961 .
'AND cp_item.resourceid = cp_resource.id AND scormtype = %s ' 962 .
'AND nodename = %s AND cp_node.slm_id = %s';
965 array(
'text',
'text',
'integer'),
966 array(
'sco',
'item', $obj_id)
969 $scoCounter = (
int) $row[
'counter'];
972 $u_startedSCO = array();
973 $u_completedSCO = array();
974 $u_passedSCO = array();
975 foreach ($a_user as $value) {
976 $u_startedSCO[$value] = 0;
977 $u_completedSCO[$value] = 0;
978 $u_passedSCO[$value] = 0;
981 $query =
'SELECT user_id, count(*) counter ' 982 .
'FROM cmi_node, cp_node ' 983 .
'WHERE cmi_node.cp_node_id = cp_node.cp_node_id ' 984 .
'AND cp_node.slm_id = %s ' 985 .
'AND ' .
$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 986 .
'GROUP BY user_id';
993 $u_startedSCO[
$data[
'user_id']] = $data[
'counter'];
996 $query =
'SELECT user_id, count(*) counter ' 997 .
'FROM cmi_node, cp_node ' 998 .
'WHERE cmi_node.cp_node_id = cp_node.cp_node_id ' 999 .
'AND cp_node.slm_id = %s ' 1000 .
"AND cmi_node.completion_status = 'completed' " 1001 .
'AND ' .
$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 1002 .
'GROUP BY user_id';
1009 $u_completedSCO[
$data[
'user_id']] = $data[
'counter'];
1012 $query =
'SELECT user_id, count(*) counter ' 1013 .
'FROM cmi_node, cp_node ' 1014 .
'WHERE cmi_node.cp_node_id = cp_node.cp_node_id ' 1015 .
'AND cp_node.slm_id = %s ' 1016 .
"AND cmi_node.success_status = 'passed' " 1017 .
'AND ' .
$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 1018 .
'GROUP BY user_id';
1025 $u_passedSCO[
$data[
'user_id']] = $data[
'counter'];
1030 $query =
'SELECT * FROM sahs_user WHERE obj_id = ' .
$ilDB->quote($obj_id,
'integer')
1031 .
' AND ' .
$ilDB->in(
'user_id', $a_user,
false,
'integer')
1032 .
' ORDER BY user_id';
1034 while ($row =
$ilDB->fetchAssoc(
$res)) {
1040 $allowExportPrivacy,
Class ilSCORM2004TrackingItems.
exportSelectedSuccessRows(array $a_user, bool $allowExportPrivacy, array $dbdata, int $scoCounter, array $u_startedSCO, array $u_completedSCO, array $u_passedSCO, int $obj_id, string $lmTitle)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static exportSelectedObjectivesColumns()
exportSelectedInteractions(array $a_user, array $a_sco, bool $b_orderBySCO, bool $allowExportPrivacy, int $obj_id, string $lmTitle)
static exportSelectedCoreColumns(bool $b_orderBySCO, bool $b_allowExportPrivacy)
exportSelectedObjectives(array $a_user, array $a_sco, bool $b_orderBySCO, bool $allowExportPrivacy, int $obj_id, string $lmTitle)
static _ISODurationToCentisec(string $str)
convert ISO 8601 Timeperiods to centiseconds
exportSelectedCore(array $a_user, array $a_sco, bool $b_orderBySCO, bool $allowExportPrivacy, int $obj_id, string $lmTitle)
loadLanguageModule(string $a_module)
Load language module.
tracInteractionUserAnswers(array $a_user, array $a_sco, bool $b_orderBySCO, bool $allowExportPrivacy, int $obj_id, string $lmTitle)
exportObjGlobalToSystem(array $a_user, bool $allowExportPrivacy, int $obj_id, string $lmTitle)
static tracInteractionItemColumns(bool $b_orderBySCO, bool $b_allowExportPrivacy)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
tracInteractionUser(array $a_user, array $a_sco, bool $b_orderBySCO, bool $allowExportPrivacy, int $obj_id, string $lmTitle)
markedLearningStatusForExportSelected(array $a_scos, int $obj_id)
static tracInteractionUserAnswersColumns(array $a_user, array $a_sco, bool $b_orderBySCO, bool $b_allowExportPrivacy)
static tracInteractionUserColumns(bool $b_orderBySCO, bool $b_allowExportPrivacy)
tracInteractionItem(array $a_user, array $a_sco, bool $b_orderBySCO, bool $allowExportPrivacy, int $obj_id, string $lmTitle)
scoTitlesForExportSelected(int $obj_id)
Class ilSCORMTrackingItems.
static exportSelectedInteractionsColumns()
static exportObjGlobalToSystemColumns()
exportSelectedSuccess(array $a_user, bool $allowExportPrivacy, int $obj_id, string $lmTitle)