芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/public_html/cepali/mod/quiz/report/grading/gradingsettings_form.php
. /** * This file defines the setting form for the quiz grading report. * * @package quiz_grading * @copyright 2010 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); /** * Quiz grading report settings form. * * @copyright 2010 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class quiz_grading_settings_form extends moodleform { protected $includeauto; protected $hidden = array(); protected $counts; protected $shownames; protected $showidnumbers; public function __construct($hidden, $counts, $shownames, $showidnumbers) { global $CFG; $this->includeauto = !empty($hidden['includeauto']); $this->hidden = $hidden; $this->counts = $counts; $this->shownames = $shownames; $this->showidnumbers = $showidnumbers; parent::__construct($CFG->wwwroot . '/mod/quiz/report.php', null, 'get'); } protected function definition() { $mform = $this->_form; $mform->addElement('header', 'options', get_string('options', 'quiz_grading')); $gradeoptions = array(); foreach (array('needsgrading', 'manuallygraded', 'autograded', 'all') as $type) { if (empty($this->counts->$type)) { continue; } if ($type == 'autograded' && !$this->includeauto) { continue; } $gradeoptions[$type] = get_string('gradeattempts' . $type, 'quiz_grading', $this->counts->$type); } $mform->addElement('select', 'grade', get_string('attemptstograde', 'quiz_grading'), $gradeoptions); $mform->addElement('text', 'pagesize', get_string('questionsperpage', 'quiz_grading'), array('size' => 3)); $mform->setType('pagesize', PARAM_INT); $orderoptions = array( 'random' => get_string('randomly', 'quiz_grading'), 'date' => get_string('bydate', 'quiz_grading'), ); if ($this->shownames) { $orderoptions['studentfirstname'] = get_string('bystudentfirstname', 'quiz_grading'); $orderoptions['studentlastname'] = get_string('bystudentlastname', 'quiz_grading'); } if ($this->showidnumbers) { $orderoptions['idnumber'] = get_string('bystudentidnumber', 'quiz_grading'); } $mform->addElement('select', 'order', get_string('orderattempts', 'quiz_grading'), $orderoptions); foreach ($this->hidden as $name => $value) { $mform->addElement('hidden', $name, $value); if ($name == 'mode') { $mform->setType($name, PARAM_ALPHA); } else { $mform->setType($name, PARAM_INT); } } $mform->addElement('submit', 'submitbutton', get_string('changeoptions', 'quiz_grading')); } }