moodle-report_usergrades/classes/usergrades_form.php
Kumi 80ac83db92
feat: Add XLSX export for user grades report
Introduces XLSX export functionality to the user grades report.
Adds a checkbox for selecting XLSX export in the form interface.
Uses PhpSpreadsheet to generate and download detailed Excel
files containing user grades and quiz attempts.

Enhancement enables convenient data export for offline analysis
and sharing.
2024-11-25 10:09:36 +01:00

24 lines
No EOL
710 B
PHP

<?php
/**
* Form class for user selection
*/
class usergrades_form extends moodleform
{
public function definition()
{
$mform = $this->_form;
// User selector
$user_selector = new user_selector('userid', array('multiselect' => false));
$users = $user_selector->find_users('');
$mform->addElement('select', 'userid', get_string('selectuser', 'report_usergrades'), $users[get_string('users')]);
// XLSX Export checkbox
$mform->addElement('checkbox', 'exportxls', get_string('exportxls', 'report_usergrades'));
// Add form action buttons
$this->add_action_buttons(false, get_string('showgrades', 'report_usergrades'));
}
}