MDL-35238 Unzip the downloaded package and redirect to the upgrade page
[moodle.git] / mod / assign / gradingbatchoperationsform.php
blob38b73c8d25d32ad657cbc04b4d0d85ae0bd52747
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * This file contains the forms to create and edit an instance of this module
20 * @package mod_assign
21 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
28 /** Include formslib.php */
29 require_once ($CFG->libdir.'/formslib.php');
30 /** Include locallib.php */
31 require_once($CFG->dirroot . '/mod/assign/locallib.php');
33 /**
34 * Assignment grading options form
36 * @package mod_assign
37 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
38 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
40 class mod_assign_grading_batch_operations_form extends moodleform {
41 /**
42 * Define this form - called by the parent constructor
44 function definition() {
45 $mform = $this->_form;
46 $instance = $this->_customdata;
48 // visible elements
49 $options = array();
50 $options['lock'] = get_string('locksubmissions', 'assign');
51 $options['unlock'] = get_string('unlocksubmissions', 'assign');
52 if ($instance['submissiondrafts']) {
53 $options['reverttodraft'] = get_string('reverttodraft', 'assign');
55 if ($instance['duedate']) {
56 $options['grantextension'] = get_string('grantextension', 'assign');
59 foreach ($instance['feedbackplugins'] as $plugin) {
60 if ($plugin->is_visible() && $plugin->is_enabled()) {
61 foreach ($plugin->get_grading_batch_operations() as $action => $description) {
62 $options['plugingradingbatchoperation_' . $plugin->get_type() . '_' . $action] = $description;
67 $mform->addElement('hidden', 'action', 'gradingbatchoperation');
68 $mform->addElement('hidden', 'id', $instance['cm']);
69 $mform->addElement('hidden', 'selectedusers', '', array('class'=>'selectedusers'));
70 $mform->addElement('hidden', 'returnaction', 'grading');
72 $objs = array();
73 $objs[] =& $mform->createElement('select', 'operation', '', $options);
74 $objs[] =& $mform->createElement('submit', 'submit', get_string('go'));
75 $mform->addElement('group', 'actionsgrp', get_string('batchoperationsdescription', 'assign'), $objs, ' ', false);