Skip to content

Commit

Permalink
Merge branch 'MDL-60938-master-2' of git://github.com/junpataleta/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Dec 19, 2017
2 parents d41203c + af6c390 commit df06051
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions mod/choice/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,32 +222,30 @@ public function display_publish_name_vertical($choices) {
$optionusers = '';
foreach ($options->user as $user) {
$data = '';
if (empty($user->imagealt)){
if (empty($user->imagealt)) {
$user->imagealt = '';
}

$userfullname = fullname($user, $choices->fullnamecapability);
$mediabody = '';
$checkbox = '';
if ($choices->viewresponsecapability && $choices->deleterepsonsecapability) {
$checkboxid = 'attempt-user'.$user->id.'-option'.$optionid;
$attemptaction = html_writer::label($userfullname . ' ' . $optionsnames[$optionid],
$checkboxid, false, array('class' => 'accesshide'));
$checkboxid = 'attempt-user' . $user->id . '-option' . $optionid;
$checkbox .= html_writer::label($userfullname . ' ' . $optionsnames[$optionid],
$checkboxid, false, array('class' => 'accesshide'));
if ($optionid > 0) {
$attemptaction .= html_writer::checkbox('attemptid[]', $user->answerid, '', null,
array('id' => $checkboxid));
$checkboxname = 'attemptid[]';
$checkboxvalue = $user->answerid;
} else {
$attemptaction .= html_writer::checkbox('userid[]', $user->id, '', null,
array('id' => $checkboxid));
$checkboxname = 'userid[]';
$checkboxvalue = $user->id;
}
$mediabody .= html_writer::tag('div', $attemptaction, array('class'=>'media-left media-middle p-t-1'));
$checkbox .= html_writer::checkbox($checkboxname, $checkboxvalue, '', null,
array('id' => $checkboxid, 'class' => 'm-r-1'));
}
$userimage = $this->output->user_picture($user, array('courseid' => $choices->courseid));
$mediabody .= html_writer::tag('div', $userimage, array('class' => 'media-left media-middle'));

$userlink = new moodle_url('/user/view.php', array('id'=>$user->id,'course' => $choices->courseid));
$name = html_writer::tag('a', $userfullname, array('href' => $userlink));
$mediabody .= html_writer::tag('div', $name, array('class' => 'media-body media-middle'));
$data .= html_writer::tag('div', $mediabody, array('class' => 'media m-b-1'));
$userimage = $this->output->user_picture($user, array('courseid' => $choices->courseid, 'link' => false));
$profileurl = new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $choices->courseid));
$profilelink = html_writer::link($profileurl, $userimage . $userfullname);
$data .= html_writer::div($checkbox . $profilelink, 'm-b-1');

$optionusers .= $data;
}
Expand Down

0 comments on commit df06051

Please sign in to comment.