]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10888: groupings - mod/quiz - add groupings support
authormattc-catalyst <mattc-catalyst>
Mon, 27 Aug 2007 03:56:39 +0000 (03:56 +0000)
committermattc-catalyst <mattc-catalyst>
Mon, 27 Aug 2007 03:56:39 +0000 (03:56 +0000)
mod/quiz/locallib.php
mod/quiz/mod_form.php
mod/quiz/report/analysis/report.php
mod/quiz/report/overview/report.php

index 69eabbae7747f2331fd3ca89685ee8e5d3894998..3c22841c0ea6d002de7741aa986f79ddd65233cd 100644 (file)
@@ -881,7 +881,7 @@ function quiz_send_notification_emails($course, $quiz, $attempt, $context, $cm)
     // check for notifications required
     $notifyfields = 'u.id, u.username, u.firstname, u.lastname, u.email, u.emailstop, u.lang, u.timezone, u.mailformat, u.maildisplay';
     $userstonotify = get_users_by_capability($context, 'mod/quiz:emailnotifysubmission',
-            $notifyfields, '', '', '', groups_get_all_groups($course->id, $USER->id),
+            $notifyfields, '', '', '', array_keys(groups_get_all_groups($course->id, $USER->id)),
             $notifyexcludeusers, false, false, true);
 
     // if something to send, then build $a
index 7e00a757ff83b72debfc9777f8e5c93c4e509b3e..f42170c2acbcc745f9858c84125cc68a99ea61a5 100644 (file)
@@ -211,7 +211,11 @@ class mod_quiz_mod_form extends moodleform_mod {
         $mform->setDefault('subnet', $CFG->quiz_subnet);
 
 //-------------------------------------------------------------------------------
-        $this->standard_coursemodule_elements();
+        $features = new stdClass;
+        $features->groups = true;
+        $features->groupings = true;
+        $features->groupmembersonly = true;
+        $this->standard_coursemodule_elements($features);
 //-------------------------------------------------------------------------------
         $mform->addElement('header', 'overallfeedbackhdr', get_string('overallfeedback', 'quiz'));
         $mform->setHelpButton('overallfeedbackhdr', array('overallfeedback', get_string('overallfeedback', 'quiz'), 'quiz'));
index 6c74d9e8efe847b5ac2846e07f9c40f2c76b61d3..0011c27a318772bf3ccccc203e9cb089c0f5fccf 100644 (file)
@@ -22,14 +22,12 @@ class quiz_report extends quiz_default_report {
         }
 
     /// Check to see if groups are being used in this quiz
-        if ($groupmode = groupmode($course, $cm)) {   // Groups are being used
+        $currentgroup = groups_get_activity_group($cm, true);
+        
+        if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used
             if (!$download) {
-                $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id&amp;mode=analysis");
-            } else {
-                $currentgroup = get_and_set_current_group($course, $groupmode);
+                groups_print_activity_menu($cm, "report.php?id=$cm->id&amp;mode=analysis");
             }
-        } else {
-            $currentgroup = get_and_set_current_group($course, $groupmode);
         }
 
         // set Table and Analysis stats options
index 039bc20ac558fec1e4ca3a554081bda50b567c3e..e8181e418068d8f8171961de05f821700573e0b2 100644 (file)
@@ -67,14 +67,12 @@ class quiz_report extends quiz_default_report {
         }
 
         /// find out current groups mode
-        if ($groupmode = groupmode($course, $cm)) { // Groups are being used
+        $currentgroup = groups_get_activity_group($cm, true);
+        
+        if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used
             if (!$download) {
-                $currentgroup = setup_and_print_groups($course, $groupmode, $reporturlwithoptions);
-            } else {
-                $currentgroup = get_and_set_current_group($course, $groupmode);
+                groups_print_activity_menu($cm, $reporturlwithoptions);
             }
-        } else {
-            $currentgroup = get_and_set_current_group($course, $groupmode);
         }
 
         $hasfeedback = quiz_has_feedback($quiz->id) && $quiz->grade > 1.e-7 && $quiz->sumgrades > 1.e-7;