1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
namespace mod_questionnaire\question;
|
|
|
18 |
use mod_questionnaire\edit_question_form;
|
|
|
19 |
use \questionnaire;
|
|
|
20 |
|
|
|
21 |
/**
|
|
|
22 |
* This file contains the parent class for pagebreak question types.
|
|
|
23 |
*
|
|
|
24 |
* @author Mike Churchward
|
|
|
25 |
* @copyright 2016 onward Mike Churchward (mike.churchward@poetopensource.org)
|
|
|
26 |
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
|
|
27 |
* @package mod_questionnaire
|
|
|
28 |
*/
|
|
|
29 |
class pagebreak extends question {
|
|
|
30 |
|
|
|
31 |
/**
|
|
|
32 |
* Each question type must define its response class.
|
|
|
33 |
* @return object The response object based off of questionnaire_response_base.
|
|
|
34 |
*/
|
|
|
35 |
protected function responseclass() {
|
|
|
36 |
return '';
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
/**
|
|
|
40 |
* Short name for this question type - no spaces, etc..
|
|
|
41 |
* @return string
|
|
|
42 |
*/
|
|
|
43 |
public function helpname() {
|
|
|
44 |
return '';
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
/**
|
|
|
48 |
* Get the output for the start of the questions in a survey.
|
|
|
49 |
* @param int $qnum
|
|
|
50 |
* @param \mod_questionnaire\responsetype\response\response $response
|
|
|
51 |
* @return \stdClass
|
|
|
52 |
*/
|
|
|
53 |
public function questionstart_survey_display($qnum, $response=null) {
|
|
|
54 |
return '';
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
/**
|
|
|
58 |
* Question specific display method.
|
|
|
59 |
* @param \stdClass $data
|
|
|
60 |
* @param array $descendantsdata
|
|
|
61 |
* @param bool $blankquestionnaire
|
|
|
62 |
*
|
|
|
63 |
*/
|
|
|
64 |
protected function question_survey_display($data, $descendantsdata, $blankquestionnaire=false) {
|
|
|
65 |
return '';
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
/**
|
|
|
69 |
* Question specific response display method.
|
|
|
70 |
* @param \stdClass $data
|
|
|
71 |
*
|
|
|
72 |
*/
|
|
|
73 |
protected function response_survey_display($data) {
|
|
|
74 |
return '';
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
/**
|
|
|
78 |
* Override this, or any of the internal methods, to provide specific form data for editing the question type.
|
|
|
79 |
* The structure of the elements here is the default layout for the question form.
|
|
|
80 |
* @param edit_question_form $form The main moodleform object.
|
|
|
81 |
* @param questionnaire $questionnaire The questionnaire being edited.
|
|
|
82 |
* @return bool
|
|
|
83 |
*/
|
|
|
84 |
public function edit_form(edit_question_form $form, questionnaire $questionnaire) {
|
|
|
85 |
return false;
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
/**
|
|
|
89 |
* True if question provides mobile support.
|
|
|
90 |
* @return bool
|
|
|
91 |
*/
|
|
|
92 |
public function supports_mobile() {
|
|
|
93 |
return false;
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
/**
|
|
|
97 |
* Override and return false if not supporting mobile app.
|
|
|
98 |
* @param int $qnum
|
|
|
99 |
* @param bool $autonum
|
|
|
100 |
* @return \stdClass
|
|
|
101 |
*/
|
|
|
102 |
public function mobile_question_display($qnum, $autonum = false) {
|
|
|
103 |
return false;
|
|
|
104 |
}
|
|
|
105 |
}
|