The following source (from HEAD as of 9/25/2008) contains a typo in line 105 where 'sortfield1' should be 'sortfield2':
102 $ofields = ", u.$this->sortfield1 AS usrt1";
103 $order = "usrt1 $this->sortorder1";
104 if (!empty($this->sortfield2))
The SQL generated by this typo-affected code tries to sort by $this->sortfield1 twice and neglects $this->sortfield2. We didn't notice the problem until one of our instructors encountered it while exporting his gradebook.
This is a one-character fix.
Philip Cali and Adam Zapletal