Browse Source

add field to export that lists groups that a user is a member of.

MOODLE_26_STABLE
Dan Marsden 11 years ago
parent
commit
b5bde93866
  1. 12
      export.php

12
export.php

@ -90,6 +90,9 @@ if ($mform->is_submitted()) {
} }
$data->tabhead[] = get_string('lastname'); $data->tabhead[] = get_string('lastname');
$data->tabhead[] = get_string('firstname'); $data->tabhead[] = get_string('firstname');
if (!empty($cm->groupmode)) {
$data->tabhead[] = get_string('groups');
}
if (count($reportdata->sessions) > 0) { if (count($reportdata->sessions) > 0) {
@ -120,6 +123,15 @@ if ($mform->is_submitted()) {
} }
$data->table[$i][] = $user->lastname; $data->table[$i][] = $user->lastname;
$data->table[$i][] = $user->firstname; $data->table[$i][] = $user->firstname;
if (!empty($cm->groupmode)) {
$grouptext = '';
$groupsraw = groups_get_all_groups($course->id, $user->id, 0, 'g.name');
$groups = array();
foreach ($groupsraw as $group) {
$groups[] = $group->name;;
}
$data->table[$i][] = implode(', ', $groups);
}
$cellsgenerator = new user_sessions_cells_text_generator($reportdata, $user); $cellsgenerator = new user_sessions_cells_text_generator($reportdata, $user);
$data->table[$i] = array_merge($data->table[$i], $cellsgenerator->get_cells(isset($formdata->includeremarks))); $data->table[$i] = array_merge($data->table[$i], $cellsgenerator->get_cells(isset($formdata->includeremarks)));
if ($reportdata->gradable) { if ($reportdata->gradable) {

Loading…
Cancel
Save