Permalink
Browse files

Merge branch 'MDL-60938-34-2' of git://github.com/junpataleta/moodle …

…into MOODLE_34_STABLE
  • Loading branch information...
dmonllao committed Dec 19, 2017
2 parents fb8b947 + b9bebd0 commit 88498220a1bcd80e47a540745b3b3b42a4962bdf
Showing with 15 additions and 17 deletions.
  1. +15 −17 mod/choice/renderer.php
@@ -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;
}

0 comments on commit 8849822

Please sign in to comment.