Assignment MDL-7206 - download all submissions as a zip - finally pushing this into...
[moodle.git] / mod / assignment / submissions.php
index c202574..ee0168e 100644 (file)
@@ -6,6 +6,7 @@ require_once("lib.php");
 $id   = optional_param('id', 0, PARAM_INT);          // Course module ID
 $a    = optional_param('a', 0, PARAM_INT);           // Assignment ID
 $mode = optional_param('mode', 'all', PARAM_ALPHA);  // What mode are we in?
+$download = optional_param('download' , 'none', PARAM_ALPHA); //ZIP download asked for?
 
 $url = new moodle_url('/mod/assignment/submissions.php');
 if ($id) {
@@ -49,4 +50,8 @@ require($CFG->dirroot.'/mod/assignment/type/'.$assignment->assignmenttype.'/assi
 $assignmentclass = 'assignment_'.$assignment->assignmenttype;
 $assignmentinstance = new $assignmentclass($cm->id, $assignment, $cm, $course);
 
-$assignmentinstance->submissions($mode);   // Display or process the submissions
\ No newline at end of file
+if($download == "zip") {
+    $assignmentinstance->download_submissions();
+} else {
+    $assignmentinstance->submissions($mode);   // Display or process the submissions
+}
\ No newline at end of file