Browse Source

Add user profile image to teacher marking page.

MOODLE_35_STABLE
Dan Marsden 6 years ago
parent
commit
310522bb93
  1. 7
      classes/output/mobile.php
  2. 2
      db/mobile.php
  3. 4
      mobilestyles.css
  4. 26
      templates/mobile_teacher_form.mustache

7
classes/output/mobile.php

@ -353,7 +353,7 @@ class mobile {
* @return array HTML, javascript and other data * @return array HTML, javascript and other data
*/ */
public static function mobile_teacher_form($args) { public static function mobile_teacher_form($args) {
global $OUTPUT, $DB, $CFG; global $OUTPUT, $DB, $CFG, $PAGE;
require_once($CFG->dirroot.'/mod/attendance/locallib.php'); require_once($CFG->dirroot.'/mod/attendance/locallib.php');
@ -405,7 +405,10 @@ class mobile {
$data['users'] = array(); $data['users'] = array();
$users = $att->get_users($att->get_session_info($sessid)->groupid, 0); $users = $att->get_users($att->get_session_info($sessid)->groupid, 0);
foreach ($users as $user) { foreach ($users as $user) {
$data['users'][] = array('userid' => $user->id, 'fullname' => $user->fullname); $userpicture = new \user_picture($user);
$userpicture->size = 1; // Size f1.
$profileimageurl = $userpicture->get_url($PAGE)->out(false);
$data['users'][] = array('userid' => $user->id, 'fullname' => $user->fullname, 'profileimageurl' => $profileimageurl);
// Generate args to use in submission button here. // Generate args to use in submission button here.
$data['btnargs'] .= ', status'. $user->id. ': CONTENT_OTHERDATA.status'. $user->id; $data['btnargs'] .= ', status'. $user->id. ': CONTENT_OTHERDATA.status'. $user->id;
} }

2
db/mobile.php

@ -36,7 +36,7 @@ $addons = [
'method' => 'mobile_view_activity', 'method' => 'mobile_view_activity',
'styles' => [ 'styles' => [
'url' => '/mod/attendance/mobilestyles.css', 'url' => '/mod/attendance/mobilestyles.css',
'version' => 21 'version' => 22
] ]
] ]
], ],

4
mobilestyles.css

@ -24,3 +24,7 @@
.attendance_mobile_view_page .messages .label { .attendance_mobile_view_page .messages .label {
white-space: normal; white-space: normal;
} }
.attendance_mobile_teacher_form .attendance_user_row {
padding-bottom: 5px;
}

26
templates/mobile_teacher_form.mustache

@ -59,22 +59,26 @@
<%/messages%> <%/messages%>
<%/showmessage%> <%/showmessage%>
<%#users%> <%#users%>
<ion-item> <span class="attendance_user_row">
<span class="studentname"> <!-- User and status of the submission. -->
<h2><% fullname %></h2> <span ion-item text-wrap title="<% fullname %>">
</span> <ion-avatar item-start>
</ion-item> <img src="<% profileimageurl %>" core-external-content role="presentation" onError="this.src='assets/img/user-avatar.png'">
</ion-avatar>
<ion-list radio-group [(ngModel)]="CONTENT_OTHERDATA.status<% userid %>"> <h2><% fullname %></h2>
<%#statuses%> <ng-container *ngTemplateOutlet="submissionStatus"></ng-container>
<span class="radiolabel"> </span>
<ion-list radio-group [(ngModel)]="CONTENT_OTHERDATA.status<% userid %>">
<%#statuses%>
<span class="radiolabel">
<ion-item> <ion-item>
<ion-label><% acronym %></ion-label> <ion-label><% acronym %></ion-label>
<ion-radio value="<% stid %>"></ion-radio> <ion-radio value="<% stid %>"></ion-radio>
</ion-item> </ion-item>
</span> </span>
<%/statuses%> <%/statuses%>
</ion-list> </ion-list>
</span>
<%/users%> <%/users%>
<ion-item> <ion-item>
<button ion-button core-site-plugins-new-content component="mod_attendance" method="mobile_view_activity" [args]="{cmid: <% cmid %>, courseid: <% courseid %>, sessid: <% sessid %><% btnargs %>}"> <button ion-button core-site-plugins-new-content component="mod_attendance" method="mobile_view_activity" [args]="{cmid: <% cmid %>, courseid: <% courseid %>, sessid: <% sessid %><% btnargs %>}">

Loading…
Cancel
Save