3 // This file is part of Moodle - http://moodle.org/
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
19 * Generic forms used for page selection
22 * @copyright 2009 Sam Hemelryk
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 defined('MOODLE_INTERNAL') ||
die();
29 * Question selection form
31 * @copyright 2009 Sam Hemelryk
32 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 class lesson_add_page_form_selection
extends lesson_add_page_form_base
{
36 public $qtype = 'questiontype';
37 public $qtypestring = 'selectaqtype';
38 protected $standard = false;
39 protected $manager = null;
41 public function __construct($arg1, $arg2) {
42 $this->manager
= lesson_page_type_manager
::get($arg2['lesson']);
43 parent
::__construct($arg1, $arg2);
46 public function custom_definition() {
47 $mform = $this->_form
;
48 $types = $this->manager
->get_page_type_strings(lesson_page
::TYPE_QUESTION
);
50 $mform->addElement('select', 'qtype', get_string('selectaqtype', 'lesson'), $types);
51 $mform->setDefault('qtype', LESSON_PAGE_MULTICHOICE
); // preselect the most common type
56 * Dummy class to represent an unknown question type and direct to the selection
59 final class lesson_add_page_form_unknown
extends lesson_add_page_form_base
{}