MDL-47494 ddimageortext: Fix codechecker problems in match, description and ddwtos...
[moodle.git] / question / type / ddimageortext / question.php
blob6894248d242722ffed7d33df3ded9241395bc773
1 <?php
3 // This file is part of Moodle - http://moodle.org/
4 //
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.
9 //
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/>.
18 /**
19 * Drag-and-drop words into sentences question definition class.
21 * @package qtype
22 * @subpackage ddwtos
23 * @copyright 2009 The Open University
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28 defined('MOODLE_INTERNAL') || die();
30 require_once($CFG->dirroot . '/question/type/gapselect/questionbase.php');
33 /**
34 * Represents a drag-and-drop words into sentences question.
36 * @copyright 2009 The Open University
37 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39 class qtype_ddwtos_question extends qtype_gapselect_question_base {
40 // Is actually exactly the same.
44 /**
45 * Represents one of the choices (draggable boxes).
47 * @copyright 2009 The Open University
48 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
50 class qtype_ddwtos_choice {
51 public $text;
52 public $draggroup;
53 public $isinfinite;
55 public function __construct($text, $draggroup = 1, $isinfinite = false) {
56 $this->text = $text;
57 $this->draggroup = $draggroup;
58 $this->isinfinite = $isinfinite;
60 public function choice_group() {
61 return $this->draggroup;