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