Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
/**
18
 * The file containing the install functions.
19
 * @package    mod_questionnaire
20
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
21
 * This file is executed right after the install.xml
22
 * @copyright  2016 Mike Churchward (mike.churchward@poetopensource.org)
23
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 */
25
 
26
/**
27
 * The install function.
28
 */
29
function xmldb_questionnaire_install() {
30
    global $DB;
31
 
32
    // Initial insert of mnet applications info.
33
    $questiontype = new stdClass();
34
    $questiontype->typeid = 1;
35
    $questiontype->type = 'Yes/No';
36
    $questiontype->has_choices = 'n';
37
    $questiontype->response_table = 'response_bool';
38
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
39
 
40
    $questiontype = new stdClass();
41
    $questiontype->typeid = 2;
42
    $questiontype->type = 'Text Box';
43
    $questiontype->has_choices = 'n';
44
    $questiontype->response_table = 'response_text';
45
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
46
 
47
    $questiontype = new stdClass();
48
    $questiontype->typeid = 3;
49
    $questiontype->type = 'Essay Box';
50
    $questiontype->has_choices = 'n';
51
    $questiontype->response_table = 'response_text';
52
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
53
 
54
    $questiontype = new stdClass();
55
    $questiontype->typeid = 4;
56
    $questiontype->type = 'Radio Buttons';
57
    $questiontype->has_choices = 'y';
58
    $questiontype->response_table = 'resp_single';
59
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
60
 
61
    $questiontype = new stdClass();
62
    $questiontype->typeid = 5;
63
    $questiontype->type = 'Check Boxes';
64
    $questiontype->has_choices = 'y';
65
    $questiontype->response_table = 'resp_multiple';
66
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
67
 
68
    $questiontype = new stdClass();
69
    $questiontype->typeid = 6;
70
    $questiontype->type = 'Dropdown Box';
71
    $questiontype->has_choices = 'y';
72
    $questiontype->response_table = 'resp_single';
73
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
74
 
75
    $questiontype = new stdClass();
76
    $questiontype->typeid = 8;
77
    $questiontype->type = 'Rate (scale 1..5)';
78
    $questiontype->has_choices = 'y';
79
    $questiontype->response_table = 'response_rank';
80
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
81
 
82
    $questiontype = new stdClass();
83
    $questiontype->typeid = 9;
84
    $questiontype->type = 'Date';
85
    $questiontype->has_choices = 'n';
86
    $questiontype->response_table = 'response_date';
87
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
88
 
89
    $questiontype = new stdClass();
90
    $questiontype->typeid = 10;
91
    $questiontype->type = 'Numeric';
92
    $questiontype->has_choices = 'n';
93
    $questiontype->response_table = 'response_text';
94
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
95
 
96
    $questiontype = new stdClass();
97
    $questiontype->typeid = 11;
98
    $questiontype->type = 'Slider';
99
    $questiontype->has_choices = 'n';
100
    $questiontype->response_table = 'response_text';
101
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
102
 
103
    $questiontype = new stdClass();
104
    $questiontype->typeid = 99;
105
    $questiontype->type = 'Page Break';
106
    $questiontype->has_choices = 'n';
107
    $questiontype->response_table = '';
108
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
109
 
110
    $questiontype = new stdClass();
111
    $questiontype->typeid = 100;
112
    $questiontype->type = 'Section Text';
113
    $questiontype->has_choices = 'n';
114
    $questiontype->response_table = '';
115
    $id = $DB->insert_record('questionnaire_question_type', $questiontype);
116
 
117
}