MDL-19976 Changing redirect($url->out()) to redirect($url). NEVER, NEVER use redirect...
[moodle.git] / mod / quiz / report / overview / overviewsettings_form.php
CommitLineData
0217f932 1<?php // $Id$
2require_once "$CFG->libdir/formslib.php";
3class mod_quiz_report_overview_settings extends moodleform {
4
5 function definition() {
6 global $COURSE;
7 $mform =& $this->_form;
8//-------------------------------------------------------------------------------
134cf8ae 9 $mform->addElement('header', 'preferencespage', get_string('preferencespage', 'quiz_overview'));
0217f932 10
7660aa80 11 if (!$this->_customdata['currentgroup']){
9101efd3 12 $studentsstring = get_string('participants');
7660aa80 13 } else {
14 $a = new object();
9101efd3 15 $a->coursestudent = get_string('participants');
7660aa80 16 $a->groupname = groups_get_group_name($this->_customdata['currentgroup']);
91769761 17 if (20 < strlen($a->groupname)){
18 $studentsstring = get_string('studentingrouplong', 'quiz_overview', $a);
19 } else {
20 $studentsstring = get_string('studentingroup', 'quiz_overview', $a);
21 }
7660aa80 22 }
4469159e 23 $options = array();
7660aa80 24 if (!$this->_customdata['currentgroup']){
25 $options[QUIZ_REPORT_ATTEMPTS_ALL] = get_string('optallattempts','quiz_overview');
26 }
27 if ($this->_customdata['currentgroup'] || $COURSE->id != SITEID) {
28 $options[QUIZ_REPORT_ATTEMPTS_ALL_STUDENTS] = get_string('optallstudents','quiz_overview', $studentsstring);
4469159e 29 $options[QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH] =
7660aa80 30 get_string('optattemptsonly','quiz_overview', $studentsstring);
31 $options[QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH_NO] = get_string('optnoattemptsonly', 'quiz_overview', $studentsstring);
0217f932 32 }
33 $mform->addElement('select', 'attemptsmode', get_string('show', 'quiz_overview'), $options);
98f38217 34
35 $showattemptsgrp = array();
4469159e 36 if ($this->_customdata['qmsubselect']){
44eb3b6e 37 $gm = '<span class="highlight">'.quiz_get_grading_option_name($this->_customdata['quiz']->grademethod).'</span>';
98f38217 38 $showattemptsgrp[] =& $mform->createElement('advcheckbox', 'qmfilter', get_string('showattempts', 'quiz_overview'), get_string('optonlygradedattempts', 'quiz_overview', $gm), null, array(0,1));
4469159e 39 }
bbf4f440 40 if (has_capability('mod/quiz:regrade', $this->_customdata['context'])){
f29e6691 41 $showattemptsgrp[] =& $mform->createElement('advcheckbox', 'regradefilter', get_string('showattempts', 'quiz_overview'), get_string('optonlyregradedattempts', 'quiz_overview'), null, array(0,1));
42 }
43 if ($showattemptsgrp){
44 $mform->addGroup($showattemptsgrp, null, get_string('showattempts', 'quiz_overview'), '<br />', false);
45 }
0217f932 46//-------------------------------------------------------------------------------
134cf8ae 47 $mform->addElement('header', 'preferencesuser', get_string('preferencesuser', 'quiz_overview'));
0217f932 48
4469159e 49 $mform->addElement('text', 'pagesize', get_string('pagesize', 'quiz_overview'));
0217f932 50 $mform->setType('pagesize', PARAM_INT);
51
4469159e 52 $mform->addElement('selectyesno', 'detailedmarks', get_string('showdetailedmarks', 'quiz_overview'));
0217f932 53
54 $this->add_action_buttons(false, get_string('preferencessave', 'quiz_overview'));
55 }
56}
57?>