Merge branch 'MDL-44330' of git://github.com/NeillM/moodle
authorDavid Monllao <davidm@moodle.com>
Tue, 24 Nov 2015 09:03:06 +0000 (17:03 +0800)
committerDavid Monllao <davidm@moodle.com>
Tue, 24 Nov 2015 09:03:06 +0000 (17:03 +0800)
1  2 
mod/assign/gradingtable.php

@@@ -828,7 -828,8 +828,8 @@@ class assign_grading_table extends tabl
                                              'mod_assign');
              $urlparams = array('id' => $this->assignment->get_course_module()->id,
                                 'rownum'=>$this->rownum,
-                                'action'=>'grade');
+                                'action' => 'grade',
+                                'useridlistid' => $this->assignment->get_useridlist_key_id());
              $url = new moodle_url('/mod/assign/view.php', $urlparams);
              $link = $this->output->action_link($url, $icon);
              $grade .= $link . $separator;
          }
  
          if ($this->is_downloading()) {
 -            $o = strip_tags(str_replace('</div>', "\n", $o));
 +            $o = strip_tags(rtrim(str_replace('</div>', ' - ', $o), '- '));
          }
  
          return $o;
  
          $urlparams = array('id'=>$this->assignment->get_course_module()->id,
                             'rownum'=>$this->rownum,
-                            'action'=>'grade');
+                            'action' => 'grade',
+                            'useridlistid' => $this->assignment->get_useridlist_key_id());
          $url = new moodle_url('/mod/assign/view.php', $urlparams);
          $noimage = null;
  
          }
          return '';
      }
+     /**
+      * Overides setup to ensure it will only run a single time.
+      */
+     public function setup() {
+         // Check if the setup function has been called before, we should not run it twice.
+         // If we do the sortorder of the table will be broken.
+         if (!empty($this->setup)) {
+             return;
+         }
+         parent::setup();
+     }
  }