/// First get all the users who have access here
/// To start with we assume they are all "unanswered" then move them later
- $allresponses[0] = get_users_by_capability($context, 'mod/choice:choose', 'u.id, u.picture, u.firstname, u.lastname, u.idnumber', 'u.firstname ASC', '', '', $currentgroup, '', false, true);
+ $allresponses[0] = get_users_by_capability($context, 'mod/choice:choose', 'u.id, u.picture, u.firstname, u.lastname, u.idnumber', 'u.lastname ASC,u.firstname ASC', '', '', $currentgroup, '', false, true);
/// Get all the recorded responses for this choice
$rawresponses = $DB->get_records('choice_answers', array('choiceid' => $choice->id));