(http://moodle.org/mod/forum/discuss.php?d=115940&parent=519193)
I have modified codes in moodle\mod\quiz\report\overview\report.php to sort by user's requested order when an Excel is downloaded.
I tested and this looks OK.
But, I am not so much experienced PHP and Virtual learning environment,
if you find any errors in my codes or have any advices or suggestions, please let me know.
Any help would be grateful.
Thanks
Norie
I use Moodle 1.9.3
Line 410
Old Codes
if ($download){
$sort = '';
}
// Fix some wired sorting
if (empty($sort)) {
$sort = ' ORDER BY uniqueid';
} else {
$sort = ' ORDER BY '.$sort;
}
New Codes
if ($download){
//$sort = '';
if (empty($_SESSION['mysortstring'])) {
$sort ='';
}else {
$sort =$_SESSION['mysortstring'];
}
}
// Fix some wired sorting
if (empty($sort)) {
$sort = ' ORDER BY uniqueid';
} else {
// add here for using session to keep sort order for excel sheet
$_SESSION['mysortstring'] = $sort;
$sort = ' ORDER BY '.$sort;
}