| Línea 13... |
Línea 13... |
| 13 |
//
|
13 |
//
|
| 14 |
// You should have received a copy of the GNU General Public License
|
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/>.
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
| Línea 16... |
Línea 16... |
| 16 |
|
16 |
|
| 17 |
/**
|
17 |
/**
|
| 18 |
* This file contains the forms to create and edit an instance of this module
|
18 |
* File only retained to prevent fatal errors in code that tries to require/include this.
|
| 19 |
*
|
- |
|
| 20 |
* @package mod_assign
|
19 |
*
|
| 21 |
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
20 |
* @deprecated since 4.5. This file is no longer required.
|
| 22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
21 |
* @todo This file should be removed in Moodle 6.0. See MDL-82876.
|
| Línea 23... |
Línea 22... |
| 23 |
*/
|
22 |
*/
|
| Línea 24... |
Línea -... |
| 24 |
|
- |
|
| 25 |
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
|
- |
|
| 26 |
|
- |
|
| 27 |
|
- |
|
| 28 |
require_once($CFG->libdir.'/formslib.php');
|
- |
|
| 29 |
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
- |
|
| 30 |
|
- |
|
| 31 |
/**
|
- |
|
| 32 |
* Assignment grading options form
|
- |
|
| 33 |
*
|
- |
|
| 34 |
* @package mod_assign
|
- |
|
| 35 |
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
|
- |
|
| 36 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
- |
|
| 37 |
*/
|
- |
|
| 38 |
class mod_assign_grading_options_form extends moodleform {
|
- |
|
| 39 |
/**
|
- |
|
| 40 |
* Define this form - called from the parent constructor.
|
- |
|
| 41 |
*/
|
- |
|
| 42 |
public function definition() {
|
- |
|
| 43 |
$mform = $this->_form;
|
- |
|
| 44 |
$instance = $this->_customdata;
|
- |
|
| 45 |
|
- |
|
| 46 |
$mform->disable_form_change_checker();
|
- |
|
| 47 |
|
- |
|
| 48 |
$mform->addElement('header', 'general', get_string('gradingoptions', 'assign'));
|
- |
|
| 49 |
// Visible elements.
|
- |
|
| 50 |
$options = array(10 => '10', 20 => '20', 50 => '50', 100 => '100', -1 => get_string('all'));
|
- |
|
| 51 |
$maxperpage = get_config('assign', 'maxperpage');
|
- |
|
| 52 |
if (isset($maxperpage) && $maxperpage != -1) {
|
- |
|
| 53 |
unset($options[-1]);
|
- |
|
| 54 |
foreach ($options as $val) {
|
- |
|
| 55 |
if ($val > $maxperpage) {
|
- |
|
| 56 |
unset($options[$val]);
|
- |
|
| 57 |
}
|
- |
|
| 58 |
}
|
- |
|
| 59 |
}
|
- |
|
| 60 |
$mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options);
|
- |
|
| 61 |
$options = array('' => get_string('filternone', 'assign'),
|
- |
|
| 62 |
ASSIGN_FILTER_NOT_SUBMITTED => get_string('filternotsubmitted', 'assign'),
|
23 |
|
| 63 |
ASSIGN_FILTER_DRAFT => get_string('filterdraft', 'assign'),
|
- |
|
| 64 |
ASSIGN_FILTER_SUBMITTED => get_string('filtersubmitted', 'assign'),
|
- |
|
| 65 |
ASSIGN_FILTER_REQUIRE_GRADING => get_string('filterrequiregrading', 'assign'),
|
- |
|
| 66 |
ASSIGN_FILTER_GRANTED_EXTENSION => get_string('filtergrantedextension', 'assign'));
|
- |
|
| 67 |
if ($instance['submissionsenabled']) {
|
- |
|
| 68 |
$mform->addElement('select', 'filter', get_string('filter', 'assign'), $options);
|
- |
|
| 69 |
}
|
- |
|
| 70 |
if (!empty($instance['markingallocationopt'])) {
|
- |
|
| 71 |
$markingfilter = get_string('markerfilter', 'assign');
|
- |
|
| 72 |
$mform->addElement('select', 'markerfilter', $markingfilter, $instance['markingallocationopt']);
|
- |
|
| 73 |
}
|
- |
|
| 74 |
if (!empty($instance['markingworkflowopt'])) {
|
- |
|
| 75 |
$workflowfilter = get_string('workflowfilter', 'assign');
|
- |
|
| 76 |
$mform->addElement('select', 'workflowfilter', $workflowfilter, $instance['markingworkflowopt']);
|
- |
|
| 77 |
}
|
- |
|
| 78 |
// Quickgrading.
|
- |
|
| 79 |
if ($instance['showquickgrading']) {
|
- |
|
| 80 |
$mform->addElement('checkbox', 'quickgrading', get_string('quickgrading', 'assign'));
|
- |
|
| 81 |
$mform->addHelpButton('quickgrading', 'quickgrading', 'assign');
|
- |
|
| 82 |
$mform->setDefault('quickgrading', $instance['quickgrading']);
|
- |
|
| 83 |
}
|
- |
|
| 84 |
|
- |
|
| 85 |
// Show active/suspended user option.
|
- |
|
| 86 |
if ($instance['showonlyactiveenrolopt']) {
|
- |
|
| 87 |
$mform->addElement('checkbox', 'showonlyactiveenrol', get_string('showonlyactiveenrol', 'grades'));
|
- |
|
| 88 |
$mform->addHelpButton('showonlyactiveenrol', 'showonlyactiveenrol', 'grades');
|
- |
|
| 89 |
$mform->setDefault('showonlyactiveenrol', $instance['showonlyactiveenrol']);
|
- |
|
| 90 |
}
|
- |
|
| 91 |
|
- |
|
| 92 |
// Place student downloads in seperate folders.
|
- |
|
| 93 |
if ($instance['submissionsenabled']) {
|
- |
|
| 94 |
$mform->addElement('checkbox', 'downloadasfolders', get_string('downloadasfolders', 'assign'));
|
- |
|
| 95 |
$mform->addHelpButton('downloadasfolders', 'downloadasfolders', 'assign');
|
- |
|
| 96 |
$mform->setDefault('downloadasfolders', $instance['downloadasfolders']);
|
- |
|
| 97 |
}
|
- |
|
| 98 |
|
- |
|
| 99 |
// Hidden params.
|
- |
|
| 100 |
$mform->addElement('hidden', 'contextid', $instance['contextid']);
|
- |
|
| 101 |
$mform->setType('contextid', PARAM_INT);
|
- |
|
| 102 |
$mform->addElement('hidden', 'id', $instance['cm']);
|
- |
|
| 103 |
$mform->setType('id', PARAM_INT);
|
- |
|
| 104 |
$mform->addElement('hidden', 'userid', $instance['userid']);
|
- |
|
| 105 |
$mform->setType('userid', PARAM_INT);
|
- |
|
| 106 |
$mform->addElement('hidden', 'action', 'saveoptions');
|
- |
|
| 107 |
$mform->setType('action', PARAM_ALPHA);
|
- |
|
| 108 |
|
- |
|
| 109 |
// Buttons.
|
- |
|
| 110 |
$this->add_action_buttons(false, get_string('updatetable', 'assign'));
|
- |
|