Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/quiz/report/responses/responsessettings_form.php
Go to the documentation of this file.
00001 <?php
00002 // This file is part of Moodle - http://moodle.org/
00003 //
00004 // Moodle is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // Moodle is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00016 
00027 defined('MOODLE_INTERNAL') || die();
00028 
00029 require_once($CFG->libdir . '/formslib.php');
00030 
00031 
00038 class mod_quiz_report_responses_settings extends moodleform {
00039 
00040     protected function definition() {
00041         $mform = $this->_form;
00042 
00043         $mform->addElement('header', 'preferencespage',
00044                 get_string('preferencespage', 'quiz_overview'));
00045 
00046         if (!$this->_customdata['currentgroup']) {
00047             $studentsstring = get_string('participants');
00048         } else {
00049             $a = new stdClass();
00050             $a->coursestudent = get_string('participants');
00051             $a->groupname = groups_get_group_name($this->_customdata['currentgroup']);
00052             if (20 < strlen($a->groupname)) {
00053                 $studentsstring = get_string('studentingrouplong', 'quiz_overview', $a);
00054             } else {
00055                 $studentsstring = get_string('studentingroup', 'quiz_overview', $a);
00056             }
00057         }
00058         $options = array();
00059         if (!$this->_customdata['currentgroup']) {
00060             $options[QUIZ_REPORT_ATTEMPTS_ALL] = get_string('optallattempts', 'quiz_overview');
00061         }
00062         if ($this->_customdata['currentgroup'] ||
00063                 !is_inside_frontpage($this->_customdata['context'])) {
00064             $options[QUIZ_REPORT_ATTEMPTS_ALL_STUDENTS] =
00065                     get_string('optallstudents', 'quiz_overview', $studentsstring);
00066             $options[QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH] =
00067                      get_string('optattemptsonly', 'quiz_overview', $studentsstring);
00068             $options[QUIZ_REPORT_ATTEMPTS_STUDENTS_WITH_NO] =
00069                     get_string('optnoattemptsonly', 'quiz_overview', $studentsstring);
00070         }
00071         $mform->addElement('select', 'attemptsmode',
00072                 get_string('show', 'quiz_overview'), $options);
00073 
00074         if ($this->_customdata['qmsubselect']) {
00075             $gm = '<span class="gradedattempt">' .
00076                     quiz_get_grading_option_name($this->_customdata['quiz']->grademethod) .
00077                     '</span>';
00078             $mform->addElement('advcheckbox', 'qmfilter',
00079                     get_string('showattempts', 'quiz_overview'),
00080                     get_string('optonlygradedattempts', 'quiz_overview', $gm), null, array(0, 1));
00081         }
00082 
00083         $colsgroup = array();
00084         $colsgroup[] = $mform->createElement('advcheckbox', 'qtext', '',
00085                 get_string('summaryofquestiontext', 'quiz_responses'));
00086         $colsgroup[] = $mform->createElement('advcheckbox', 'resp', '',
00087                 get_string('summaryofresponse', 'quiz_responses'));
00088         $colsgroup[] = $mform->createElement('advcheckbox', 'right', '',
00089                 get_string('summaryofrightanswer', 'quiz_responses'));
00090         $mform->addGroup($colsgroup, null,
00091                 get_string('include', 'quiz_responses'), '<br />', false);
00092 
00093         $mform->addElement('header', 'preferencesuser',
00094                 get_string('preferencesuser', 'quiz_overview'));
00095 
00096         $mform->addElement('text', 'pagesize', get_string('pagesize', 'quiz_overview'));
00097         $mform->setType('pagesize', PARAM_INT);
00098 
00099         $mform->addElement('submit', 'submitbutton',
00100                 get_string('preferencessave', 'quiz_overview'));
00101     }
00102 }
 All Data Structures Namespaces Files Functions Variables Enumerations