Skip to content
Snippets Groups Projects
Select Git revision
  • ce8d0e6e04d37ac8ee59090bd2e341c3ffcf5a4a
  • master default protected
  • more_logging
  • MDL-58395
  • accountexpires
  • hsh_3.10
  • v3.10-r1
  • v3.9-r2
  • v3.9-r1
  • v3.8-r1
  • v3.7-r1
  • v3.6-r1
  • v3.5-r2
  • v3.5-r1
  • v3.4-r4
  • v3.4-r3
  • v3.4-r2
  • v3.4-r1
  • v3.3-r1
  • v3.2-r4
  • v3.2-r3
  • v3.2-r2
  • v3.2-r1
  • v3.1-r1
  • v3.0-r3
  • v3.0-r2
26 results

CHANGES.md

Blame
  • To find the state of this project's repository at the time of any of these versions, check out the tags.
    action_download.php 1.72 KiB
    <?php
    // This file is part of Moodle - http://moodle.org/
    //
    // Moodle is free software: you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    // the Free Software Foundation, either version 3 of the License, or
    // (at your option) any later version.
    //
    // Moodle is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
    //
    // You should have received a copy of the GNU General Public License
    // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
    
    /**
     * Wrapper script redirecting user operations to correct destination.
     *
     * @copyright 1999 Martin Dougiamas  http://dougiamas.com
     * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     * @package local_hshexport
     */
    
    use local_hshexport\local\helpers\download;
    
    require(__DIR__ . '/../../config.php');
    
    $PAGE->set_url('/local/hshexport/action_download.php');
    
    if (!confirm_sesskey()) {
        throw new \moodle_exception('confirmsesskeybad');
    }
    
    $course_code = optional_param('course_code', null, PARAM_ALPHANUMEXT);
    $roleids = required_param_array('select_roles', PARAM_INT);
    $courseid = required_param('courseid', PARAM_INT);
    $coursecontextid = required_param('coursecontextid', PARAM_INT);
    
    $filename = download::get_evaluation_filename($courseid, $course_code);
    $rows = local_hshexport\local\helpers\user_query::get_users_by_role($courseid, $coursecontextid, $roleids);
    
    if ($course_code != null) {
        $rows = local_hshexport\local\helpers\download::get_rows($rows, $course_code);
    }
    
    \core\dataformat::download_data($filename, 'csv', [], $rows);