~ubuntu-branches/ubuntu/natty/moodle/natty

« back to all changes in this revision

Viewing changes to grade/export/xml/index.php

  • Committer: Bazaar Package Importer
  • Author(s): Tomasz Muras
  • Date: 2010-10-30 12:19:28 UTC
  • mfrom: (1.1.12 upstream) (3.1.10 squeeze)
  • Revision ID: james.westby@ubuntu.com-20101030121928-qzobi6mctpnk4dif
Tags: 1.9.9.dfsg2-2
* Added Romanian translation
* Updated Japanese translation (closes: #596820)
* Backporting security fixes from Moodle 1.9.10 (closes: #601384)
   - Updated embedded CAS to 1.1.3
   - Added patch for MDL-24523:
     clean_text() not filtering text in markdown format
   - Added patch for MDL-24810 and upgraded customized HTML Purifier to 4.2.0 
   - Added patch for MDL-24258:
     students can delete their forum posts later than $CFG->maxeditingtime 
     under certain conditions
   - Added patch for MDL-23377:
     Can't delete quiz attempts in course without enrolled students

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php  //$Id: index.php,v 1.35.2.2 2007/12/07 01:40:45 toyomoyo Exp $
 
1
<?php
2
2
 
3
 
///////////////////////////////////////////////////////////////////////////
4
 
//                                                                       //
5
 
// NOTICE OF COPYRIGHT                                                   //
6
 
//                                                                       //
7
 
// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
8
 
//          http://moodle.com                                            //
9
 
//                                                                       //
10
 
// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //
11
 
//                                                                       //
12
 
// This program is free software; you can redistribute it and/or modify  //
13
 
// it under the terms of the GNU General Public License as published by  //
14
 
// the Free Software Foundation; either version 2 of the License, or     //
15
 
// (at your option) any later version.                                   //
16
 
//                                                                       //
17
 
// This program is distributed in the hope that it will be useful,       //
18
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of        //
19
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
20
 
// GNU General Public License for more details:                          //
21
 
//                                                                       //
22
 
//          http://www.gnu.org/copyleft/gpl.html                         //
23
 
//                                                                       //
24
 
///////////////////////////////////////////////////////////////////////////
 
3
// This file is part of Moodle - http://moodle.org/
 
4
//
 
5
// Moodle is free software: you can redistribute it and/or modify
 
6
// it under the terms of the GNU General Public License as published by
 
7
// the Free Software Foundation, either version 3 of the License, or
 
8
// (at your option) any later version.
 
9
//
 
10
// Moodle is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
// GNU General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
25
17
 
26
18
require_once '../../../config.php';
27
19
require_once $CFG->dirroot.'/grade/export/lib.php';
39
31
require_capability('moodle/grade:export', $context);
40
32
require_capability('gradeexport/xml:view', $context);
41
33
 
42
 
 
43
 
$strgrades = get_string('grades', 'grades');
44
 
$actionstr = get_string('modulename', 'gradeexport_xml');
45
 
$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
46
 
 
47
 
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
48
 
print_grade_plugin_selector($id, 'export', 'xml');
 
34
print_grade_page_head($COURSE->id, 'export', 'xml', get_string('exportto', 'grades') . ' ' . get_string('modulename', 'gradeexport_xml'));
49
35
 
50
36
if (!empty($CFG->gradepublishing)) {
51
37
    $CFG->gradepublishing = has_capability('gradeexport/xml:publish', $context);
53
39
 
54
40
$mform = new grade_export_form(null, array('idnumberrequired'=>true, 'publishing'=>true, 'updategradesonly'=>true));
55
41
 
 
42
$groupmode    = groups_get_course_groupmode($course);   // Groups are being used
 
43
$currentgroup = groups_get_course_group($course, true);
 
44
if ($groupmode == SEPARATEGROUPS and !$currentgroup and !has_capability('moodle/site:accessallgroups', $context)) {
 
45
    print_heading(get_string("notingroup"));
 
46
    print_footer($course);
 
47
    die;    
 
48
}
 
49
 
56
50
// process post information
57
51
if ($data = $mform->get_data()) {
58
 
    $export = new grade_export_xml($course, groups_get_course_group($course), '', false, $data->updatedgradesonly, $data->display, $data->decimals);
 
52
    $export = new grade_export_xml($course, $currentgroup, '', false, $data->updatedgradesonly, $data->display, $data->decimals);
59
53
 
60
54
    // print the grades on screen for feedbacks
61
55
    $export->process_form($data);
62
56
    $export->print_continue();
63
 
    $export->display_preview();
 
57
    $export->display_preview(true);
64
58
    print_footer($course);
65
59
    exit;
66
60
}