Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / mod / quiz / report / overview / overviewsettings_form.php
blobc3a95b9dfd25e93f8f1b1db16732cf1d848627d8
1 <?php // $Id$
2 require_once "$CFG->libdir/formslib.php";
3 class mod_quiz_report_overview_settings extends moodleform {
5 function definition() {
6 global $COURSE;
7 $mform =& $this->_form;
8 //-------------------------------------------------------------------------------
9 $mform->addElement('header', 'preferencespage', get_string('preferencespage', 'quiz_overview'));
11 $options = array();
12 if (!$this->_customdata['currentgroup']){
13 $options[QUIZ_REPORT_ATTEMPTS_ALL] = get_string('optallattempts','quiz_overview');
15 if ($this->_customdata['currentgroup'] || $COURSE->id != SITEID) {
16 $options[QUIZ_REPORT_ATTEMPTS_ALL_STUDENTS] = get_string('optallstudents','quiz_overview', $COURSE->students);
17 $options[QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH] =
18 get_string('optattemptsonly','quiz_overview', $COURSE->students);
19 $options[QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH_NO] = get_string('optnoattemptsonly', 'quiz_overview', $COURSE->students);
21 $mform->addElement('select', 'attemptsmode', get_string('show', 'quiz_overview'), $options);
22 if ($this->_customdata['qmsubselect']){
23 $gm = '<span class="highlight">'.quiz_get_grading_option_name($this->_customdata['quiz']->grademethod).'</span>';
24 $mform->addElement('advcheckbox', 'qmfilter', get_string('show', 'quiz_overview'), get_string('optonlygradedattempts', 'quiz_overview', $gm), null, array(0,1));
26 //-------------------------------------------------------------------------------
27 $mform->addElement('header', 'preferencesuser', get_string('preferencesuser', 'quiz_overview'));
29 $mform->addElement('text', 'pagesize', get_string('pagesize', 'quiz_overview'));
30 $mform->setType('pagesize', PARAM_INT);
32 $mform->addElement('selectyesno', 'detailedmarks', get_string('showdetailedmarks', 'quiz_overview'));
34 $this->add_action_buttons(false, get_string('preferencessave', 'quiz_overview'));