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 |
* Survey module installation.
|
|
|
19 |
*
|
|
|
20 |
* @package mod_survey
|
|
|
21 |
* @copyright 2009 Petr Skoda (http://skodak.org)
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
/**
|
|
|
26 |
* Perform the post-install procedures.
|
|
|
27 |
*/
|
|
|
28 |
function xmldb_survey_install() {
|
|
|
29 |
global $DB;
|
|
|
30 |
|
|
|
31 |
// Disable the survey activity module on new installs by default.
|
|
|
32 |
$DB->set_field('modules', 'visible', 0, ['name' => 'survey']);
|
|
|
33 |
|
|
|
34 |
// Insert survey data.
|
|
|
35 |
$records = array(
|
|
|
36 |
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44')),
|
|
|
37 |
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'collespname', 'collespintro', '31,32,33,34,35,36,43,44')),
|
|
|
38 |
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'collesapname', 'collesapintro', '37,38,39,40,41,42,43,44')),
|
|
|
39 |
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'attlsname', 'attlsintro', '65,67,68')),
|
|
|
40 |
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'ciqname', 'ciqintro', '69,70,71,72,73')),
|
|
|
41 |
);
|
|
|
42 |
foreach ($records as $record) {
|
|
|
43 |
$DB->insert_record('survey', $record, false);
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
$records = array(
|
|
|
47 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles1', 'colles1short', 1, 'scaletimes5')),
|
|
|
48 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles2', 'colles2short', 1, 'scaletimes5')),
|
|
|
49 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles3', 'colles3short', 1, 'scaletimes5')),
|
|
|
50 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles4', 'colles4short', 1, 'scaletimes5')),
|
|
|
51 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles5', 'colles5short', 1, 'scaletimes5')),
|
|
|
52 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles6', 'colles6short', 1, 'scaletimes5')),
|
|
|
53 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles7', 'colles7short', 1, 'scaletimes5')),
|
|
|
54 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles8', 'colles8short', 1, 'scaletimes5')),
|
|
|
55 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles9', 'colles9short', 1, 'scaletimes5')),
|
|
|
56 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles10', 'colles10short', 1, 'scaletimes5')),
|
|
|
57 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles11', 'colles11short', 1, 'scaletimes5')),
|
|
|
58 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles12', 'colles12short', 1, 'scaletimes5')),
|
|
|
59 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles13', 'colles13short', 1, 'scaletimes5')),
|
|
|
60 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles14', 'colles14short', 1, 'scaletimes5')),
|
|
|
61 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles15', 'colles15short', 1, 'scaletimes5')),
|
|
|
62 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles16', 'colles16short', 1, 'scaletimes5')),
|
|
|
63 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles17', 'colles17short', 1, 'scaletimes5')),
|
|
|
64 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles18', 'colles18short', 1, 'scaletimes5')),
|
|
|
65 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles19', 'colles19short', 1, 'scaletimes5')),
|
|
|
66 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles20', 'colles20short', 1, 'scaletimes5')),
|
|
|
67 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles21', 'colles21short', 1, 'scaletimes5')),
|
|
|
68 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles22', 'colles22short', 1, 'scaletimes5')),
|
|
|
69 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles23', 'colles23short', 1, 'scaletimes5')),
|
|
|
70 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles24', 'colles24short', 1, 'scaletimes5')),
|
|
|
71 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 1, 'scaletimes5')),
|
|
|
72 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 1, 'scaletimes5')),
|
|
|
73 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 1, 'scaletimes5')),
|
|
|
74 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 1, 'scaletimes5')),
|
|
|
75 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 1, 'scaletimes5')),
|
|
|
76 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 1, 'scaletimes5')),
|
|
|
77 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 2, 'scaletimes5')),
|
|
|
78 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 2, 'scaletimes5')),
|
|
|
79 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 2, 'scaletimes5')),
|
|
|
80 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 2, 'scaletimes5')),
|
|
|
81 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 2, 'scaletimes5')),
|
|
|
82 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 2, 'scaletimes5')),
|
|
|
83 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 3, 'scaletimes5')),
|
|
|
84 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 3, 'scaletimes5')),
|
|
|
85 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 3, 'scaletimes5')),
|
|
|
86 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 3, 'scaletimes5')),
|
|
|
87 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 3, 'scaletimes5')),
|
|
|
88 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 3, 'scaletimes5')),
|
|
|
89 |
array_combine(array('text', 'type', 'options'), array('howlong', 1, 'howlongoptions')),
|
|
|
90 |
array_combine(array('text', 'type'), array('othercomments', 0)),
|
|
|
91 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls1', 'attls1short', 1, 'scaleagree5')),
|
|
|
92 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls2', 'attls2short', 1, 'scaleagree5')),
|
|
|
93 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls3', 'attls3short', 1, 'scaleagree5')),
|
|
|
94 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls4', 'attls4short', 1, 'scaleagree5')),
|
|
|
95 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls5', 'attls5short', 1, 'scaleagree5')),
|
|
|
96 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls6', 'attls6short', 1, 'scaleagree5')),
|
|
|
97 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls7', 'attls7short', 1, 'scaleagree5')),
|
|
|
98 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls8', 'attls8short', 1, 'scaleagree5')),
|
|
|
99 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls9', 'attls9short', 1, 'scaleagree5')),
|
|
|
100 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls10', 'attls10short', 1, 'scaleagree5')),
|
|
|
101 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls11', 'attls11short', 1, 'scaleagree5')),
|
|
|
102 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls12', 'attls12short', 1, 'scaleagree5')),
|
|
|
103 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls13', 'attls13short', 1, 'scaleagree5')),
|
|
|
104 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls14', 'attls14short', 1, 'scaleagree5')),
|
|
|
105 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls15', 'attls15short', 1, 'scaleagree5')),
|
|
|
106 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls16', 'attls16short', 1, 'scaleagree5')),
|
|
|
107 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls17', 'attls17short', 1, 'scaleagree5')),
|
|
|
108 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls18', 'attls18short', 1, 'scaleagree5')),
|
|
|
109 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls19', 'attls19short', 1, 'scaleagree5')),
|
|
|
110 |
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls20', 'attls20short', 1, 'scaleagree5')),
|
|
|
111 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('attlsm1', 'attlsm1', '45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64', 'attlsmintro', 1, 'scaleagree5')),
|
|
|
112 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('-', '-', '-', '-', 0, '-')),
|
|
|
113 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('attlsm2', 'attlsm2', '63,62,59,57,55,49,52,50,48,47', 'attlsmintro', -1, 'scaleagree5')),
|
|
|
114 |
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('attlsm3', 'attlsm3', '46,54,45,51,60,53,56,58,61,64', 'attlsmintro', -1, 'scaleagree5')),
|
|
|
115 |
array_combine(array('text', 'shorttext', 'type'), array('ciq1', 'ciq1short', 0)),
|
|
|
116 |
array_combine(array('text', 'shorttext', 'type'), array('ciq2', 'ciq2short', 0)),
|
|
|
117 |
array_combine(array('text', 'shorttext', 'type'), array('ciq3', 'ciq3short', 0)),
|
|
|
118 |
array_combine(array('text', 'shorttext', 'type'), array('ciq4', 'ciq4short', 0)),
|
|
|
119 |
array_combine(array('text', 'shorttext', 'type'), array('ciq5', 'ciq5short', 0)),
|
|
|
120 |
);
|
|
|
121 |
foreach ($records as $record) {
|
|
|
122 |
$DB->insert_record('survey_questions', $record, false);
|
|
|
123 |
}
|
|
|
124 |
|
|
|
125 |
}
|