Changing the "export grades to XLS" fields

Changing the "export grades to XLS" fields

by Patrick Sennett -
Number of replies: 0
What I need is simply "ID number", date and score of last attempt. Into an XLS file, where I will manipulate the data, add a column or two, and import it into our education tracking database. I'm not totally uncomfortable with tweaking some PHP files, but I'm pretty lost with what I'm finding. The grade / export / xls / grade_export_xls.php looks somewhat familiar, but I'm not sure what to do beyond finding that.

$i = 0;
$geub = new grade_export_update_buffer();
$gui = new graded_users_iterator($this->course, $this->columns, $this->groupid);
$gui->init();
while ($userdata = $gui->next_user()) {
$i++;
$user = $userdata->user;

$myxls->write_string($i,0,$user->firstname);
$myxls->write_string($i,1,$user->lastname);
$myxls->write_string($i,2,$user->idnumber);
$myxls->write_string($i,3,$user->institution);
$myxls->write_string($i,4,$user->department);
$myxls->write_string($i,5,$user->email);
$j=6;
foreach ($userdata->grades as $itemid => $grade) {
if ($export_tracking) {
$status = $geub->track($grade);
}

$gradestr = $this->format_grade($grade);
if (is_numeric($gradestr)) {
$myxls->write_number($i,$j++,$gradestr);
}
else {
$myxls->write_string($i,$j++,$gradestr);
}