mod-assignment MDL-19803 Fixed up a couple of minor deprecated calls
authorSam Hemelryk <sam@moodle.com>
Wed, 22 Sep 2010 08:08:24 +0000 (08:08 +0000)
committerSam Hemelryk <sam@moodle.com>
Wed, 22 Sep 2010 08:08:24 +0000 (08:08 +0000)
mod/assignment/lang/en/assignment.php
mod/assignment/type/online/assignment.class.php
mod/assignment/type/upload/assignment.class.php
mod/assignment/type/uploadsingle/assignment.class.php

index 290545b..5865e91 100644 (file)
@@ -92,6 +92,7 @@ Only teachers who are able to grade the particular assignment are notified. So,
 $string['emptysubmission'] = 'You have not submitted anything yet';
 $string['enableemailnotification'] = 'Send notification emails';
 $string['enableemailnotification_help'] = 'If enabled, students will receive email notification when their assignment submissions are graded.';
+$string['errornosubmissions'] = 'There are no submissions to download';
 $string['existingfiledeleted'] = 'Existing file has been deleted: {$a}';
 $string['failedupdatefeedback'] = 'Failed to update submission feedback for user {$a}';
 $string['feedback'] = 'Feedback';
index a4a3e81..3257c11 100644 (file)
@@ -387,7 +387,7 @@ class assignment_online extends assignment_base {
 
         $submissions = $this->get_submissions('','');
         if (empty($submissions)) {
-            error("there are no submissions to download");
+            print_error('errornosubmissions', 'assignment');
         }
         $filesforzipping = array();
 
@@ -396,10 +396,15 @@ class assignment_online extends assignment_base {
         //online assignment can use html
         $filextn=".html";
 
-        $groupmode = groupmode($this->course,$this->cm);
+        if (isset($this->cm->groupmode) && empty($this->course->groupmodeforce)) {
+            $groupmode = $this->cm->groupmode;
+        } else {
+            $groupmode = $this->course->groupmode;
+        }
+        
         $groupid = 0;   // All users
         $groupname = '';
-        if($groupmode) {
+        if ($groupmode) {
             $group = get_current_group($this->course->id, true);
             $groupid = $group->id;
             $groupname = $group->name.'-';
index 2b3c0a1..1e47548 100644 (file)
@@ -1094,15 +1094,20 @@ class assignment_upload extends assignment_base {
         require_once($CFG->libdir.'/filelib.php');
         $submissions = $this->get_submissions('','');
         if (empty($submissions)) {
-            error("there are no submissions to download");
+            print_error('errornosubmissions', 'assignment');
         }
         $filesforzipping = array();
         $fs = get_file_storage();
 
-        $groupmode = groupmode($this->course,$this->cm);
+        if (isset($this->cm->groupmode) && empty($this->course->groupmodeforce)) {
+            $groupmode = $this->cm->groupmode;
+        } else {
+            $groupmode = $this->course->groupmode;
+        }
+        
         $groupid = 0;   // All users
         $groupname = '';
-        if($groupmode) {
+        if ($groupmode) {
             $group = get_current_group($this->course->id, true);
             $groupid = $group->id;
             $groupname = $group->name.'-';
index 3384558..bd75c08 100644 (file)
@@ -359,15 +359,20 @@ class assignment_uploadsingle extends assignment_base {
 
         $submissions = $this->get_submissions('','');
         if (empty($submissions)) {
-            error("there are no submissions to download");
+            print_error('errornosubmissions', 'assignment');
         }
         $filesforzipping = array();
         $fs = get_file_storage();
 
-        $groupmode = groupmode($this->course,$this->cm);
+        if (isset($this->cm->groupmode) && empty($this->course->groupmodeforce)) {
+            $groupmode = $this->cm->groupmode;
+        } else {
+            $groupmode = $this->course->groupmode;
+        }
+        
         $groupid = 0;   // All users
         $groupname = '';
-        if($groupmode) {
+        if ($groupmode) {
             $group = get_current_group($this->course->id, true);
             $groupid = $group->id;
             $groupname = $group->name.'-';