ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
dev.txt.php
Go to the documentation of this file.
1 <?php exit; ?>
2 
3 
4 ## Current behaviour without patch.
5 
6 ### scales doesn't allow 0 values. And this scales are saved with the scale value - 1 in the table "svy_answer"
7 
8 #### Web workflow
9 **As admin:**
10 
11 Repository home -> create new survey, create new page with any of this "Question type":
12 - Multiple Choice Question (Single Response)
13 - Multiple Choice Question (Multiple Response)
14 - Matrix Question
15 
16 **In the answers section:**
17 
18 
19 
20 - Problem:
21 
22 We can put as scale values everything without restrictions. Strings, numbers and symbols are allowed.
23 After pressing the save button we get the success message "Modifications saved."
24 But in the database table "svy_variable" the column scale has "NULL".
25 
26 - Problem:
27 
28 If we go to edit this answer we can see that the javascript filled the Scale with the first number available in the
29 scale values. Therefore we have NULL in the DB and one new number in the edit form.
30 
31 - Observation:
32 
33 Everytime one answer is added, the javascript clones exactly the same row above. Therefore we have to delete the text
34 and scale before write.
35 
36 - Observation:
37 
38 Can't store the value "0"
39 
40 - Observation:
41 
42 Editing the question answers. If we delete one answer with "-" button. In the table "svy_category" this answer remains available.
43 this answer is perfectly deleted in "svy_variable" table.
44 
45  select * from svy_question;
46  +-------------+-----------------+--------+----------+-------------------+-------------+-----------+------------+----------+------------+-------------+------------+---------------------+-------+
47  | question_id | questiontype_fi | obj_fi | owner_fi | title | description | author | obligatory | complete | created | original_id | tstamp | questiontext | label |
48  +-------------+-----------------+--------+----------+-------------------+-------------+-----------+------------+----------+------------+-------------+------------+---------------------+-------+
49  | 50 | 2 | 277 | 6 | My first question | NULL | root user | 1 | 1 | 1475171583 | NULL | 1475174823 | This is my question | NULL |
50  | 51 | 2 | 277 | 6 | NULL | NULL | root user | 1 | 0 | 1475172649 | NULL | 0 | NULL | NULL |
51  | 52 | 2 | 277 | 6 | NULL | NULL | root user | 1 | 0 | 1475174096 | NULL | 0 | NULL | NULL |
52  | 53 | 2 | 277 | 6 | NULL | NULL | root user | 1 | 0 | 1475174194 | NULL | 0 | NULL | NULL |
53  | 54 | 2 | 277 | 6 | NULL | NULL | root user | 1 | 0 | 1475174292 | NULL | 0 | NULL | NULL |
54  | 55 | 2 | 277 | 6 | NULL | NULL | root user | 1 | 0 | 1475175261 | NULL | 0 | NULL | NULL |
55  +-------------+-----------------+--------+----------+-------------------+-------------+-----------+------------+----------+------------+-------------+------------+---------------------+-------+
56  6 rows in set (0.00 sec)
57 
58 
59 **In the Questions page (Drag and drop section)**
60 
61 Only the GUI files are affected:
62 - Modules/SurveyQuestionPool/classes/class.SurveySingleChoiceQuestionGUI.php
63 - Modules/SurveyQuestionPool/classes/class.SurveyMultipleChoiceQuestionGUI.php
64 - Modules/SurveyQuestionPool/classes/class.SurveyMatrixQuestionGUI.php
65 
66 Not affected:
67 - Modules/SurveyQuestionPool/classes/class.SurveySingleChoiceQuestion.php
68 - Modules/SurveyQuestionPool/classes/class.SurveyMultipleChoiceQuestion.php
69 - Modules/SurveyQuestionPool/classes/class.SurveyMatrixQuestion.php
70 
71 Here que can create pages, add from pool etc...
72 
73 - Problem/Observation:
74 
75 Here we are passing to the template, the scale -1. Therefore all the radio buttons, checkboxes will have the scale value as scale -1
76 Also if we need store 0 values this if statement is not valid.
77 
78  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
79 
80 functions affected:
81 
82 - getParsedAnswers
83 - getWorkingForm (horizontal,vertical and combobox options)
84 
85 
86 ## DATABASE TABLES
87 
88 
89 
90 
91 ## EXAMPLE: Table comparation
92 
93 For the "question_fi" 50
94 
95 We have 2 scales, 11 and 22:
96 
97  select * from svy_variable;
98  +-------------+-------------+-------------+--------+--------+----------+------------+-------+-------+
99  | variable_id | category_fi | question_fi | value1 | value2 | sequence | tstamp | other | scale |
100  +-------------+-------------+-------------+--------+--------+----------+------------+-------+-------+
101  | 291 | 123 | 50 | 2 | NULL | 1 | 1475174823 | 0 | 22 |
102  | 290 | 122 | 50 | 1 | NULL | 0 | 1475174823 | 0 | 11 |
103  +-------------+-------------+-------------+--------+--------+----------+------------+-------+-------+
104  2 rows in set (0.00 sec)
105 
106 User answered but the scale is saved as value 10: (scale -1)
107 
108  select * from svy_answer;
109  +-----------+-----------+-------------+-------+------------+----------+------------+
110  | answer_id | active_fi | question_fi | value | textanswer | rowvalue | tstamp |
111  +-----------+-----------+-------------+-------+------------+----------+------------+
112  | 54 | 3 | 50 | 10 | NULL | 0 | 1475178660 |
113  +-----------+-----------+-------------+-------+------------+----------+------------+
114  1 row in set (0.00 sec)
115 
116 
117 
118 ##Tables documentation.
119 
120 
121 * table svy_question (What is the difference between tstamp and created?)
122  * question_id: sequence value -> svy_question_seq (PK)
123  * questiontype_fi: question type -> svy_qtype
124  * obj_fi: survey or survey pool object -> object_data (MUL)
125  * owner_fi: author user -> usr_data and object_data (MUL)
126  * title: question text (MUL)
127  * description:
128  * author:
129  * obligatory:
130  * complete: 1 or 0 depending if the user saved any data
131  * created:
132  * original_id:
133  * tstamp:
134  * questiontext:
135  * label:
136  INSERT: Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php - saveToDb
137  UPDATE: Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php - saveToDb
138  DELETE: Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php - delete
139  UPDATE: Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php - delete
140  UPDATE: Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php - _changeOriginalId
141  INSERT: Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php - createNewQuestion
142  UPDATE: Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php - saveCompletionStatus
143  UPDATE: Modules/Survey/classes/class.ilObjSurvey.php - setObligatoryStates
144  UPDATE: Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php - setObligatoryStates
145 
146 * table svy_category
147  * category_id: sequence value -> svy_category_seq (PK)
148  * title: answer text
149  * defaultvalue: is set to "1" for categories predefined by the system? or for user defined phrases
150  * owner_fi: (MUL)
151  * neutral:
152  * tstamp:
153 
154 
155 * table svy_variable
156  * variable_id: sequence value -> svy_variable_seq (PK)
157  * category_fi: general answer option -> svy_category (MUL)
158  * question_fi: question -> svy_question (MUL)
159  * value1: for metric q: min value
160  * value2: for metric q: max value
161  * sequence: order of the options in the question presentation
162  * other:
163  * scale: scale value (positives or NULL. Here the scale have the real value entered, not scale -1 )
164 
165 * table svy_phrase
166  * phrase_id: sequence value -> svy_phrase_seq (PK)
167  * title: phrase text
168  * defaultvalue:
169  * owner_fi: (MUL)
170  * tstamp:
171 
172 
173 * table svy_phrase_cat
174  * phrase_category_id: sequence value -> svy_phrase_cat_seq (PK)
175  * phrase_fi -> phrase in svy_phrase (MUL)
176  * category_fi -> general answer option in svy_category (MUL)
177  * sequence: order of the options in the question presentation
178  * other:
179  * scale: always NULL?, editing provides only disabled input fields
180 
181 
182 * table svy_qblk
183  * questionblock_id: sequence value -> sv_qblk_seq (PK)
184  * title: block title
185  * show_questiontext: enables to show/hide question texts for questions of the block
186  * owner_fi: (MUL)
187  * tstamp:
188  * show_blocktitle: show/hide title of the block in presentation
189 
190 * table svy_qblk_qst
191  * qblk_qst_id: sequence value -> sv_gblk_qst_seq (PK)
192  * survey_fi: survey -> svy_svy
193  * question_fi: question -> svy_question (could have pointed to svy_svy_qst instead, but does not do)
194  * question_block_fi: block -> svy_qblk
195 
196 * table svy_relation (fixed set of relations, should be moved from table to class constants)
197  * relation_id: sequence value -> sv_relation_seq (PK)
198  * longname: e.g. less
199  * shortname: e.g. <
200  * tstamp:
201 
202 * table svy_constraint
203  * constraint_id: sequence value -> svy_constraint_seq (PK)
204  * question_fi: "source" question -> svy_question (MUL)
205  * relation_fi: relation -> svy_relation (MUL)
206  * value: scale value - 1 !?
207  * conjunction: or/and (but why on this level?)
208 
209 * table svy_qst_constraint
210  * question_constraint_id: sequence value -> svy_qst_constraint_seq (PK)
211  * survey_fi: survey -> svy_svy (MUL)
212  * question_fi: "target" question -> svy_question (MUL)
213  * constraint_fi: constraint definition -> svy_constraint (MUL)
214 
215 * table svy_finished
216  * finished_id: sequence value -> svy_finished_seq (PK)
217  * survey_fi: survey -> svy_svy (MUL)
218  * user_fi: user -> usr_data (and object_data)(MUL)
219  * anonymous_id: (MUL)
220  * state: 1 if finished? 0 otherwise?
221  * lastpage:
222  * appr_id:
223 
224 *table svy_material
225  * material_id: sequence value -> svy_material_seq (PK)
226  * question_fi: question -> svy_question (MUL)
227  * internal_link:
228  * import_id:
229  * material_title:
230  * tstamp:
231  * text_material:
232  * external_link:
233  * file material:
234  * material_type:
235 
236 * table svy_qst_metric
237  * question_fi: question -> sv_question (PK)
238  * subtype: default 3
239 
240 * table svy_times
241  * id: sequence value -> svy_times_seq (PK)
242  * finished_fi: survey run -> svy_finished (MUL)
243  * first_question: first question id of page/block -> svy_question (does not seem to point to svy_svy_qst)
244  * entered_page: timestamp when page has been rendered
245  * left_page: timestamp when answers of page have been saved
246 
247 * table svy_answer
248  * answer_id: sequence value -> svy_answer_seq (PK)
249  * active_fi: survey run -> svy_finished
250  * question_fi: question -> svy_question (does not point to svy_svy_qst)
251  * value: scale value of corresponding "variable" -1?
252  * textanswer:
253  * rowvalue:
254  * tstamp:
255 
256 * table svy_qst_sc
257  * question_fi: question -> svy_question (PK)
258  * orientation: horizontal, vertial or combobox
259 
260 * table svy_qst_mc
261  * question_fi: question -> svy_question (PK)
262  * orientation: horizontal, vertial
263  * nr_min_answers:
264  * nr_max_answers:
265 
266 * table svy_qst_matrix
267  * question_fi: question -> svy_question (PK)
268  * subtype
269  * column_separators
270  * row_separators
271  * neutral_column_separator
272  * column_placeholders
273  * legend
274  * singleline_row_caption
275  * repeat_column_header
276  * column_header_position
277  * random_rows
278  * column_order
279  * column_images
280  * row_images
281  * bipolar_adjective1
282  * bipolar_adjective2
283  * layout
284  * tstamp
285 
286 *table svy_qst_matrix_rows
287  * id_svy_qst_matrixrows: sequence value -> svy_qst_matrix_rows_seq (PK)
288  * title
289  * sequence
290  * question_fi: question -> svy_question (MUL)
291  * other
292  * label
293 
294 * table svy_qpl
295  * id_questionpool: sequence value -> svy_qpl_seq (PK)
296  * obj_fi: (MUL)
297  * isonline:
298  * tstamp
299 
300 * table svy_inv_usr
301  * invited_user_id: sequence value -> svy_inv_usr_seq (PK)
302  * survey_fi: survey -> svy_svy (MUL)
303  * user_fi: user -> usr_data (MUL)
304  * tstamp
305 
306 * table svy_qst_text
307  * question_fi: question -> svy_question (PK)
308  * maxchars:
309  * width:
310  * height:
311 
312 * table svy_anonymous:
313  * anonymous_id: sequence value -> svy_anonymous_seq (PK)
314  * survey_key:
315  * survey_fi: survey -> svy_svy
316  * user_key:
317  * tstamp:
318  * externaldata:
319  * sent:
success()
Definition: success.php:2
has(string $class_name)
create()
create
exit
Definition: dev.txt.php:1