4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
31 return array(
"4.1.0",
"4.4.0",
"5.0.0",
"5.1.0",
"5.2.0",
"5.3.0");
42 return "http://www.ilias.de/xml/Modules/Exercise/" . $a_entity;
51 protected function getTypes($a_entity, $a_version)
53 if ($a_entity ==
"exc") {
59 "Description" =>
"text",
61 "PassNr" =>
"integer",
62 "ShowSubmissions" =>
"integer" 71 "Description" =>
"text",
73 "PassNr" =>
"integer",
74 "ShowSubmissions" =>
"integer",
75 "ComplBySubmission" =>
"integer" 83 "Description" =>
"text",
85 "PassNr" =>
"integer",
86 "ShowSubmissions" =>
"integer",
87 "ComplBySubmission" =>
"integer",
88 "Tfeedback" =>
"integer" 93 if ($a_entity ==
"exc_assignment") {
98 "ExerciseId" =>
"integer",
100 "Instruction" =>
"text",
102 "Mandatory" =>
"integer",
103 "OrderNr" =>
"integer",
104 "Dir" =>
"directory");
109 "ExerciseId" =>
"integer",
111 "Deadline" =>
"integer",
112 "Instruction" =>
"text",
114 "Mandatory" =>
"integer",
115 "OrderNr" =>
"integer",
119 ,
"PeerMin" =>
"integer" 120 ,
"PeerDeadline" =>
"integer" 122 ,
"FeedbackFile" =>
"integer" 123 ,
"FeedbackCron" =>
"integer" 124 ,
"FeedbackDate" =>
"integer" 125 ,
"FeedbackDir" =>
"directory" 131 "ExerciseId" =>
"integer",
133 "Deadline" =>
"integer",
134 "Instruction" =>
"text",
136 "Mandatory" =>
"integer",
137 "OrderNr" =>
"integer",
141 ,
"PeerMin" =>
"integer" 142 ,
"PeerDeadline" =>
"integer" 143 ,
"PeerFile" =>
"integer" 144 ,
"PeerPersonal" =>
"integer" 146 ,
"FeedbackFile" =>
"integer" 147 ,
"FeedbackCron" =>
"integer" 148 ,
"FeedbackDate" =>
"integer" 149 ,
"FeedbackDir" =>
"directory" 156 "ExerciseId" =>
"integer",
158 "Deadline" =>
"integer",
159 "Deadline2" =>
"integer",
160 "Instruction" =>
"text",
162 "Mandatory" =>
"integer",
163 "OrderNr" =>
"integer",
164 "TeamTutor" =>
"integer",
165 "MaxFile" =>
"integer",
169 ,
"PeerMin" =>
"integer" 170 ,
"PeerDeadline" =>
"integer" 171 ,
"PeerFile" =>
"integer" 172 ,
"PeerPersonal" =>
"integer" 173 ,
"PeerChar" =>
"integer" 174 ,
"PeerUnlock" =>
"integer" 175 ,
"PeerValid" =>
"integer" 176 ,
"PeerText" =>
"integer" 177 ,
"PeerRating" =>
"integer" 178 ,
"PeerCritCat" =>
"integer" 180 ,
"FeedbackFile" =>
"integer" 181 ,
"FeedbackCron" =>
"integer" 182 ,
"FeedbackDate" =>
"integer" 183 ,
"FeedbackDir" =>
"directory" 188 "ExerciseId" =>
"integer",
190 "Deadline" =>
"integer",
191 "Deadline2" =>
"integer",
192 "Instruction" =>
"text",
194 "Mandatory" =>
"integer",
195 "OrderNr" =>
"integer",
196 "TeamTutor" =>
"integer",
197 "MaxFile" =>
"integer",
198 "Dir" =>
"directory",
200 "WebDataDir" =>
"directory" 203 ,
"PeerMin" =>
"integer" 204 ,
"PeerDeadline" =>
"integer" 205 ,
"PeerFile" =>
"integer" 206 ,
"PeerPersonal" =>
"integer" 207 ,
"PeerChar" =>
"integer" 208 ,
"PeerUnlock" =>
"integer" 209 ,
"PeerValid" =>
"integer" 210 ,
"PeerText" =>
"integer" 211 ,
"PeerRating" =>
"integer" 212 ,
"PeerCritCat" =>
"integer" 214 ,
"FeedbackFile" =>
"integer" 215 ,
"FeedbackCron" =>
"integer" 216 ,
"FeedbackDate" =>
"integer" 217 ,
"FeedbackDir" =>
"directory" 222 if ($a_entity ==
"exc_cit_cat") {
223 switch ($a_version) {
229 ,
"Parent" =>
"integer" 236 if ($a_entity ==
"exc_cit") {
237 switch ($a_version) {
243 ,
"Parent" =>
"integer" 248 ,
"Required" =>
"integer" 255 if ($a_entity ==
"exc_ass_file_order") {
256 switch ($a_version) {
260 ,
"AssignmentId" =>
"integer" 261 ,
"Filename" =>
"text" 262 ,
"OrderNr" =>
"integer" 275 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
279 if (!is_array($a_ids)) {
280 $a_ids =
array($a_ids);
283 if ($a_entity ==
"exc") {
284 switch ($a_version) {
287 " pass_mode, pass_nr, show_submissions" .
288 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id)" .
289 " WHERE " .
$ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
296 " pass_mode, pass_nr, show_submissions, compl_by_submission" .
297 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id)" .
298 " WHERE " .
$ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
304 " pass_mode, pass_nr, show_submissions, compl_by_submission, tfeedback" .
305 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id)" .
306 " WHERE " .
$ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
311 if ($a_entity ==
"exc_assignment") {
312 switch ($a_version) {
315 " instruction, title, start_time, mandatory, order_nr" .
316 " FROM exc_assignment" .
317 " WHERE " .
$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
322 " instruction, title, start_time, mandatory, order_nr, peer, peer_min, peer_dl peer_deadline," .
323 " fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date" .
324 " FROM exc_assignment" .
325 " WHERE " .
$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
330 " instruction, title, start_time, mandatory, order_nr, peer, peer_min, peer_dl peer_deadline," .
331 " peer_file, peer_prsl peer_personal, fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date" .
332 " FROM exc_assignment" .
333 " WHERE " .
$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
340 " instruction, title, start_time, mandatory, order_nr, team_tutor, max_file, peer, peer_min," .
341 " peer_dl peer_deadline, peer_file, peer_prsl peer_personal, peer_char, peer_unlock, peer_valid," .
342 " peer_text, peer_rating, peer_crit_cat, fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date" .
343 " FROM exc_assignment" .
344 " WHERE " .
$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
349 if ($a_entity ==
"exc_crit_cat") {
350 switch ($a_version) {
355 " FROM exc_crit_cat" .
356 " WHERE " .
$ilDB->in(
"parent", $a_ids,
false,
"integer"));
361 if ($a_entity ==
"exc_crit") {
362 switch ($a_version) {
367 ", descr, pos, required, def" .
369 " WHERE " .
$ilDB->in(
"parent", $a_ids,
false,
"integer"));
370 foreach ($this->
data as $k => $v) {
371 $this->
data[$k][
"DefJson"] =
"";
372 if ($v[
"Def"] !=
"") {
373 $this->
data[$k][
"DefJson"] = json_encode(unserialize($v[
"Def"]));
380 if ($a_entity ==
"exc_ass_file_order") {
381 switch ($a_version) {
384 " FROM exc_ass_file_order" .
385 " WHERE " .
$ilDB->in(
"assignment_id", $a_ids,
false,
"integer"));
399 if ($a_entity ==
"exc_assignment") {
401 if ($a_set[
"StartTime"] !=
"") {
405 if ($a_set[
"Deadline"] !=
"") {
409 if ($a_set[
"Deadline2"] !=
"") {
414 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
416 $a_set[
"Dir"] = $fstorage->getPath();
418 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
420 $a_set[
"FeedbackDir"] = $fstorage->getGlobalFeedbackPath();
423 include_once(
"./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
425 $a_set[
'WebDataDir'] = $fswebstorage->getPath();
439 switch ($a_version) {
444 "exc_assignment" =>
array(
"ids" => $a_rec[
"Id"])
451 "exc_crit_cat" =>
array(
"ids" => $a_rec[
"Id"]),
452 "exc_assignment" =>
array(
"ids" => $a_rec[
"Id"])
459 "exc_crit" =>
array(
"ids" => $a_rec[
"Id"])
462 case "exc_assignment":
463 switch ($a_version) {
466 "exc_ass_file_order" =>
array(
"ids" => $a_rec[
"Id"])
482 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
489 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
491 if ($new_id = $a_mapping->getMapping(
'Services/Container',
'objs', $a_rec[
'Id'])) {
495 $newObj->setType(
"exc");
496 $newObj->create(
true);
499 $newObj->setTitle($a_rec[
"Title"]);
500 $newObj->setDescription($a_rec[
"Description"]);
501 $newObj->setPassMode($a_rec[
"PassMode"]);
502 $newObj->setPassNr($a_rec[
"PassNr"]);
503 $newObj->setShowSubmissions($a_rec[
"ShowSubmissions"]);
504 $newObj->setCompletionBySubmission($a_rec[
"ComplBySubmission"]);
505 $newObj->setTutorFeedback($a_rec[
"Tfeedback"]);
508 $this->current_exc = $newObj;
510 $a_mapping->addMapping(
"Modules/Exercise",
"exc", $a_rec[
"Id"], $newObj->getId());
513 case "exc_assignment":
514 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"ExerciseId"]);
516 if (is_object($this->current_exc) && $this->current_exc->getId() == $exc_id) {
517 $exc = $this->current_exc;
519 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
523 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
526 $ass->setExerciseId($exc_id);
528 if ($a_rec[
"StartTime"] !=
"") {
533 if ($a_rec[
"Deadline"] !=
"") {
538 $ass->setInstruction($a_rec[
"Instruction"]);
539 $ass->setTitle($a_rec[
"Title"]);
540 $ass->setMandatory($a_rec[
"Mandatory"]);
541 $ass->setOrderNr($a_rec[
"OrderNr"]);
544 $ass->setType($a_rec[
"Type"]);
547 $ass->setPeerReview($a_rec[
"Peer"]);
548 $ass->setPeerReviewMin($a_rec[
"PeerMin"]);
549 $ass->setPeerReviewDeadline($a_rec[
"PeerDeadline"]);
550 $ass->setFeedbackFile($a_rec[
"FeedbackFile"]);
551 $ass->setFeedbackCron($a_rec[
"FeedbackCron"]);
552 $ass->setFeedbackDate($a_rec[
"FeedbackDate"]);
555 $ass->setPeerReviewFileUpload($a_rec[
"PeerFile"]);
556 $ass->setPeerReviewPersonalized($a_rec[
"PeerPersonal"]);
559 if ($a_rec[
"Deadline2"] !=
"") {
561 $ass->setExtendedDeadline($deadline->get(
IL_CAL_UNIX));
563 $ass->setMaxFile($a_rec[
"MaxFile"]);
564 $ass->setTeamTutor($a_rec[
"TeamTutor"]);
565 $ass->setPeerReviewChars($a_rec[
"PeerChar"]);
566 $ass->setPeerReviewSimpleUnlock($a_rec[
"PeerUnlock"]);
567 $ass->setPeerReviewValid($a_rec[
"PeerValid"]);
568 $ass->setPeerReviewText($a_rec[
"PeerText"]);
569 $ass->setPeerReviewRating($a_rec[
"PeerRating"]);
572 if ($a_rec[
"PeerCritCat"]) {
573 $ass->setPeerReviewCriteriaCatalogue($a_mapping->getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"PeerCritCat"]));
578 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
583 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
586 $target_dir = $fstorage->getPath();
591 $dir = str_replace(
"..",
"", $a_rec[
"FeedbackDir"]);
594 $target_dir = $fstorage->getGlobalFeedbackPath();
599 include_once(
"./Modules/Exercise/classes/class.ilFSWebStorageExercise.php");
602 $dir = str_replace(
"..",
"", $a_rec[
"WebDataDir"]);
605 $target_dir = $fwebstorage->getPath();
609 $a_mapping->addMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"Id"], $ass->getId());
615 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"Parent"]);
617 include_once(
"./Modules/Exercise/classes/class.ilExcCriteriaCatalogue.php");
619 $crit_cat->setParent($exc_id);
620 $crit_cat->setTitle($a_rec[
"Title"]);
621 $crit_cat->setPosition($a_rec[
"Pos"]);
624 $a_mapping->addMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Id"], $crit_cat->getId());
629 $crit_cat_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Parent"]);
630 if ($crit_cat_id > 0) {
631 include_once(
"./Modules/Exercise/classes/class.ilExcCriteria.php");
633 $crit->setParent($crit_cat_id);
634 $crit->setTitle($a_rec[
"Title"]);
635 $crit->setDescription($a_rec[
"Descr"]);
636 $crit->setPosition($a_rec[
"Pos"]);
637 $crit->setRequired($a_rec[
"Required"]);
638 $crit->importDefinition($a_rec[
"Def"], $a_rec[
"DefJson"]);
643 case "exc_ass_file_order":
645 $ass_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"AssignmentId"]);
static getInstanceByType($a_type)
Class ilExcCriteriaCatalogue.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static instructionFileInsertOrder($a_filename, $a_ass_id, $a_order_nr=0)
Store the file order in the database.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
getTypes($a_entity, $a_version)
Get field types for entity.
getImportDirectory()
Get import directory.
getXmlRecord($a_entity, $a_version, $a_set)
Get xml record (export)
create()
Create directory.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
create()
Create directory.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getSupportedVersions()
Get supported versions.