MDL-41754 (2) quiz statistics : using Sam's new progress classes
[moodle.git] / mod / quiz / report / statistics / statistics_form.php
CommitLineData
aeb15530 1<?php
04853f27
TH
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.
13//
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/>.
16
17/**
18 * Quiz statistics settings form definition.
19 *
8d76124c
TH
20 * @package quiz_statistics
21 * @copyright 2008 Jamie Pratt
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
04853f27
TH
23 */
24
a17b297d
TH
25defined('MOODLE_INTERNAL') || die();
26
04853f27
TH
27require_once($CFG->libdir . '/formslib.php');
28
29/**
30 * This is the settings form for the quiz statistics report.
31 *
8d76124c
TH
32 * @copyright 2008 Jamie Pratt
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
04853f27 34 */
6b4e2d76 35class quiz_statistics_settings_form extends moodleform {
c7df5006 36 protected function definition() {
04853f27
TH
37 $mform = $this->_form;
38
6dd9362e 39 $mform->addElement('header', 'preferencespage', get_string('reportsettings', 'quiz_statistics'));
0c1c764e 40
41 $options = array();
6dd9362e 42 foreach (array_keys(quiz_get_grading_options()) as $which) {
8da6fc9d 43 $options[$which] = \quiz_statistics\calculator::using_attempts_lang_string($which);
6dd9362e
JP
44 }
45
46 $mform->addElement('select', 'whichattempts', get_string('calculatefrom', 'quiz_statistics'), $options);
47
48 $mform->addElement('submit', 'submitbutton', get_string('preferencessave', 'quiz_overview'));
0c1c764e 49 }
50}