mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Groups support for choice module
This commit is contained in:
parent
52f1b49620
commit
b6ee2d82ea
@ -34,9 +34,23 @@
|
||||
<a href=\"index.php?id=$course->id\">$strchoices</a> ->
|
||||
<a href=\"view.php?id=$cm->id\">$choice->name</a> -> $strresponses", "");
|
||||
|
||||
/// Check to see if groups are being used in this choice
|
||||
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 (! $users = get_course_users($course->id, "u.firstname ASC")) {
|
||||
error("No users found (very strange)");
|
||||
if ($currentgroup) {
|
||||
$users = get_users_in_group($currentgroup, "u.firstname ASC");
|
||||
} else {
|
||||
$users = get_course_users($course->id, "u.firstname ASC");
|
||||
}
|
||||
|
||||
if (!$users) {
|
||||
print_heading(get_string("nousersyet"));
|
||||
print_footer($course);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $allanswers = get_records("choice_answers", "choice", $choice->id)) {
|
||||
|
@ -70,6 +70,13 @@
|
||||
"$navigation <A HREF=index.php?id=$course->id>$strchoices</A> -> $choice->name", "", "", true,
|
||||
update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
|
||||
|
||||
/// Check to see if groups are being used in this choice
|
||||
if ($groupmode = groupmode($course, $cm)) { // Groups are being used
|
||||
$currentgroup = setup_and_print_groups($course, $groupmode, "view.php?id=$cm->id");
|
||||
} else {
|
||||
$currentgroup = false;
|
||||
}
|
||||
|
||||
if (isteacher($course->id)) {
|
||||
if ( $allanswers = get_records("choice_answers", "choice", $choice->id)) {
|
||||
$responsecount = count($allanswers);
|
||||
@ -107,8 +114,16 @@
|
||||
|
||||
print_heading(get_string("responses", "choice"));
|
||||
|
||||
if (! $users = get_course_users($course->id, "u.firstname ASC")) {
|
||||
error("No users found (very strange)");
|
||||
if ($currentgroup) {
|
||||
$users = get_users_in_group($currentgroup, "u.firstname ASC");
|
||||
} else {
|
||||
$users = get_course_users($course->id, "u.firstname ASC");
|
||||
}
|
||||
|
||||
if (!$users) {
|
||||
print_heading(get_string("nousersyet"));
|
||||
print_footer($course);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $allanswers = get_records("choice_answers", "choice", $choice->id)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user