4 include_once
'./Modules/ScormAicc/classes/class.ilSCORMTrackingItems.php';
5 include_once
'./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
19 $query =
'SELECT cp_item.cp_node_id, cp_item.title ' 20 .
'FROM cp_item, cmi_node, cp_node ' 21 .
'WHERE cp_node.slm_id = %s ' 22 .
'AND cp_item.cp_node_id = cmi_node.cp_node_id ' 23 .
'AND cp_node.cp_node_id = cmi_node.cp_node_id ' 24 .
'GROUP BY cp_item.cp_node_id, cp_item.title';
30 while(
$row = $ilDB->fetchAssoc(
$res))
32 $scoTitles[
$row[
'cp_node_id']] = $row[
'title'];
39 $lng->loadLanguageModule(
"scormtrac");
42 $udh=self::userDataHeaderForExport();
44 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,'.$udh[
"cols"]
45 .
',audio_captioning,audio_level,completion_status,completion_threshold,credit,delivery_speed' 46 .
',c_entry,c_exit,c_language,c_location,c_mode,progress_measure,c_max,c_min,c_raw,scaled' 47 .
',scaled_passing_score,session_time,session_time_seconds,success_status,total_time,total_time_seconds,c_timestamp,suspend_data,launch_data');
48 $a_true=explode(
',',$udh[
"default"].
",sco_title,success_status,completion_status");
49 for ($i=0;$i<count($a_cols);$i++) {
50 $cols[$a_cols[$i]] =
array(
"txt" => $lng->txt($a_cols[$i]),
"default" =>
false);
52 for ($i=0;$i<count($a_true);$i++) {
53 $cols[$a_true[$i]][
"default"] =
true;
60 $lng->loadLanguageModule(
"scormtrac");
62 $returnData =
array();
64 $scoTitles = self::scoTitlesForExportSelected($obj_id);
66 $scoProgress = self::markedLearningStatusForExportSelected($scoTitles, $obj_id);
70 $query =
'SELECT user_id, cp_node_id, ' 71 .
'audio_captioning, audio_level, completion_status, completion_threshold, credit, delivery_speed, ' 72 .
'c_entry, c_exit, c_language, location as c_location, c_mode, progress_measure, c_max, c_min, c_raw, scaled, ' 73 .
'scaled_passing_score, session_time, success_status, total_time, c_timestamp, suspend_data, launch_data ' 75 .
'WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' ' 76 .
'AND '.$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 78 if ($b_orderBySCO)
$query.=
'cp_node_id, user_id';
79 else $query.=
'user_id, cp_node_id';
81 while(
$row = $ilDB->fetchAssoc(
$res))
85 foreach($dbdata as
$data) {
86 $data[
"lm_id"] = $obj_id;
87 $data[
"lm_title"] = $this->lmTitle;
88 $data=array_merge($data,self::userDataArrayForExport($data[
"user_id"], $allowExportPrivacy));
89 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
90 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
91 $data[
"audio_captioning"] =
"".$data[
"audio_captioning"];
92 $data[
"audio_level"] =
"".$data[
"audio_level"];
93 $data[
"completion_status"] =
"".$data[
"completion_status"];
94 $data[
"completion_threshold"] =
"".$data[
"completion_threshold"];
95 $data[
"credit"] =
"".$data[
"credit"];
96 $data[
"delivery_speed"] =
"".$data[
"delivery_speed"];
97 $data[
"c_entry"] =
"".$data[
"c_entry"];
98 $data[
"c_exit"] =
"".$data[
"c_exit"];
99 $data[
"c_language"] =
"".$data[
"c_language"];
100 $data[
"c_location"] =
"".str_replace(
'"',
'',$data[
"c_location"]);
101 $data[
"c_mode"] =
"".$data[
"c_mode"];
102 $data[
"progress_measure"] =
"".$data[
"progress_measure"];
103 $data[
"c_max"] =
"".$data[
"c_max"];
104 $data[
"c_min"] =
"".$data[
"c_min"];
105 $data[
"c_raw"] =
"".$data[
"c_raw"];
106 $data[
"scaled"] =
"".$data[
"scaled"];
107 $data[
"scaled_passing_score"] =
"".$data[
"scaled_passing_score"];
108 $data[
"session_time"] =
"".$data[
"session_time"];
109 $data[
"session_time_seconds"] =
"";
111 $data[
"success_status"] =
"".$data[
"success_status"];
112 $data[
"total_time"] =
"".$data[
"total_time"];
113 $data[
"total_time_seconds"] =
"";
115 $data[
"c_timestamp"] = $data[
"c_timestamp"];
116 $data[
"suspend_data"] =
"".$data[
"suspend_data"];
117 $data[
"launch_data"] =
"".$data[
"launch_data"];
135 $lng->loadLanguageModule(
"scormtrac");
137 $udh=self::userDataHeaderForExport();
139 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,'.$udh[
"cols"]
140 .
',id,description,weighting,c_type,result,latency,latency_seconds,c_timestamp,learner_response');
141 $a_true=explode(
',',$udh[
"default"].
",sco_title,id,result,learner_response");
142 for ($i=0;$i<count($a_cols);$i++) {
143 $cols[$a_cols[$i]] =
array(
"txt" => $lng->txt($a_cols[$i]),
"default" =>
false);
145 for ($i=0;$i<count($a_true);$i++) {
146 $cols[$a_true[$i]][
"default"] =
true;
153 $lng->loadLanguageModule(
"scormtrac");
155 $returnData =
array();
157 $scoTitles = self::scoTitlesForExportSelected($obj_id);
159 $scoProgress = self::markedLearningStatusForExportSelected($scoTitles, $obj_id);
162 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, 163 cmi_interaction.cmi_interaction_id, 165 cmi_interaction.description, 166 cmi_interaction.weighting, 167 cmi_interaction.c_type, 168 cmi_interaction.result, 169 cmi_interaction.latency, 170 cmi_interaction.c_timestamp, 171 cmi_interaction.learner_response, 172 cmi_interaction.cmi_interaction_id, 173 cmi_interaction.cmi_node_id 174 FROM cmi_interaction, cmi_node 175 WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 176 AND '.$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 177 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 179 if ($b_orderBySCO)
$query.=
'cmi_node.cp_node_id, cmi_node.user_id';
180 else $query.=
'cmi_node.user_id, cmi_node.cp_node_id';
181 $query.=
', cmi_interaction.cmi_interaction_id, cmi_interaction.cmi_node_id';
183 while(
$row = $ilDB->fetchAssoc(
$res))
187 foreach($dbdata as
$data) {
188 $data[
"lm_id"] = $obj_id;
189 $data[
"lm_title"] = $this->lmTitle;
190 $data=array_merge($data,self::userDataArrayForExport($data[
"user_id"], $allowExportPrivacy));
191 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
192 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
193 $data[
"description"] =
"".$data[
"description"];
194 $data[
"weighting"] =
"".$data[
"weighting"];
195 $data[
"c_type"] =
"".$data[
"c_type"];
196 $data[
"result"] =
"".$data[
"result"];
197 $data[
"latency"] =
"".$data[
"latency"];
198 $data[
"latency_seconds"] =
"";
200 $data[
"c_timestamp"] =
"".$data[
"c_timestamp"];
201 $data[
"learner_response"] =
"".str_replace(
'"',
'',$data[
"learner_response"]);
210 $lng->loadLanguageModule(
"scormtrac");
212 $udh=self::userDataHeaderForExport();
214 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,'.$udh[
"cols"]
215 .
',id,description,completion_status,progress_measure,success_status,scaled,c_max,c_min,c_raw,scope');
216 $a_true=explode(
',',$udh[
"default"].
",sco_title,id,completion_status,success_status");
217 for ($i=0;$i<count($a_cols);$i++) {
218 $cols[$a_cols[$i]] =
array(
"txt" => $lng->txt($a_cols[$i]),
"default" =>
false);
220 for ($i=0;$i<count($a_true);$i++) {
221 $cols[$a_true[$i]][
"default"] =
true;
228 $lng->loadLanguageModule(
"scormtrac");
230 $returnData =
array();
232 $scoTitles = self::scoTitlesForExportSelected($obj_id);
234 $scoProgress = self::markedLearningStatusForExportSelected($scoTitles, $obj_id);
237 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, 238 cmi_objective.cmi_objective_id, 240 cmi_objective.description, 241 cmi_objective.completion_status, 242 cmi_objective.progress_measure, 243 cmi_objective.success_status, 244 cmi_objective.scaled, 249 FROM cmi_objective, cmi_node 250 WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 251 AND '.$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 252 AND cmi_node.cmi_node_id = cmi_objective.cmi_node_id 253 AND cmi_interaction_id is null 255 if ($b_orderBySCO)
$query.=
'cmi_node.cp_node_id, cmi_node.user_id';
256 else $query.=
'cmi_node.user_id, cmi_node.cp_node_id';
257 $query.=
', cmi_objective.cmi_node_id';
259 while(
$row = $ilDB->fetchAssoc(
$res))
263 foreach($dbdata as
$data) {
264 $data[
"lm_id"] = $obj_id;
265 $data[
"lm_title"] = $this->lmTitle;
266 $data=array_merge($data,self::userDataArrayForExport($data[
"user_id"], $allowExportPrivacy));
267 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
268 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
269 $data[
"description"] =
"".$data[
"description"];
270 $data[
"completion_status"] =
"".$data[
"completion_status"];
271 $data[
"progress_measure"] =
"".$data[
"progress_measure"];
272 $data[
"success_status"] =
"".$data[
"success_status"];
273 $data[
"scaled"] =
"".$data[
"scaled"];
274 $data[
"c_max"] =
"".$data[
"c_max"];
275 $data[
"c_min"] =
"".$data[
"c_min"];
276 $data[
"c_raw"] =
"".$data[
"c_raw"];
277 $data[
"scope"] =
"".$data[
"scope"];
286 $lng->loadLanguageModule(
"scormtrac");
288 $udh=self::userDataHeaderForExport();
290 'lm_id,lm_title,'.$udh[
"cols"]
291 .
',Status,satisfied,measure,c_raw,c_min,c_max,completion_status,progress_measure');
292 $a_true=explode(
',',$udh[
"default"].
",lm_title,Status,satisfied,completion_status");
293 for ($i=0;$i<count($a_cols);$i++) {
294 $cols[$a_cols[$i]] =
array(
"txt" => $lng->txt($a_cols[$i]),
"default" =>
false);
296 for ($i=0;$i<count($a_true);$i++) {
297 $cols[$a_true[$i]][
"default"] =
true;
304 $lng->loadLanguageModule(
"scormtrac");
305 $returnData =
array();
307 $query =
'SELECT user_id, scope_id, 318 AND '.$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' 319 ORDER BY user_id, scope_id';
321 while(
$row = $ilDB->fetchAssoc(
$res))
325 foreach($dbdata as
$data) {
326 $data[
"lm_id"] = $data[
"scope_id"];
327 $data[
"lm_title"] = $this->lmTitle;
328 $data=array_merge($data,self::userDataArrayForExport($data[
"user_id"], $allowExportPrivacy));
329 $data[
"Status"] =
"".$data[
"status"];
330 $data[
"satisfied"] =
"".$data[
"satisfied"];
331 $data[
"measure"] =
"".$data[
"measure"];
332 $data[
"c_raw"] =
"".$data[
"c_raw"];
333 $data[
"c_min"] =
"".$data[
"c_min"];
334 $data[
"c_max"] =
"".$data[
"c_max"];
335 $data[
"completion_status"] =
"".$data[
"completion_status"];
336 $data[
"progress_measure"] =
"".$data[
"progress_measure"];
346 $lng->loadLanguageModule(
"scormtrac");
349 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title' 350 .
',id,description,counter_all' 351 .
',counter_correct,counter_correct_percent' 352 .
',counter_incorrect,counter_incorrect_percent' 353 .
',counter_other,counter_other_percent');
354 $a_true=explode(
',',
"sco_title,description,counter_correct,counter_incorrect");
355 for ($i=0;$i<count($a_cols);$i++) {
356 $cols[$a_cols[$i]] =
array(
"txt" => $lng->txt($a_cols[$i]),
"default" =>
false);
358 for ($i=0;$i<count($a_true);$i++) {
359 $cols[$a_true[$i]][
"default"] =
true;
366 $lng->loadLanguageModule(
"scormtrac");
368 $returnData =
array();
370 $scoTitles = self::scoTitlesForExportSelected($obj_id);
372 $scoProgress = self::markedLearningStatusForExportSelected($scoTitles, $obj_id);
374 $a_correct =
array();
375 $a_incorrect =
array();
376 $query =
'SELECT cmi_node.cp_node_id, cmi_interaction.id, count(*) as counter 377 FROM cmi_interaction, cmi_node 378 WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 379 AND '.$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 380 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 381 AND cmi_interaction.result = %s 382 GROUP BY cmi_node.cp_node_id,cmi_interaction.id';
385 while(
$row = $ilDB->fetchAssoc(
$res))
387 $a_correct[
$row[
'cp_node_id'].
':'.
$row[
'id']] =
$row[
'counter'];
391 while(
$row = $ilDB->fetchAssoc(
$res))
393 $a_incorrect[
$row[
'cp_node_id'].
':'.
$row[
'id']] =
$row[
'counter'];
397 $query =
'SELECT cmi_node.cp_node_id, cmi_interaction.id, cmi_interaction.description, count(*) as counter_all 398 FROM cmi_interaction, cmi_node 399 WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 400 AND '.$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 401 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 402 GROUP BY cmi_node.cp_node_id,cmi_interaction.id,cmi_interaction.description';
404 while(
$row = $ilDB->fetchAssoc(
$res))
408 foreach($dbdata as
$data) {
409 $skey = $data[
"cp_node_id"].
':'.$data[
"id"];
410 $all = $data[
"counter_all"];
412 if($a_correct[$skey] != null) $correct = $a_correct[$skey];
414 if($a_incorrect[$skey] != null) $incorrect = $a_incorrect[$skey];
415 $other = $all-($correct+$incorrect);
416 $data[
"lm_id"] = $obj_id;
417 $data[
"lm_title"] = $this->lmTitle;
418 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
419 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
421 $data[
"description"] =
"".$data[
"description"];
423 $data[
"counter_correct"] = $correct;
424 $data[
"counter_correct_percent"] = $correct*100/$all;
425 $data[
"counter_incorrect"] = $incorrect;
426 $data[
"counter_incorrect_percent"] = $incorrect*100/$all;
427 $data[
"counter_other"] = $other;
428 $data[
"counter_other_percent"] = $other*100/$all;
436 $lng->loadLanguageModule(
"scormtrac");
439 $udh=self::userDataHeaderForExport();
441 'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,'.$udh[
"cols"]
442 .
',counter_i_correct,counter_i_correct_percent' 443 .
',counter_i_incorrect,counter_i_incorrect_percent' 444 .
',counter_i_other,counter_i_other_percent' 445 .
',audio_captioning,audio_level,completion_status,completion_threshold,credit,delivery_speed' 446 .
',c_entry,c_exit,c_language,c_location,c_mode,progress_measure,c_max,c_min,c_raw,scaled' 447 .
',scaled_passing_score,session_time,session_time_seconds,success_status,total_time,total_time_seconds,c_timestamp,suspend_data,launch_data');
448 $a_true=explode(
',',$udh[
"default"].
',sco_title' 449 .
',counter_i_correct,counter_i_correct_percent' 450 .
',counter_i_incorrect,counter_i_incorrect_percent' 451 .
',counter_i_other,counter_i_other_percent' 453 for ($i=0;$i<count($a_cols);$i++) {
454 $cols[$a_cols[$i]] =
array(
"txt" => $lng->txt($a_cols[$i]),
"default" =>
false);
456 for ($i=0;$i<count($a_true);$i++) {
457 $cols[$a_true[$i]][
"default"] =
true;
464 $lng->loadLanguageModule(
"scormtrac");
466 $returnData =
array();
468 $scoTitles = self::scoTitlesForExportSelected($obj_id);
470 $scoProgress = self::markedLearningStatusForExportSelected($scoTitles, $obj_id);
472 $a_correct =
array();
473 $a_incorrect =
array();
475 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, count(*) as counter 476 FROM cmi_interaction, cmi_node 477 WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 478 AND '.$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 479 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 480 AND cmi_interaction.result = %s 481 GROUP BY cmi_node.user_id,cmi_node.cp_node_id';
484 while(
$row = $ilDB->fetchAssoc(
$res))
486 $a_correct[
$row[
'user_id'].
':'.
$row[
'cp_node_id']] =
$row[
'counter'];
490 while(
$row = $ilDB->fetchAssoc(
$res))
492 $a_incorrect[
$row[
'user_id'].
':'.
$row[
'cp_node_id']] =
$row[
'counter'];
495 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, count(*) as counter 496 FROM cmi_interaction, cmi_node 497 WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 498 AND '.$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 499 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 500 AND cmi_interaction.result <> %s AND cmi_interaction.result <> %s 501 GROUP BY cmi_node.user_id,cmi_node.cp_node_id';
503 while(
$row = $ilDB->fetchAssoc(
$res))
505 $a_other[
$row[
'user_id'].
':'.
$row[
'cp_node_id']] =
$row[
'counter'];
509 $query =
'SELECT user_id, cp_node_id, ' 510 .
'audio_captioning, audio_level, completion_status, completion_threshold, credit, delivery_speed, ' 511 .
'c_entry, c_exit, c_language, location as c_location, c_mode, progress_measure, c_max, c_min, c_raw, scaled, ' 512 .
'scaled_passing_score, session_time, success_status, total_time, c_timestamp, suspend_data, launch_data ' 514 .
'WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' ' 515 .
'AND '.$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 517 if ($b_orderBySCO)
$query.=
'cp_node_id, user_id';
518 else $query.=
'user_id, cp_node_id';
520 while(
$row = $ilDB->fetchAssoc(
$res))
524 foreach($dbdata as
$data) {
525 $skey = $data[
"user_id"].
':'.$data[
"cp_node_id"];
527 if($a_correct[$skey] != null) $correct = $a_correct[$skey];
529 if($a_incorrect[$skey] != null) $incorrect = $a_incorrect[$skey];
531 if($a_other[$skey] != null) $other = $a_other[$skey];
532 $all = $correct+$incorrect+$other;
533 $data[
"lm_id"] = $obj_id;
534 $data[
"lm_title"] = $this->lmTitle;
535 $data=array_merge($data,self::userDataArrayForExport($data[
"user_id"], $allowExportPrivacy));
536 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
537 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
538 $data[
"counter_i_correct"] = $correct;
539 if ($all > 0) $data[
"counter_i_correct_percent"] = $correct*100/$all;
540 else $data[
"counter_i_correct_percent"] = 0;
541 $data[
"counter_i_incorrect"] = $incorrect;
542 if ($all > 0) $data[
"counter_i_incorrect_percent"] = $incorrect*100/$all;
543 else $data[
"counter_i_incorrect_percent"] = 0;
544 $data[
"counter_i_other"] = $other;
545 if ($all > 0) $data[
"counter_i_other_percent"] = $other*100/$all;
546 else $data[
"counter_i_other_percent"] = 0;
547 $data[
"audio_captioning"] =
"".$data[
"audio_captioning"];
548 $data[
"audio_level"] =
"".$data[
"audio_level"];
549 $data[
"completion_status"] =
"".$data[
"completion_status"];
550 $data[
"completion_threshold"] =
"".$data[
"completion_threshold"];
551 $data[
"credit"] =
"".$data[
"credit"];
552 $data[
"delivery_speed"] =
"".$data[
"delivery_speed"];
553 $data[
"c_entry"] =
"".$data[
"c_entry"];
554 $data[
"c_exit"] =
"".$data[
"c_exit"];
555 $data[
"c_language"] =
"".$data[
"c_language"];
556 $data[
"c_location"] =
"".str_replace(
'"',
'',$data[
"c_location"]);
557 $data[
"c_mode"] =
"".$data[
"c_mode"];
558 $data[
"progress_measure"] =
"".$data[
"progress_measure"];
559 $data[
"c_max"] =
"".$data[
"c_max"];
560 $data[
"c_min"] =
"".$data[
"c_min"];
561 $data[
"c_raw"] =
"".$data[
"c_raw"];
562 $data[
"scaled"] =
"".$data[
"scaled"];
563 $data[
"scaled_passing_score"] =
"".$data[
"scaled_passing_score"];
564 $data[
"session_time"] =
"".$data[
"session_time"];
565 $data[
"session_time_seconds"] =
"";
567 $data[
"success_status"] =
"".$data[
"success_status"];
568 $data[
"total_time"] =
"".$data[
"total_time"];
569 $data[
"total_time_seconds"] =
"";
571 $data[
"c_timestamp"] = $data[
"c_timestamp"];
572 $data[
"suspend_data"] =
"".$data[
"suspend_data"];
573 $data[
"launch_data"] =
"".$data[
"launch_data"];
591 $lng->loadLanguageModule(
"scormtrac");
594 $a_interaction=
array();
595 $a_interactionDescription=
array();
597 $query =
'SELECT cmi_node.cp_node_id, 598 cmi_interaction.cmi_interaction_id, 600 cmi_interaction.description 601 FROM cmi_interaction, cmi_node 602 WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 603 AND '.$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 604 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 606 if ($b_orderBySCO)
$query.=
'cmi_node.cp_node_id, cmi_node.user_id';
607 else $query.=
'cmi_node.user_id, cmi_node.cp_node_id';
608 $query.=
', cmi_interaction.cmi_interaction_id, cmi_interaction.id';
611 while(
$row = $ilDB->fetchAssoc(
$res))
615 foreach($dbdata as
$data) {
616 $key = $data[
"cp_node_id"].
':'.$data[
"id"];
618 for ($i=0;$i<count($a_interaction);$i++) {
619 if ($a_interaction[$i] == $key) $exist=
true;
621 if ($exist==
false) $a_interaction[] = $key;
622 if ($a_interactionDescription[$key]==null) $a_interactionDescription[$key] =
"".$data[
"description"];
624 $udh=self::userDataHeaderForExport();
625 $a_cols=explode(
',',
'lm_id,lm_title,cp_node_id,sco_marked_for_learning_progress,sco_title,'.$udh[
"cols"]);
626 $a_true=explode(
',',$udh[
"default"].
",sco_title");
627 for ($i=0;$i<count($a_cols);$i++) {
628 $cols[$a_cols[$i]] =
array(
"txt" => $lng->txt($a_cols[$i]),
"default" =>
false);
630 for ($i=0;$i<count($a_true);$i++) {
631 $cols[$a_true[$i]][
"default"] =
true;
633 for ($i=0;$i<count($a_interaction);$i++) {
639 $cols[
"interaction_value".$i.
" ".$a_interactionDescription[$a_interaction[$i]]] =
array(
"txt" => sprintf($lng->txt(
"interaction_value"),$i).
" ".$a_interactionDescription[$a_interaction[$i]],
"default" =>
true);
646 $lng->loadLanguageModule(
"scormtrac");
648 $returnData =
array();
650 $scoTitles = self::scoTitlesForExportSelected($obj_id);
652 $scoProgress = self::markedLearningStatusForExportSelected($scoTitles, $obj_id);
654 $a_interaction=
array();
655 $a_interactionId=
array();
656 $a_interactionDescription=
array();
657 $a_interactionUser=
array();
659 $query =
'SELECT cmi_node.user_id, cmi_node.cp_node_id, 660 cmi_interaction.cmi_interaction_id, 662 cmi_interaction.result, 663 cmi_interaction.description 664 FROM cmi_interaction, cmi_node 665 WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' 666 AND '.$ilDB->in(
'cmi_node.user_id', $a_user,
false,
'integer') .
' 667 AND cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 669 if ($b_orderBySCO)
$query.=
'cmi_node.cp_node_id, cmi_node.user_id';
670 else $query.=
'cmi_node.user_id, cmi_node.cp_node_id';
671 $query.=
', cmi_interaction.cmi_interaction_id, cmi_interaction.id';
673 while(
$row = $ilDB->fetchAssoc(
$res))
677 foreach($dbdata as
$data) {
678 $key = $data[
"cp_node_id"].
':'.$data[
"id"];
680 for ($i=0;$i<count($a_interaction);$i++) {
681 if ($a_interaction[$i] == $key) $exist=
true;
687 $a_interaction[] = $key;
688 $a_interactionId[$key] =
"".$data[
"id"];
689 $a_interactionDescription[$key] =
"".$data[
"description"];
691 $key .=
':'.$data[
"user_id"];
692 $a_interactionUser[$key] =
"".$data[
"result"];
697 $query =
'SELECT user_id, cp_node_id ' 699 .
'WHERE '.$ilDB->in(
'cp_node_id', $a_sco,
false,
'integer') .
' ' 700 .
'AND '.$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 703 if ($b_orderBySCO)
$query.=
'cp_node_id, user_id';
704 else $query.=
'user_id, cp_node_id';
706 while(
$row = $ilDB->fetchAssoc(
$res))
710 foreach($dbdata as $data) {
711 for ($i=0;$i<count($a_interaction);$i++) {
717 $intdesc =
"interaction_value".$i.
" ".$a_interactionDescription[$a_interaction[$i]];
718 $data[$intdesc] =
"";
719 $ukey=$a_interaction[$i].
':'.$data[
"user_id"];
720 if ($a_interactionUser[$ukey] != null) $data[$intdesc] = $a_interactionUser[$ukey];
722 $data[
"lm_id"] = $obj_id;
723 $data[
"lm_title"] = $this->lmTitle;
724 $data=array_merge($data,self::userDataArrayForExport($data[
"user_id"], $allowExportPrivacy));
725 $data[
"sco_marked_for_learning_progress"] = $scoProgress[$data[
"cp_node_id"]];
726 $data[
"sco_title"] = $scoTitles[$data[
"cp_node_id"]];
738 $query =
'SELECT count(distinct(cp_node.cp_node_id)) counter ' 739 .
'FROM cp_node, cp_resource, cp_item ' 740 .
'WHERE cp_item.cp_node_id = cp_node.cp_node_id ' 741 .
'AND cp_item.resourceid = cp_resource.id AND scormtype = %s ' 742 .
'AND nodename = %s AND cp_node.slm_id = %s';
743 $res = $ilDB->queryF(
745 array(
'text',
'text',
'integer'),
746 array(
'sco',
'item', $obj_id)
748 while(
$row = $ilDB->fetchAssoc(
$res))
750 $scoCounter =
$row[
'counter'];
753 $u_startedSCO =
array();
754 $u_completedSCO =
array();
755 $u_passedSCO =
array();
756 for($i=0; $i<count($a_user); $i++) {
757 $u_startedSCO[$a_user[$i]] = 0;
758 $u_completedSCO[$a_user[$i]] = 0;
759 $u_passedSCO[$a_user[$i]] = 0;
762 $query =
'SELECT user_id, count(*) counter ' 763 .
'FROM cmi_node, cp_node ' 764 .
'WHERE cmi_node.cp_node_id = cp_node.cp_node_id ' 765 .
'AND cp_node.slm_id = %s ' 766 .
'AND '.$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 767 .
'GROUP BY user_id';
768 $res = $ilDB->queryF(
773 while (
$data = $ilDB->fetchAssoc(
$res)) {
774 $u_startedSCO[
$data[
'user_id']] = $data[
'counter'];
777 $query =
'SELECT user_id, count(*) counter ' 778 .
'FROM cmi_node, cp_node ' 779 .
'WHERE cmi_node.cp_node_id = cp_node.cp_node_id ' 780 .
'AND cp_node.slm_id = %s ' 781 .
"AND cmi_node.completion_status = 'completed' " 782 .
'AND '.$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 783 .
'GROUP BY user_id';
784 $res = $ilDB->queryF(
789 while (
$data = $ilDB->fetchAssoc(
$res)) {
790 $u_completedSCO[
$data[
'user_id']] = $data[
'counter'];
793 $query =
'SELECT user_id, count(*) counter ' 794 .
'FROM cmi_node, cp_node ' 795 .
'WHERE cmi_node.cp_node_id = cp_node.cp_node_id ' 796 .
'AND cp_node.slm_id = %s ' 797 .
"AND cmi_node.success_status = 'passed' " 798 .
'AND '.$ilDB->in(
'user_id', $a_user,
false,
'integer') .
' ' 799 .
'GROUP BY user_id';
800 $res = $ilDB->queryF(
805 while (
$data = $ilDB->fetchAssoc(
$res)) {
806 $u_passedSCO[
$data[
'user_id']] = $data[
'counter'];
811 $query =
'SELECT * FROM sahs_user WHERE obj_id = '.$ilDB->quote($obj_id,
'integer')
812 .
' AND '.$ilDB->in(
'user_id', $a_user,
false,
'integer')
813 .
' ORDER BY user_id';
815 while(
$row = $ilDB->fetchAssoc(
$res))
820 return self::exportSelectedSuccessRows($a_user, $allowExportPrivacy, $dbdata, $scoCounter, $u_startedSCO, $u_completedSCO, $u_passedSCO, $obj_id);
Class ilSCORM2004TrackingItems.
static tracInteractionUserColumns($b_orderBySCO, $b_allowExportPrivacy)
static exportSelectedObjectivesColumns()
tracInteractionItem($a_user=array(), $a_sco=array(), $b_orderBySCO=false, $allowExportPrivacy=false, $obj_id)
tracInteractionUser($a_user=array(), $a_sco=array(), $b_orderBySCO=false, $allowExportPrivacy=false, $obj_id)
scoTitlesForExportSelected($obj_id)
static exportSelectedCoreColumns($b_orderBySCO, $b_allowExportPrivacy)
exportSelectedCore($a_user=array(), $a_sco=array(), $b_orderBySCO=false, $allowExportPrivacy=false, $obj_id)
tracInteractionUserAnswers($a_user=array(), $a_sco=array(), $b_orderBySCO=false, $allowExportPrivacy=false, $obj_id)
exportObjGlobalToSystem($a_user=array(), $allowExportPrivacy=false, $obj_id)
Create styles array
The data for the language used.
exportSelectedInteractions($a_user=array(), $a_sco=array(), $b_orderBySCO=false, $allowExportPrivacy=false, $obj_id)
static tracInteractionUserAnswersColumns($a_user=array(), $a_sco=array(), $b_orderBySCO, $b_allowExportPrivacy)
static tracInteractionItemColumns($b_orderBySCO, $b_allowExportPrivacy)
static _ISODurationToCentisec($str)
convert ISO 8601 Timeperiods to centiseconds ta
exportSelectedObjectives($a_user=array(), $a_sco=array(), $b_orderBySCO=false, $allowExportPrivacy=false, $obj_id)
Class ilSCORMTrackingItems.
static exportSelectedInteractionsColumns()
exportSelectedSuccess($a_user=array(), $allowExportPrivacy=false, $obj_id)
static exportObjGlobalToSystemColumns()