Skip to content
Browse files

SCORM MDL-26545 - fix user object passed to user_picture renderer

  • Loading branch information...
1 parent 2b37004 commit 629f5021b388adf788727a51bab2bd449ea3f1b6 @danmarsden danmarsden committed Feb 28, 2011
Showing with 3 additions and 5 deletions.
  1. +1 −1 mod/scorm/locallib.php
  2. +2 −4 mod/scorm/report.php
View
2 mod/scorm/locallib.php
@@ -514,7 +514,7 @@ function scorm_get_user_data($userid) {
/// Gets user info required to display the table of scorm results
/// for report.php
- return $DB->get_record('user', array('id'=>$userid),'firstname, lastname, picture');
+ return $DB->get_record('user', array('id'=>$userid), user_picture::fields());
}
function scorm_grade_user_attempt($scorm, $userid, $attempt=1) {
View
6 mod/scorm/report.php
@@ -602,8 +602,7 @@
if (!empty($userdata)) {
echo $OUTPUT->box_start('generalbox boxaligncenter');
echo '<div class="mdl-align">'."\n";
- $userrec = (object)array('id'=>$user);
- echo $OUTPUT->user_picture($userrec, array('courseid'=>$course->id));
+ echo $OUTPUT->user_picture($userdata, array('courseid'=>$course->id));
echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user&amp;course=$course->id\">".
"$userdata->firstname $userdata->lastname</a><br />";
echo get_string('attempt','scorm').': '.$attempt;
@@ -665,8 +664,7 @@
//print_heading(format_string($sco->title));
echo $OUTPUT->heading('<a href="'.$CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&amp;mode=browse&amp;scoid='.$sco->id.'" target="_new">'.format_string($sco->title).'</a>');
echo '<div class="mdl-align">'."\n";
- $userrec = (object)array('id'=>$user);
- echo $OUTPUT->user_picture($userrec, array('courseid'=>$course->id));
+ echo $OUTPUT->user_picture($userdata, array('courseid'=>$course->id));
echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user&amp;course=$course->id\">".
"$userdata->firstname $userdata->lastname</a><br />";
$scoreview = '';

0 comments on commit 629f502

Please sign in to comment.
Something went wrong with that request. Please try again.