Use the new short way of setting up groups

This commit is contained in:
moodler
2004-02-15 07:18:07 +00:00
parent c3cbfe7fdf
commit 424aef6aef
4 changed files with 17 additions and 106 deletions
+5 -28
View File
@@ -40,35 +40,13 @@
<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;
/// 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;
}
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>';
}
}
/// Get all teachers and students
$teachers = get_course_teachers($course->id);
@@ -163,7 +141,6 @@
// Submission sorting
$sorttypes = array('firstname', 'lastname', 'timemodified', 'grade');
print_simple_box_start("center", "50%");
+4 -26
View File
@@ -45,34 +45,12 @@
/// 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 = groupmode($course, $cm)) { // Groups are being used
$currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id");
} 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&sort=$sort&dir=$dir&group=",
$groups, 'selectgroup', $currentgroup, "", "", "", false, "self");
echo '</tr></table>';
}
}
/// Process incoming data if there is any
if ($data = data_submitted()) {
+4 -26
View File
@@ -68,34 +68,12 @@ class quiz_report extends quiz_default_report {
}
/// 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);
+4 -26
View File
@@ -12,34 +12,12 @@ class quiz_report extends quiz_default_report {
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 = 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 ($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 ($currentgroup) {
$users = get_users_in_group($currentgroup, "u.lastname ASC");
} else {