Ignore:
Timestamp:
May 2, 2016, 12:09:23 PM (3 years ago)
Author:
jrpelegrina
Message:

Updated to moodle 3.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moodle/trunk/fuentes/grade/export/txt/dump.php

    r136 r1331  
    1818define('NO_MOODLE_COOKIES', true); // session not used here
    1919require_once '../../../config.php';
     20require_once($CFG->dirroot.'/grade/export/txt/grade_export_txt.php');
    2021
    21 $id = required_param('id', PARAM_INT); // course id
     22$id                 = required_param('id', PARAM_INT);
     23$groupid            = optional_param('groupid', 0, PARAM_INT);
     24$itemids            = required_param('itemids', PARAM_RAW);
     25$exportfeedback     = optional_param('export_feedback', 0, PARAM_BOOL);
     26$separator          = optional_param('separator', 'comma', PARAM_ALPHA);
     27$displaytype        = optional_param('displaytype', $CFG->grade_export_displaytype, PARAM_RAW);
     28$decimalpoints      = optional_param('decimalpoints', $CFG->grade_export_decimalpoints, PARAM_INT);
     29$onlyactive         = optional_param('export_onlyactive', 0, PARAM_BOOL);
     30
    2231if (!$course = $DB->get_record('course', array('id'=>$id))) {
    2332    print_error('nocourseid');
     
    3140
    3241$context = context_course::instance($id);
     42require_capability('moodle/grade:export', $context);
    3343require_capability('gradeexport/txt:publish', $context);
     44require_capability('gradeexport/txt:view', $context);
    3445
    35 // use the same page parameters as export.php and append &key=sdhakjsahdksahdkjsahksadjksahdkjsadhksa
    36 require 'export.php';
     46if (!groups_group_visible($groupid, $COURSE)) {
     47    print_error('cannotaccessgroup', 'grades');
     48}
     49
     50// Get all url parameters and create an object to simulate a form submission.
     51$formdata = grade_export::export_bulk_export_data($id, $itemids, $exportfeedback, $onlyactive, $displaytype,
     52        $decimalpoints, null, $separator);
     53
     54$export = new grade_export_txt($course, $groupid, $formdata);
     55$export->print_grades();
    3756
    3857
Note: See TracChangeset for help on using the changeset viewer.