ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
dev.txt.php
Go to the documentation of this file.
1 <?php exit; ?>
2 ## Main changes 5.3
3 
4 New DB table exc_ass_file_order with columns id,assignment_id,filename,order_nr
5 
6 ### File organisation 5.3
7 #### data/*client* directory
8 
9 ilExercise/X/exc_*EXC_ID*/feedb_*ASS_ID*/0/ holds sample solution file (with original name)
10 ilExercise/X/exc_*EXC_ID*/feedb_*ASS_ID*/*USER_ID*/ holds evaluation/feedback files from tutors for learner *USER_ID*
11 ilExercise/X/exc_*EXC_ID*/subm_*ASS_ID*/*USER_ID*/*TIMESTAMP*_filename.pdf holds file submissions (also blogs and porfilios, filename = obj_id)
12 ilExercise/X/exc_*EXC_ID*/peer_up_*ASS_ID*/*TAKER_ID*/*GIVER_ID*/*CRIT_ID*/ holds peer feedback file (original name)
13 ilExercise/X/exc_*EXC_ID*/mfb_up_*ASS_ID*/*UPLOADER_ID*/ hold multi-feedback zip file/structure from tutor *UPLOADER_ID*
14 ilExercise/X/exc_*EXC_ID*/tmp_*ASS_ID*/ temp dir for "download all assignments" process (creates random subdir before starting)
15 
16 #### webdata/*client* directory
17 
18 ilExercise/X/exc_*EXC_ID*/ass_*ASS_ID*/ directory holds all instruction files (with original names) !!! CHANGED in 5.3
19 
20 
21 ### File organisation 5.2
22 
23 #### data/*client* directory
24 
25 ilExercise/X/exc_*EXC_ID*/ass_*ASS_ID*/ directory holds all instruction files (with original names)
26 ilExercise/X/exc_*EXC_ID*/feedb_*ASS_ID*/0/ holds sample solution file (with original name)
27 ilExercise/X/exc_*EXC_ID*/feedb_*ASS_ID*/*USER_ID*/ holds evaluation/feedback files from tutors for learner *USER_ID*
28 ilExercise/X/exc_*EXC_ID*/subm_*ASS_ID*/*USER_ID*/*TIMESTAMP*_filename.pdf holds file submissions (also blogs and porfilios, filename = obj_id)
29 ilExercise/X/exc_*EXC_ID*/peer_up_*ASS_ID*/*TAKER_ID*/*GIVER_ID*/*CRIT_ID*/ holds peer feedback file (original name)
30 ilExercise/X/exc_*EXC_ID*/mfb_up_*ASS_ID*/*UPLOADER_ID*/ hold multi-feedback zip file/structure from tutor *UPLOADER_ID*
31 ilExercise/X/exc_*EXC_ID*/tmp_*ASS_ID*/ temp dir for "download all assignments" process (creates random subdir before starting)
32 
33 #### webdata/*client* directory
34 
35 not used in 5.2
36 
37 
38 #### 7/3/2017 INSTRUCTION FILES - DISPLAYED IN VIEW MODE
39 
40 ## MIGRATION
41 #### Instruction Files migration from outside ILIAS directory to ILIAS "data" directory
42 
43 File -> **patch_exc_move_instruction_files.php**
44 
45 I assume that all the files located in "ass_XXX" --> outside ilias /outside_data_directory/client_name/ilExercise/X/exc_XXX/ass_XXX/0
46 are instruction files.
47 
48 We had doubts about where are the solution files located and this files are located in directories like this: feedb_xx/0/xxxx.xx
49 
50 So The patch moves all the content in ass_ directories.
51 
52 
53 ## FEATURE IMPLEMENTATION
54 Save and show instruction files located inside root directory instead of outside data directory.
55 
56  - (edit) **include/inc.ilias_version.php** change ILIAS version
57 
58  define("ILIAS_VERSION", "5.3.0 2017-02-07");
59  define("ILIAS_VERSION_NUMERIC", "5.3.0");
60 
61  - (new class) **Modules/Exercise/classes/class.ilFSWebStorageExercise.php** extending ilFileSystemStorage class.
62  Stores the files inside ILIAS data directory.
63  important to know, in the construct:
64 
65  parent::__construct(self::STORAGE_WEB,true,$a_container_id);
66 
67 
68  - (edit) **Modules/Exercise/classes/class.ilExerciseExporter.php**
69 
70  - (edit)**getValidSchemaVersions()** method: Add new ILIAS version
71 
72  "5.2.0" => array(
73  "namespace" => "http://www.ilias.de/Modules/Exercise/exc/5_2",
74  "xsd_file" => "ilias_exc_5_2.xsd",
75  "uses_dataset" => true,
76  "min" => "5.2.0",
77  "max" => "5.2.99"),
78  "5.3.0" => array(
79  "namespace" => "http://www.ilias.de/Modules/Exercise/exc/5_3",
80  "xsd_file" => "ilias_exc_5_3.xsd",
81  "uses_dataset" => true,
82  "min" => "5.3.0",
83  "max" => "")
84 
85  - (edit) **Modules/Exercise/classes/class.ilExerciseDataSet.php**
86 
87  - (edit) **getSupportedVersions()** method: Add new ILIAS version
88 
89  return array("4.1.0", "4.4.0", "5.0.0", "5.1.0", "5.2.0", "5.3.0");
90 
91  - (edit) **getTypes()** method: Add new ILIAS version, with same code as 5.2
92 
93  if ($a_entity == "exc")
94  {
95  switch ($a_version)
96  {
97  ...
98  case "5.2.0":
99  case "5.3.0":
100  ...
101  ...
102  ...
103 
104 
105  if ($a_entity == "exc_assignment")
106  {
107  switch ($a_version)
108  {
109  case "5.3.0": //same as 5.2.0 + add WebDataDir
110  return array(
111  ...
112 
113  "WebDataDir" => "directory"
114 
115  ...
116  );
117  ...
118 
119  - (edit) **readData()** method: Add the ILIAS version. Same code as 5.2
120 
121  ...
122  case "5.2.0":
123  case "5.3.0":
124  ...
125 
126  - (edit) **getXmlRecord** method: store the setWebDataDir path.
127 
128  //now the instruction files inside the root directory
129  include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
130  $fswebstorage = new ilFSWebStorageExercise($a_set['ExerciseId'], $a_set['Id']);
131  $a_set['WebDataDir'] = $fswebstorage->getPath();
132 
133  - (edit) **importRecord()** method: instruction files into web data dir., all the others are stored as always.
134  we were talking about if $a_rec["WebDataDir"] use one class, else the other one. But both are needed.
135  - ilFSWebStorageExercise for instruction files.
136  - ilFSStorageExercise for all the other files.
137 
138  // (5.3) assignment files inside ILIAS
139  include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
140  $fwebstorage = new ilFSWebStorageExercise($exc_id, $ass->getId());
141  $fwebstorage->create();
142  $dir = str_replace("..", "", $a_rec["WebDataDir"]);
143  if ($dir != "" && $this->getImportDirectory() != "")
144  {
145  $source_dir = $this->getImportDirectory()."/".$dir;
146  $target_dir = $fwebstorage->getPath();
147  ilUtil::rCopy($source_dir, $target_dir);
148  }
149 
150  - (edit) **Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php**
151 
152  - (edit) **executeCommand** method: case ilfilesystemgui: use ilFSWebStorageExercise instead of ilFSStorageExercise
153 
154  include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
155  $fWebStorage = new ilFSWebStorageExercise($this->exercise_id, $this->assignment->getId());
156  $fWebStorage->create();
157 
158  - (edit) **Modules/Exercise/classes/class.ilExAssignment.php**
159 
160  - (edit) **getFiles()** method: ilFSWebStorageExercise instead of ilFSStorageExercise
161 
162  - (edit) **uploadAssignmentFiles()** method: ilFSWebStorageExercise instead of ilFSStorageExercise
163 
164 
165  - (edit) **Modules/Exercise/classes/class.ilExAssignmentGUI.php**
166 
167  - (edit) **addFiles()** method: Represent the files depending of its type
168 
169  - (edit) **addSubmissionFeedback()** method: include the new class.
170 
171  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
172 
173 
174 
175 ## MANTIS BUG :0019795
176 It is not possible to remove files from a peer feedback from a exercise.
177 
178 
179 The problem seems the file path creation and affects both feedback with and without criteria.
180 
181 Example:
182 User ID who did the exercise: 310
183 User ID who provide feedback: 6
184 Feedback file: feedback.txt
185 Criteria ID = 10
186 
187 Without criteria the uploaded files are stored outside the final path. The name of the file is also affected.
188 
189 data/client/ilExercise/3/exc_343/peer_up_15/310/6/ [empty directory]
190 data/client/ilExercise/3/exc_343/peer_up_15/310/6feedback.txt
191 
192 After patch:
193 
194 data/client/ilExercise/3/exc_343/peer_up_15/310/6/feedback.txt
195 
196 
197 With criteria, the final directory name is userid+criteriaid instead of criteria id.
198 
199 data/client/ilExercise/3/exc_343/peer_up_15/310/610/feedback.txt
200 
201 After patch:
202 
203 data/client/ilExercise/3/exc_343/peer_up_15/310/6/10/feedback.txt
204 
205 ## We need to take a look at how to proceed with the migration of the old directories/files.
206 
207 
208 
209 - Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php
210 working with ilExAssignmentFileSystemGUI instead of ilFileSystemGUI
211 
212 
213 - Modules/Exercise/classes/class.ilExAssignment.php (create another class for this stuff could be fine)
214 Edit function saveAssOrderOfExercise -- now is static ( fixing another bug )
215 New function saveInstructionFilesOrderOfAssignment (db update)
216 New function instructionFileInsertOrder (db store)
217 New function instructionFileDeleteOrder (db delete)
218 New function renameInstructionFile (db delete/update)
219 New function instructionFileExistsInDb (db query)
220 New function instructionFileAddOrder: DB query and add order to an array previous to setData in the view rows. If the files doesn't have any previous order in the database
221  this method will create it so we don't need any patch for the current installations and for the unziping files neither. See instructionFileGetFileOrderData method.
222 
223 New function instructionFileOrderGetMax (db query, max order)
224 New function instructionFileRearrangeOrder rebuild the order after deletion. example: 10,30,50 will show 10,20,30
225 New function renameExecutables (names with extensions like php,php3,inc,lang... will be renamed (.sec) after store it in db) //have we another method that renames the extension files in db?
226 New function instructionFileGetFileOrderData (db query returns order values.)
227 
228 
229 
230 - Services/FileSystem/classes/class.ilFileSystemGUI.php
231 Edit Construct commands available are now in the defineCommands method.
232 Edit ListFiles now can get class name as a param, to use one ilFileSystemTableGUI as always or another.
233 New function defineCommands define which commands are available.
234 New function getActionCommands returns the commands array.
235 
236 
237 - Services/FileSystem/classes/class.ilFileSystemTableGUI.php
238 Edit contructor using the new method addColumns.
239 Edit function prepareOutput, take an array from getEntries and if the method instructionFileAddOrder exists then
240 the order values are added to the array.
241 Edit function getEntries, now doesn't setData, only returns the array to work with.
242 New function addColumns, check if the property add_order_column from a child class exists and add the proper columns.
243 Edit function fillRow, check if the property add_order_column from a child class exists and add set the tpl vars.
244 
245 
246 
247 - Services/FileSystem/templates/default/tpl.directory_row.html
248 New block: Order
249 
250 - (NEW FILE) Modules/Exercise/classes/class.ilExAssignmentFileSystemGUI.php
251 Extends Services/FileSystem/classes/class.ilFileSystemGUI.php
252 - (NEW FILE) Modules/Exercise/classes/class.ilExAssignmentFileSystemTableGUI.php
253 Extends Services/FileSystem/classes/class.ilFileSystemTableGUI.php
254 
255 
256 ## Things to take care.
257 If an assignment is deleted, we should delete the filenames from exc_ass_file_order table.
258 We are working with this files in the DB with "filename" instead of "id"
259 
260 
261 ## 2/2/2017
262 
263 *Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php (User perspective)
264 
265  -(change) method "getOverviewContentPortfolio"
266  Button create portfolio in assignment calls now "createPortfolioFromAssignmentObject" instead of getting the templates and createPortfolio.
267  If this assignment has one previous submission, one new button are shown to unlink this portfolio/submission (method askUnlinkPortfolio).
268 
269  *** Here imo we should delete the button for portfolio selection. Because the portfolio is not defined here.
270 
271 -(new) method "askUnlinkPortfolioObject"
272  Confirmation for unlink portfolio/assignment.
273 
274 -(new) method "unlinkPortfolioObject"
275  Delete the portfolio from the assignment.
276 
277 -(new) method "createPortfolioFromAssignmentObject"
278  Check portfolio templates available and check if this assignment has port. template.
279  Takes the values from the exercise, assignment, portfolio and portfolio template and set the proper parameters.
280  Redirects to createPortfolioFromAssignment in ilObjPortfolioGUI.
281 
282 
283 *Modules/Portfolio/classes/class.ilObjPortfolioGUI.php (assignment submission)
284 
285 -(new) method "createPortfolioFromAssignment" to create portfolios from assignments without cross any form
286  check again the templates
287  getAllPortfolioPages and get blogs as well.
288  create new portfolio and clone pages and blogs from the template.
289  link the portfolio to the assignment.
290 
291 -(new) method "linkPortfolioToAssignment"
292  Add the portfolio to an assignment
293 
294 -(change) method "createPortfolioFromTemplateProcess"
295  now the part related with the portfolio assignment is in linkPortfolioToAssignment method.
296 
297 -(change) initCreatePortfolioFormTemplate
298  all the skills stuff moved to getSkillsToPortfolioAssignment method.
299 
300 -(new) method getSkillsToPortfolioAssignment
301  returns the skills to be added in the assignment.
302 
303 *Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php
304 
305 -(change) @ilCrl Calls also ilPropertyFormGUI class
306 
307 -(change) method "executeCommand"
308  new case "ilpropertyformgui" needed for ilRepositorySelector2 when selection of portfolio template is needed.
309 
310 -(change) method "initAssignmentForm"
311  new portfolio feature. radiobuttons + ilrepositoryselector2 to predefine a default portfolio template for this assignment.
312  improved the order of the form elements + added section headers.
313 
314 -(change) method "processForm"
315  now gets the template input from the form.
316 
317 -(change) method "importFormToAssignment"
318  sets the portfolio template id.
319 
320 -(change) method "getAssignmentValues"
321  takes the portfolio template id
322 
323 *Modules/Exercise/classes/class.ilExAssignmentGUI.php
324 just ordering ui elements
325 
326 *Modules/Exercise/classes/class.ilExSubmissionFileGUI.
327 -(change) method "getOverviewContent"
328 list files one below another instead of separated by coma.
329 
330 
331 
332 ##28/2/17
333 
334 ## ilTextareaInput - MIN and MAX CHARACTER LIMITATIONS.
335 
336 Textarea input now can limit the number of characters allowed. The limitations are not mandatory, for instance we can limit only min or max.
337 
338 ## Info to extend this feature to another elements taking exercise assignments as an example.
339 
340 #### DATABASE
341 
342  update table [X] with 2 new columns "min_char_limit" and "max_char_limit" both integer and length 4.
343 
344  if($ilDB->tableExists("[table_name]"))
345  {
346  if(!$ilDB->tableColumnExists('[table_name]','min_char_limit'))
347  {
348  $ilDB->addTableColumn("[table_name]", "min_char_limit", array("type" => "integer", "length" => 4));
349  }
350  if(!$ilDB->tableColumnExists('[table_name]','max_char_limit'))
351  {
352  $ilDB->addTableColumn("[table_name]", "max_char_limit", array("type" => "integer", "length" => 4));
353  }
354  }
355 
356 e.g. table used in exercise assignments -> "exc_assignment"
357 
358 
359 #### FORM (admin - creation/configuration)
360 
361 Getting exercise assignments as an example (Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php)
362 
363 Add the fields - method -> initAssignmentForm()
364 
365  $rb_limit_chars = new ilCheckboxInputGUI($lng->txt("exc_limit_characters"),"limit_characters");
366 
367  $min_char_limit = new ilNumberInputGUI($lng->txt("exc_min_char_limit"), "min_char_limit");
368  $min_char_limit->allowDecimals(false);
369  $min_char_limit->setSize(3);
370 
371  $max_char_limit = new ilNumberInputGUI($lng->txt("exc_max_char_limit"), "max_char_limit");
372  $max_char_limit->allowDecimals(false);
373  $max_char_limit->setMinValue($_POST['min_char_limit'] + 1);
374 
375  $max_char_limit->setSize(3);
376 
377  $rb_limit_chars->addSubItem($min_char_limit);
378  $rb_limit_chars->addSubItem($max_char_limit);
379 
380  $form->addItem($rb_limit_chars);
381 
382 
383 Manage data/inputs
384 
385 method -> processForm()
386 
387  ...
388  // text limitations
389  if($a_form->getInput("limit_characters"))
390  {
391  $res['limit_characters'] = $a_form->getInput("limit_characters");
392  }
393  if($a_form->getInput("limit_characters") && $a_form->getInput("max_char_limit"))
394  {
395  $res['max_char_limit'] = $a_form->getInput("max_char_limit");
396  }
397  if($a_form->getInput("limit_characters") && $a_form->getInput("min_char_limit"))
398  {
399  $res['min_char_limit'] = $a_form->getInput("min_char_limit");
400 
401  }
402  ...
403 
404 
405 method -> importFormToAssignment()
406 
407  $a_ass->setMinCharLimit($a_input['min_char_limit']);
408  $a_ass->setMaxCharLimit($a_input['max_char_limit']);
409 
410 
411 method -> getAssignmentValues()
412 
413  if($this->assignment->getMinCharLimit())
414  {
415  $values['limit_characters'] = 1;
416  $values['min_char_limit'] = $this->assignment->getMinCharLimit();
417  }
418  if($this->assignment->getMaxCharLimit())
419  {
420  $values['limit_characters'] = 1;
421  $values['max_char_limit'] = $this->assignment->getMaxCharLimit();
422  }
423 
424 
425 #### MODEL class(admin - creation/configuration)
426 
427 Getting exercise assignments as an example (Modules/Exercise/classes/class.ilExAssignment.php)
428 
429 properties
430 
431  protected $min_char_limit;
432  protected $max_char_limit;
433 
434 method -> initFromDB()
435 
436  ...
437  $this->setMinCharLimit($a_set["min_char_limit"]);
438  $this->setMaxCharLimit($a_set["max_char_limit"]);
439 
440 method -> save()
441 
442  $ilDB->insert("[table_name", array(...
443  "min_char_limit" => array("integer", $this->getMinCharLimit()),
444  "max_char_limit" => array("integer", $this->getMaxCharLimit())
445 
446 method -> update()
447 
448  $ilDB->update("[table_name",array(...
449  "min_char_limit" => array("integer", $this->getMinCharLimit()),
450  "max_char_limit" => array("integer", $this->getMaxCharLimit())
451 
452 
453 setters and getters
454 
460  function setMinCharLimit($a_val)
461  {
462  $this->min_char_limit = $a_val;
463  }
464 
470  function getMinCharLimit()
471  {
472  return $this->min_char_limit;
473  }
474 
479  function setMaxCharLimit($a_val)
480  {
481  $this->max_char_limit = $a_val;
482  }
483 
488  function getMaxCharLimit()
489  {
490  return $this->max_char_limit;
491  }
492 
493 
494 #### Public user part. (users doing exercises etc.)
495 
496 getting exercise submission as an example (Modules/Exercise/classes/class.ilExSubmissionTextGUI.php)
497 
498 Init the form - method -> initAssignmentTextForm()
499 Set max and min limit values
500 add a setInfo element with the limits explanation.
501 
502  ...
503  if(!$a_read_only)
504  {...
505 
506 $text->setMaxNumOfChars($this->assignment->getMaxCharLimit());
507 $text->setMinNumOfChars($this->assignment->getMinCharLimit());
508 
509  if ($text->isCharLimited())
510  {
511  $char_msg = $lng->txt("exc_min_char_limit").": ".$this->assignment->getMinCharLimit().
512  " ".$lng->txt("exc_max_char_limit").": ".$this->assignment->getMaxCharLimit();
513 
514  $text->setInfo($char_msg);
515  }...
516 
517 if you want to remove the "HTML" button in your TinyMCE, just add "code" in this array.
518 
519  $text->disableButtons(array(
520  'charmap',
521  'undo',
522  'redo',
523  'justifyleft',
524  'justifycenter',
525  'justifyright',
526  'justifyfull',
527  'anchor',
528  'fullscreen',
529  'cut',
530  'copy',
531  'paste',
532  'pastetext',
533  'code',
534  // 'formatselect' #13234
535  ));
exit
Definition: dev.txt.php:1
Play around with inserting and removing rows and columns
Reload workbook from saved file
Done writing files