commit ab9d0e2be559e90c41905eca506abe69e56cbf3c
Author: Tim Lock <tim.lock@netspot.com.au>
Date:   Mon Oct 17 11:12:08 2011 +1030

    MQ-177: Apply MDL-19869: Separate Group shows : No users were found with permissions to submit this assignment even there are members in the group
    
    MQ-177: Apply MDL-19869: Separate Group shows : No users were found with permissions to submit this assignment even there are members in the group - fix to handle when QuickGrade is enabled.

diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php
index 8b2e412..b5e25f0 100644
--- a/mod/assignment/lib.php
+++ b/mod/assignment/lib.php
@@ -1273,8 +1273,39 @@ class assignment_base {
         $table->setup();
 
         if (empty($users)) {
+            /// End quickgrade form since no users
+            if ($quickgrade){
+                echo html_writer::end_tag('form');
+            }
+
             echo $OUTPUT->heading(get_string('nosubmitusers','assignment'));
             echo '</div>';
+
+            /// Mini form for setting user preference
+
+            $formaction = new moodle_url('/mod/assignment/submissions.php', array('id'=>$this->cm->id));
+            $mform = new MoodleQuickForm('optionspref', 'post', $formaction, '', array('class'=>'optionspref'));
+
+            $mform->addElement('hidden', 'updatepref');
+            $mform->setDefault('updatepref', 1);
+            $mform->addElement('header', 'qgprefs', get_string('optionalsettings', 'assignment'));
+            $mform->addElement('select', 'filter', get_string('show'),  $filters);
+
+            $mform->setDefault('filter', $filter);
+
+            $mform->addElement('text', 'perpage', get_string('pagesize', 'assignment'), array('size'=>1));
+            $mform->setDefault('perpage', $perpage);
+
+            $mform->addElement('checkbox', 'quickgrade', get_string('quickgrade','assignment'));
+            $mform->setDefault('quickgrade', $quickgrade);
+            $mform->addHelpButton('quickgrade', 'quickgrade', 'assignment');
+
+            $mform->addElement('submit', 'savepreferences', get_string('savepreferences'));
+
+            $mform->display();
+
+            echo $OUTPUT->footer();
+
             return true;
         }
         if ($this->assignment->assignmenttype=='upload' || $this->assignment->assignmenttype=='online' || $this->assignment->assignmenttype=='uploadsingle') { //TODO: this is an ugly hack, where is the plugin spirit? (skodak)
