<a href=\"view.php?a=$assignment->id\">$assignment->name</a> -> $strsubmissions",
"", "", true);
-/// Check to see if groups are being used in this forum
-/// and if so, set $currentgroup to reflect the current group
-
- $groupmode = groupmode($course, $cm); // Groups are being used
- $currentgroup = get_and_set_current_group($course, $groupmode, $_GET['group']);
-
- if (!isteacheredit($course->id) and $groupmode and !$currentgroup) {
- print_heading("Sorry, but you can't see this group");
- print_footer();
- exit;
- }
-
- if ($groupmode == VISIBLEGROUPS or ($groupmode and isteacheredit($course->id))) {
- if ($groups = get_records_menu("groups", "courseid", $course->id, "name ASC", "id,name")) {
- echo '<table align="center"><tr><td>';
- if ($groupmode == VISIBLEGROUPS) {
- print_string('groupsvisible');
- } else {
- print_string('groupsseparate');
- }
- echo ':';
- echo '</td><td nowrap="nowrap" align="left" width="50%">';
- popup_form("submissions.php?id=$assignment->id&sort=$sort&dir=$dir&group=",
- $groups, 'selectgroup', $currentgroup, "", "", "", false, "self");
- echo '</tr></table>';
- }
+/// Check to see if groups are being used in this assignment
+ if ($groupmode = groupmode($course, $cm)) { // Groups are being used
+ $currentgroup = setup_and_print_groups($course, $groupmode, "submissions.php?id=$assignment->id&sort=$sort&dir=$dir");
+ } else {
+ $currentgroup = false;
}
-
/// Get all teachers and students
$teachers = get_course_teachers($course->id);
// Submission sorting
-
$sorttypes = array('firstname', 'lastname', 'timemodified', 'grade');
print_simple_box_start("center", "50%");
/// Check to see if groups are being used in this journal
-/// and if so, set $currentgroup to reflect the current group
-
- $groupmode = groupmode($course, $cm); // Groups are being used
- $currentgroup = get_and_set_current_group($course, $groupmode, $_GET['group']);
-
- if (!isteacheredit($course->id) and $groupmode and !$currentgroup) {
- print_heading("Sorry, but you can't see this group");
- print_footer();
- exit;
- }
-
- if ($groupmode == VISIBLEGROUPS or ($groupmode and isteacheredit($course->id))) {
- if ($groups = get_records_menu("groups", "courseid", $course->id, "name ASC", "id,name")) {
- echo '<table align="center"><tr><td>';
- if ($groupmode == VISIBLEGROUPS) {
- print_string('groupsvisible');
- } else {
- print_string('groupsseparate');
- }
- echo ':';
- echo '</td><td nowrap="nowrap" align="left" width="50%">';
- popup_form("report.php?id=$cm->id&sort=$sort&dir=$dir&group=",
- $groups, 'selectgroup', $currentgroup, "", "", "", false, "self");
- echo '</tr></table>';
- }
+ if ($groupmode = groupmode($course, $cm)) { // Groups are being used
+ $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id");
+ } else {
+ $currentgroup = false;
}
-
/// Process incoming data if there is any
if ($data = data_submitted()) {
}
/// Check to see if groups are being used in this quiz
- /// and if so, set $currentgroup to reflect the current group
-
- $groupmode = groupmode($course, $cm); // Groups are being used
- $currentgroup = get_and_set_current_group($course, $groupmode, $_GET['group']);
-
- if ($groupmode and !$currentgroup and !isteacheredit($course->id)) {
- print_heading("Sorry, but you can't see this group");
- print_footer();
- exit;
+ if ($groupmode = groupmode($course, $cm)) { // Groups are being used
+ $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id&mode=overview");
+ } else {
+ $currentgroup = false;
}
- if ($groupmode == VISIBLEGROUPS or ($groupmode and isteacheredit($course->id))) {
- if ($groups = get_records_menu("groups", "courseid", $course->id, "name ASC", "id,name")) {
- echo '<table align="center"><tr><td>';
- if ($groupmode == VISIBLEGROUPS) {
- print_string('groupsvisible');
- } else {
- print_string('groupsseparate');
- }
- echo ':';
- echo '</td><td nowrap="nowrap" align="left" width="50%">';
- popup_form("report.php?id=$cm->id&mode=overview&group=",
- $groups, 'selectgroup', $currentgroup, "", "", "", false, "self");
- echo '</tr></table>';
- }
- }
-
-
/// Get all teachers and students
if ($currentgroup) {
$users = get_users_in_group($currentgroup);
optional_variable($download, "");
/// Check to see if groups are being used in this quiz
- /// and if so, set $currentgroup to reflect the current group
-
- $groupmode = groupmode($course, $cm); // Groups are being used
- $currentgroup = get_and_set_current_group($course, $groupmode, $_GET['group']);
-
- if ($groupmode and !$currentgroup and !isteacheredit($course->id)) {
- print_heading("Sorry, but you can't see this group");
- print_footer();
- exit;
- }
-
- if ($groupmode == VISIBLEGROUPS or ($groupmode and isteacheredit($course->id))) {
- if ($groups = get_records_menu("groups", "courseid", $course->id, "name ASC", "id,name")) {
- echo '<table align="center"><tr><td>';
- if ($groupmode == VISIBLEGROUPS) {
- print_string('groupsvisible');
- } else {
- print_string('groupsseparate');
- }
- echo ':';
- echo '</td><td nowrap="nowrap" align="left" width="50%">';
- popup_form("report.php?id=$cm->id&mode=simplestat&group=",
- $groups, 'selectgroup', $currentgroup, "", "", "", false, "self");
- echo '</tr></table>';
- }
+ if ($groupmode = groupmode($course, $cm)) { // Groups are being used
+ $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id&mode=simplestat");
+ } else {
+ $currentgroup = false;
}
-
if ($currentgroup) {
$users = get_users_in_group($currentgroup, "u.lastname ASC");
} else {