Permalink
Browse files

SCORM reports now actually show user pictures

  • Loading branch information...
1 parent 02eb713 commit 18826234c3b5780fe2a78d67ed96b71c3678b41b moodler committed Nov 26, 2004
Showing with 22 additions and 28 deletions.
  1. +1 −1 mod/scorm/lib.php
  2. +21 −27 mod/scorm/report.php
View
@@ -572,7 +572,7 @@ function scorm_get_scoes_records($sco_user) {
{$CFG->prefix}user u
WHERE su.scormid = '$sco_user->scormid'
AND su.userid = u.id
- AND su.userid = $sco_user->userid
+ AND su.userid = '$sco_user->userid'
ORDER BY scoid");
}
View
@@ -79,33 +79,27 @@
}
}
- foreach ($sco_users as $sco_user) {
- $user_data=scorm_get_scoes_records($sco_user);
- $userpict = "";
- if (isset($user_data->picture)) {
- $userpict = $user_data->picture;
- }
- $picture = print_user_picture($sco_user->userid, $course->id, $userpict, false, true);
- $row="";
- $row[] = $picture;
- if (is_array($user_data)) {
- $data = current($user_data);
- $row[] = "<a href=\"$CFG->wwwroot/user/view.php?id=$data->userid&course=$course->id\">".
- "$data->firstname $data->lastname</a>";
- foreach ($user_data as $data) {
- $scoreview = "";
- if ($data->cmi_core_score_raw > 0)
- $scoreview = "<br />".get_string("score","scorm").":&nbsp;".$data->cmi_core_score_raw;
- if ( $data->cmi_core_lesson_status == "")
- $data->cmi_core_lesson_status = "not attempted";
- $row[]="<img src=\"pix/".scorm_remove_spaces($data->cmi_core_lesson_status).".gif\"
- alt=\"".get_string(scorm_remove_spaces($data->cmi_core_lesson_status),"scorm")."\"
- title=\"".get_string(scorm_remove_spaces($data->cmi_core_lesson_status),"scorm")."\">&nbsp;"
- .$data->cmi_core_total_time.$scoreview;
- }
- }
- $table->data[] = $row;
- }
+ foreach ($sco_users as $sco_user) {
+ $user_data = scorm_get_scoes_records($sco_user);
+
+ $row = array();
+ $data = current($user_data);
+ $row[] = print_user_picture($sco_user->userid, $course->id, $data->picture, false, true);
+ $row[] = "<a href=\"$CFG->wwwroot/user/view.php?id=$data->userid&course=$course->id\">".
+ "$data->firstname $data->lastname</a>";
+ foreach ($user_data as $data) {
+ $scoreview = "";
+ if ($data->cmi_core_score_raw > 0)
+ $scoreview = "<br />".get_string("score","scorm").":&nbsp;".$data->cmi_core_score_raw;
+ if ( $data->cmi_core_lesson_status == "")
+ $data->cmi_core_lesson_status = "not attempted";
+ $row[]="<img src=\"pix/".scorm_remove_spaces($data->cmi_core_lesson_status).".gif\"
+ alt=\"".get_string(scorm_remove_spaces($data->cmi_core_lesson_status),"scorm")."\"
+ title=\"".get_string(scorm_remove_spaces($data->cmi_core_lesson_status),"scorm")."\">&nbsp;"
+ .$data->cmi_core_total_time.$scoreview;
+ }
+ $table->data[] = $row;
+ }
print_table($table);

0 comments on commit 1882623

Please sign in to comment.