ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
8Current 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
19New 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
24ilExercise/X/exc_*EXC_ID*/feedb_*ASS_ID*/0/ holds sample solution file (with original name)
25ilExercise/X/exc_*EXC_ID*/feedb_*ASS_ID*/*USER_ID*/ holds evaluation/feedback files from tutors for learner *USER_ID*
26ilExercise/X/exc_*EXC_ID*/subm_*ASS_ID*/*USER_ID*/*TIMESTAMP*_filename.pdf holds file submissions (also blogs and porfilios, filename = obj_id)
27ilExercise/X/exc_*EXC_ID*/peer_up_*ASS_ID*/*TAKER_ID*/*GIVER_ID*/*CRIT_ID*/ holds peer feedback file (original name)
28ilExercise/X/exc_*EXC_ID*/mfb_up_*ASS_ID*/*UPLOADER_ID*/ hold multi-feedback zip file/structure from tutor *UPLOADER_ID*
29ilExercise/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
33ilExercise/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
40ilExercise/X/exc_*EXC_ID*/ass_*ASS_ID*/ directory holds all instruction files (with original names)
41ilExercise/X/exc_*EXC_ID*/feedb_*ASS_ID*/0/ holds sample solution file (with original name)
42ilExercise/X/exc_*EXC_ID*/feedb_*ASS_ID*/*USER_ID*/ holds evaluation/feedback files from tutors for learner *USER_ID*
43ilExercise/X/exc_*EXC_ID*/subm_*ASS_ID*/*USER_ID*/*TIMESTAMP*_filename.pdf holds file submissions (also blogs and porfilios, filename = obj_id)
44ilExercise/X/exc_*EXC_ID*/peer_up_*ASS_ID*/*TAKER_ID*/*GIVER_ID*/*CRIT_ID*/ holds peer feedback file (original name)
45ilExercise/X/exc_*EXC_ID*/mfb_up_*ASS_ID*/*UPLOADER_ID*/ hold multi-feedback zip file/structure from tutor *UPLOADER_ID*
46ilExercise/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
50not 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
58File -> **patch_exc_move_instruction_files.php**
59
60I assume that all the files located in "ass_XXX" --> outside ilias /outside_data_directory/client_name/ilExercise/X/exc_XXX/ass_XXX/0
61are instruction files.
62
63We had doubts about where are the solution files located and this files are located in directories like this: feedb_xx/0/xxxx.xx
64
65So The patch moves all the content in ass_ directories.
66
67
68## FEATURE IMPLEMENTATION
69Save 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 include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
145 $fswebstorage = new ilFSWebStorageExercise($a_set['ExerciseId'], $a_set['Id']);
146 $a_set['WebDataDir'] = $fswebstorage->getPath();
147
148 - (edit) **importRecord()** method: instruction files into web data dir., all the others are stored as always.
149 we were talking about if $a_rec["WebDataDir"] use one class, else the other one. But both are needed.
150 - ilFSWebStorageExercise for instruction files.
151 - ilFSStorageExercise for all the other files.
152
153 // (5.3) assignment files inside ILIAS
154 include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
155 $fwebstorage = new ilFSWebStorageExercise($exc_id, $ass->getId());
156 $fwebstorage->create();
157 $dir = str_replace("..", "", $a_rec["WebDataDir"]);
158 if ($dir != "" && $this->getImportDirectory() != "")
159 {
160 $source_dir = $this->getImportDirectory()."/".$dir;
161 $target_dir = $fwebstorage->getPath();
162 ilUtil::rCopy($source_dir, $target_dir);
163 }
164
165 - (edit) **Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php**
166
167 - (edit) **executeCommand** method: case ilfilesystemgui: use ilFSWebStorageExercise instead of ilFSStorageExercise
168
169 include_once("./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
170 $fWebStorage = new ilFSWebStorageExercise($this->exercise_id, $this->assignment->getId());
171 $fWebStorage->create();
172
173 - (edit) **Modules/Exercise/classes/class.ilExAssignment.php**
174
175 - (edit) **getFiles()** method: ilFSWebStorageExercise instead of ilFSStorageExercise
176
177 - (edit) **uploadAssignmentFiles()** method: ilFSWebStorageExercise instead of ilFSStorageExercise
178
179
180 - (edit) **Modules/Exercise/classes/class.ilExAssignmentGUI.php**
181
182 - (edit) **addFiles()** method: Represent the files depending of its type
183
184 - (edit) **addSubmissionFeedback()** method: include the new class.
185
186 include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
187
188
189
190## MANTIS BUG :0019795
191It is not possible to remove files from a peer feedback from a exercise.
192
193
194The problem seems the file path creation and affects both feedback with and without criteria.
195
196Example:
197User ID who did the exercise: 310
198User ID who provide feedback: 6
199Feedback file: feedback.txt
200Criteria ID = 10
201
202Without criteria the uploaded files are stored outside the final path. The name of the file is also affected.
203
204data/client/ilExercise/3/exc_343/peer_up_15/310/6/ [empty directory]
205data/client/ilExercise/3/exc_343/peer_up_15/310/6feedback.txt
206
207After patch:
208
209data/client/ilExercise/3/exc_343/peer_up_15/310/6/feedback.txt
210
211
212With criteria, the final directory name is userid+criteriaid instead of criteria id.
213
214data/client/ilExercise/3/exc_343/peer_up_15/310/610/feedback.txt
215
216After patch:
217
218data/client/ilExercise/3/exc_343/peer_up_15/310/6/10/feedback.txt
219
220## We need to take a look at how to proceed with the migration of the old directories/files.
221
222
223
224- Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php
225working with ilExAssignmentFileSystemGUI instead of ilFileSystemGUI
226
227
228- Modules/Exercise/classes/class.ilExAssignment.php (create another class for this stuff could be fine)
229Edit function saveAssOrderOfExercise -- now is static ( fixing another bug )
230New function saveInstructionFilesOrderOfAssignment (db update)
231New function instructionFileInsertOrder (db store)
232New function instructionFileDeleteOrder (db delete)
233New function renameInstructionFile (db delete/update)
234New function instructionFileExistsInDb (db query)
235New 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
236 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.
237
238New function instructionFileOrderGetMax (db query, max order)
239New function instructionFileRearrangeOrder rebuild the order after deletion. example: 10,30,50 will show 10,20,30
240New 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?
241New function instructionFileGetFileOrderData (db query returns order values.)
242
243
244
245- Services/FileSystem/classes/class.ilFileSystemGUI.php
246Edit Construct commands available are now in the defineCommands method.
247Edit ListFiles now can get class name as a param, to use one ilFileSystemTableGUI as always or another.
248New function defineCommands define which commands are available.
249New function getActionCommands returns the commands array.
250
251
252- Services/FileSystem/classes/class.ilFileSystemTableGUI.php
253Edit contructor using the new method addColumns.
254Edit function prepareOutput, take an array from getEntries and if the method instructionFileAddOrder exists then
255the order values are added to the array.
256Edit function getEntries, now doesn't setData, only returns the array to work with.
257New function addColumns, check if the property add_order_column from a child class exists and add the proper columns.
258Edit function fillRow, check if the property add_order_column from a child class exists and add set the tpl vars.
259
260
261
262- Services/FileSystem/templates/default/tpl.directory_row.html
263New block: Order
264
265- (NEW FILE) Modules/Exercise/classes/class.ilExAssignmentFileSystemGUI.php
266Extends Services/FileSystem/classes/class.ilFileSystemGUI.php
267- (NEW FILE) Modules/Exercise/classes/class.ilExAssignmentFileSystemTableGUI.php
268Extends Services/FileSystem/classes/class.ilFileSystemTableGUI.php
269
270
271## Things to take care.
272If an assignment is deleted, we should delete the filenames from exc_ass_file_order table.
273We are working with this files in the DB with "filename" instead of "id"
274
275
276## 2/2/2017
277
278*Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php (User perspective)
279
280 -(change) method "getOverviewContentPortfolio"
281 Button create portfolio in assignment calls now "createPortfolioFromAssignmentObject" instead of getting the templates and createPortfolio.
282 If this assignment has one previous submission, one new button are shown to unlink this portfolio/submission (method askUnlinkPortfolio).
283
284 *** Here imo we should delete the button for portfolio selection. Because the portfolio is not defined here.
285
286-(new) method "askUnlinkPortfolioObject"
287 Confirmation for unlink portfolio/assignment.
288
289-(new) method "unlinkPortfolioObject"
290 Delete the portfolio from the assignment.
291
292-(new) method "createPortfolioFromAssignmentObject"
293 Check portfolio templates available and check if this assignment has port. template.
294 Takes the values from the exercise, assignment, portfolio and portfolio template and set the proper parameters.
295 Redirects to createPortfolioFromAssignment in ilObjPortfolioGUI.
296
297
298*Modules/Portfolio/classes/class.ilObjPortfolioGUI.php (assignment submission)
299
300-(new) method "createPortfolioFromAssignment" to create portfolios from assignments without cross any form
301 check again the templates
302 getAllPortfolioPages and get blogs as well.
303 create new portfolio and clone pages and blogs from the template.
304 link the portfolio to the assignment.
305
306-(new) method "linkPortfolioToAssignment"
307 Add the portfolio to an assignment
308
309-(change) method "createPortfolioFromTemplateProcess"
310 now the part related with the portfolio assignment is in linkPortfolioToAssignment method.
311
312-(change) initCreatePortfolioFormTemplate
313 all the skills stuff moved to getSkillsToPortfolioAssignment method.
314
315-(new) method getSkillsToPortfolioAssignment
316 returns the skills to be added in the assignment.
317
318*Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php
319
320-(change) @ilCrl Calls also ilPropertyFormGUI class
321
322-(change) method "executeCommand"
323 new case "ilpropertyformgui" needed for ilRepositorySelector2 when selection of portfolio template is needed.
324
325-(change) method "initAssignmentForm"
326 new portfolio feature. radiobuttons + ilrepositoryselector2 to predefine a default portfolio template for this assignment.
327 improved the order of the form elements + added section headers.
328
329-(change) method "processForm"
330 now gets the template input from the form.
331
332-(change) method "importFormToAssignment"
333 sets the portfolio template id.
334
335-(change) method "getAssignmentValues"
336 takes the portfolio template id
337
338*Modules/Exercise/classes/class.ilExAssignmentGUI.php
339just ordering ui elements
340
341*Modules/Exercise/classes/class.ilExSubmissionFileGUI.
342-(change) method "getOverviewContent"
343list files one below another instead of separated by coma.
344
345
346
347##28/2/17
348
349## ilTextareaInput - MIN and MAX CHARACTER LIMITATIONS.
350
351Textarea input now can limit the number of characters allowed. The limitations are not mandatory, for instance we can limit only min or max.
352
353## Info to extend this feature to another elements taking exercise assignments as an example.
354
355#### DATABASE
356
357 update table [X] with 2 new columns "min_char_limit" and "max_char_limit" both integer and length 4.
358
359 if($ilDB->tableExists("[table_name]"))
360 {
361 if(!$ilDB->tableColumnExists('[table_name]','min_char_limit'))
362 {
363 $ilDB->addTableColumn("[table_name]", "min_char_limit", array("type" => "integer", "length" => 4));
364 }
365 if(!$ilDB->tableColumnExists('[table_name]','max_char_limit'))
366 {
367 $ilDB->addTableColumn("[table_name]", "max_char_limit", array("type" => "integer", "length" => 4));
368 }
369 }
370
371e.g. table used in exercise assignments -> "exc_assignment"
372
373
374#### FORM (admin - creation/configuration)
375
376Getting exercise assignments as an example (Modules/Exercise/classes/class.ilExAssignmentEditorGUI.php)
377
378Add the fields - method -> initAssignmentForm()
379
380 $rb_limit_chars = new ilCheckboxInputGUI($lng->txt("exc_limit_characters"),"limit_characters");
381
382 $min_char_limit = new ilNumberInputGUI($lng->txt("exc_min_char_limit"), "min_char_limit");
383 $min_char_limit->allowDecimals(false);
384 $min_char_limit->setSize(3);
385
386 $max_char_limit = new ilNumberInputGUI($lng->txt("exc_max_char_limit"), "max_char_limit");
387 $max_char_limit->allowDecimals(false);
388 $max_char_limit->setMinValue($_POST['min_char_limit'] + 1);
389
390 $max_char_limit->setSize(3);
391
392 $rb_limit_chars->addSubItem($min_char_limit);
393 $rb_limit_chars->addSubItem($max_char_limit);
394
395 $form->addItem($rb_limit_chars);
396
397
398Manage data/inputs
399
400method -> processForm()
401
402 ...
403 // text limitations
404 if($a_form->getInput("limit_characters"))
405 {
406 $res['limit_characters'] = $a_form->getInput("limit_characters");
407 }
408 if($a_form->getInput("limit_characters") && $a_form->getInput("max_char_limit"))
409 {
410 $res['max_char_limit'] = $a_form->getInput("max_char_limit");
411 }
412 if($a_form->getInput("limit_characters") && $a_form->getInput("min_char_limit"))
413 {
414 $res['min_char_limit'] = $a_form->getInput("min_char_limit");
415
416 }
417 ...
418
419
420method -> importFormToAssignment()
421
422 $a_ass->setMinCharLimit($a_input['min_char_limit']);
423 $a_ass->setMaxCharLimit($a_input['max_char_limit']);
424
425
426method -> getAssignmentValues()
427
428 if($this->assignment->getMinCharLimit())
429 {
430 $values['limit_characters'] = 1;
431 $values['min_char_limit'] = $this->assignment->getMinCharLimit();
432 }
433 if($this->assignment->getMaxCharLimit())
434 {
435 $values['limit_characters'] = 1;
436 $values['max_char_limit'] = $this->assignment->getMaxCharLimit();
437 }
438
439
440#### MODEL class(admin - creation/configuration)
441
442Getting exercise assignments as an example (Modules/Exercise/classes/class.ilExAssignment.php)
443
444properties
445
446 protected $min_char_limit;
447 protected $max_char_limit;
448
449method -> initFromDB()
450
451 ...
452 $this->setMinCharLimit($a_set["min_char_limit"]);
453 $this->setMaxCharLimit($a_set["max_char_limit"]);
454
455method -> save()
456
457 $ilDB->insert("[table_name", array(...
458 "min_char_limit" => array("integer", $this->getMinCharLimit()),
459 "max_char_limit" => array("integer", $this->getMaxCharLimit())
460
461method -> update()
462
463 $ilDB->update("[table_name",array(...
464 "min_char_limit" => array("integer", $this->getMinCharLimit()),
465 "max_char_limit" => array("integer", $this->getMaxCharLimit())
466
467
468setters and getters
469
475 function setMinCharLimit($a_val)
476 {
477 $this->min_char_limit = $a_val;
478 }
479
485 function getMinCharLimit()
486 {
487 return $this->min_char_limit;
488 }
489
494 function setMaxCharLimit($a_val)
495 {
496 $this->max_char_limit = $a_val;
497 }
498
503 function getMaxCharLimit()
504 {
505 return $this->max_char_limit;
506 }
507
508
509#### Public user part. (users doing exercises etc.)
510
511getting exercise submission as an example (Modules/Exercise/classes/class.ilExSubmissionTextGUI.php)
512
513Init the form - method -> initAssignmentTextForm()
514Set max and min limit values
515add a setInfo element with the limits explanation.
516
517 ...
518 if(!$a_read_only)
519 {...
520
521$text->setMaxNumOfChars($this->assignment->getMaxCharLimit());
522$text->setMinNumOfChars($this->assignment->getMinCharLimit());
523
524 if ($text->isCharLimited())
525 {
526 $char_msg = $lng->txt("exc_min_char_limit").": ".$this->assignment->getMinCharLimit().
527 " ".$lng->txt("exc_max_char_limit").": ".$this->assignment->getMaxCharLimit();
528
529 $text->setInfo($char_msg);
530 }...
531
532if you want to remove the "HTML" button in your TinyMCE, just add "code" in this array.
533
534 $text->disableButtons(array(
535 'charmap',
536 'undo',
537 'redo',
538 'justifyleft',
539 'justifycenter',
540 'justifyright',
541 'justifyfull',
542 'anchor',
543 'fullscreen',
544 'cut',
545 'copy',
546 'paste',
547 'pastetext',
548 'code',
549 // 'formatselect' #13234
550 ));
exit
Definition: dev.txt.php:1
An exception for terminatinating execution or to throw for unit testing.
Exercise submission //TODO: This class has to much static methods related to delivered "files".
$errors general
Definition: imgupload.php:50