4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
23 return array(
"4.1.0",
"4.4.0",
"5.0.0",
"5.1.0");
34 return "http://www.ilias.de/xml/Modules/Exercise/".$a_entity;
43 protected function getTypes($a_entity, $a_version)
45 if ($a_entity ==
"exc")
53 "Description" =>
"text",
55 "PassNr" =>
"integer",
56 "ShowSubmissions" =>
"integer" 65 "Description" =>
"text",
67 "PassNr" =>
"integer",
68 "ShowSubmissions" =>
"integer",
69 "ComplBySubmission" =>
"integer" 74 if ($a_entity ==
"exc_assignment")
81 "ExerciseId" =>
"integer",
83 "Instruction" =>
"text",
85 "Mandatory" =>
"integer",
86 "OrderNr" =>
"integer",
87 "Dir" =>
"directory");
92 "ExerciseId" =>
"integer",
94 "Deadline" =>
"integer",
95 "Instruction" =>
"text",
97 "Mandatory" =>
"integer",
98 "OrderNr" =>
"integer",
102 ,
"PeerMin" =>
"integer" 103 ,
"PeerDeadline" =>
"integer" 105 ,
"FeedbackFile" =>
"integer" 106 ,
"FeedbackCron" =>
"integer" 107 ,
"FeedbackDate" =>
"integer" 108 ,
"FeedbackDir" =>
"directory" 114 "ExerciseId" =>
"integer",
116 "Deadline" =>
"integer",
117 "Instruction" =>
"text",
119 "Mandatory" =>
"integer",
120 "OrderNr" =>
"integer",
124 ,
"PeerMin" =>
"integer" 125 ,
"PeerDeadline" =>
"integer" 126 ,
"PeerFile" =>
"integer" 127 ,
"PeerPersonal" =>
"integer" 129 ,
"FeedbackFile" =>
"integer" 130 ,
"FeedbackCron" =>
"integer" 131 ,
"FeedbackDate" =>
"integer" 132 ,
"FeedbackDir" =>
"directory" 138 "ExerciseId" =>
"integer",
140 "Deadline" =>
"integer",
141 "Deadline2" =>
"integer",
142 "Instruction" =>
"text",
144 "Mandatory" =>
"integer",
145 "OrderNr" =>
"integer",
146 "TeamTutor" =>
"integer",
147 "MaxFile" =>
"integer",
151 ,
"PeerMin" =>
"integer" 152 ,
"PeerDeadline" =>
"integer" 153 ,
"PeerFile" =>
"integer" 154 ,
"PeerPersonal" =>
"integer" 155 ,
"PeerChar" =>
"integer" 156 ,
"PeerUnlock" =>
"integer" 157 ,
"PeerValid" =>
"integer" 158 ,
"PeerText" =>
"integer" 159 ,
"PeerRating" =>
"integer" 160 ,
"PeerCritCat" =>
"integer" 162 ,
"FeedbackFile" =>
"integer" 163 ,
"FeedbackCron" =>
"integer" 164 ,
"FeedbackDate" =>
"integer" 165 ,
"FeedbackDir" =>
"directory" 170 if ($a_entity ==
"exc_cit_cat")
177 ,
"Parent" =>
"integer" 184 if ($a_entity ==
"exc_cit")
191 ,
"Parent" =>
"integer" 196 ,
"Required" =>
"integer" 209 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
213 if (!is_array($a_ids))
215 $a_ids = array($a_ids);
218 if ($a_entity ==
"exc")
224 " pass_mode, pass_nr, show_submissions".
225 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id)".
226 " WHERE ".$ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
233 " pass_mode, pass_nr, show_submissions, compl_by_submission".
234 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id)".
235 " WHERE ".$ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
240 if ($a_entity ==
"exc_assignment")
246 " instruction, title, start_time, mandatory, order_nr".
247 " FROM exc_assignment".
248 " WHERE ".$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
253 " instruction, title, start_time, mandatory, order_nr, peer, peer_min, peer_dl peer_deadline,".
254 " fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date".
255 " FROM exc_assignment".
256 " WHERE ".$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
261 " instruction, title, start_time, mandatory, order_nr, peer, peer_min, peer_dl peer_deadline,".
262 " peer_file, peer_prsl peer_personal, fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date".
263 " FROM exc_assignment".
264 " WHERE ".$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
269 " instruction, title, start_time, mandatory, order_nr, team_tutor, max_file, peer, peer_min,".
270 " peer_dl peer_deadline, peer_file, peer_prsl peer_personal, peer_char, peer_unlock, peer_valid,".
271 " peer_text, peer_rating, peer_crit_cat, fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date".
272 " FROM exc_assignment".
273 " WHERE ".$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
278 if ($a_entity ==
"exc_crit_cat")
284 " FROM exc_crit_cat".
285 " WHERE ".$ilDB->in(
"parent", $a_ids,
false,
"integer"));
290 if ($a_entity ==
"exc_crit")
296 ", descr, pos, required, def".
298 " WHERE ".$ilDB->in(
"parent", $a_ids,
false,
"integer"));
312 if ($a_entity ==
"exc_assignment")
315 if($a_set[
"StartTime"] !=
"")
320 if($a_set[
"Deadline"] !=
"")
325 if($a_set[
"Deadline2"] !=
"")
331 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
333 $a_set[
"Dir"] = $fstorage->getPath();
335 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
337 $a_set[
"FeedbackDir"] = $fstorage->getGlobalFeedbackPath();
353 "exc_crit_cat" => array(
"ids" => $a_rec[
"Id"]),
354 "exc_assignment" => array(
"ids" => $a_rec[
"Id"])
359 "exc_crit" => array(
"ids" => $a_rec[
"Id"])
373 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
381 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
383 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
390 $newObj->setType(
"exc");
391 $newObj->create(
true);
394 $newObj->setTitle($a_rec[
"Title"]);
395 $newObj->setDescription($a_rec[
"Description"]);
396 $newObj->setPassMode($a_rec[
"PassMode"]);
397 $newObj->setPassNr($a_rec[
"PassNr"]);
398 $newObj->setShowSubmissions($a_rec[
"ShowSubmissions"]);
399 $newObj->setCompletionBySubmission($a_rec[
"ComplBySubmission"]);
402 $this->current_exc = $newObj;
404 $a_mapping->addMapping(
"Modules/Exercise",
"exc", $a_rec[
"Id"], $newObj->getId());
407 case "exc_assignment":
408 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"ExerciseId"]);
411 if (is_object($this->current_exc) && $this->current_exc->getId() == $exc_id)
413 $exc = $this->current_exc;
417 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
421 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
424 $ass->setExerciseId($exc_id);
426 if ($a_rec[
"StartTime"] !=
"")
432 if ($a_rec[
"Deadline"] !=
"")
438 $ass->setInstruction($a_rec[
"Instruction"]);
439 $ass->setTitle($a_rec[
"Title"]);
440 $ass->setMandatory($a_rec[
"Mandatory"]);
441 $ass->setOrderNr($a_rec[
"OrderNr"]);
444 $ass->setType($a_rec[
"Type"]);
447 $ass->setPeerReview($a_rec[
"Peer"]);
448 $ass->setPeerReviewMin($a_rec[
"PeerMin"]);
449 $ass->setPeerReviewDeadline($a_rec[
"PeerDeadline"]);
450 $ass->setFeedbackFile($a_rec[
"FeedbackFile"]);
451 $ass->setFeedbackCron($a_rec[
"FeedbackCron"]);
452 $ass->setFeedbackDate($a_rec[
"FeedbackDate"]);
455 $ass->setPeerReviewFileUpload($a_rec[
"PeerFile"]);
456 $ass->setPeerReviewPersonalized($a_rec[
"PeerPersonal"]);
459 if ($a_rec[
"Deadline2"] !=
"")
462 $ass->setExtendedDeadline($deadline->get(
IL_CAL_UNIX));
464 $ass->setMaxFile($a_rec[
"MaxFile"]);
465 $ass->setTeamTutor($a_rec[
"TeamTutor"]);
466 $ass->setPeerReviewChars($a_rec[
"PeerChar"]);
467 $ass->setPeerReviewSimpleUnlock($a_rec[
"PeerUnlock"]);
468 $ass->setPeerReviewValid($a_rec[
"PeerValid"]);
469 $ass->setPeerReviewText($a_rec[
"PeerText"]);
470 $ass->setPeerReviewRating($a_rec[
"PeerRating"]);
473 if($a_rec[
"PeerCritCat"])
475 $ass->setPeerReviewCriteriaCatalogue($a_mapping->getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"PeerCritCat"]));
480 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
485 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
489 $target_dir = $fstorage->getPath();
494 $dir = str_replace(
"..",
"", $a_rec[
"FeedbackDir"]);
498 $target_dir = $fstorage->getGlobalFeedbackPath();
502 $a_mapping->addMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"Id"], $ass->getId());
509 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"Parent"]);
512 include_once(
"./Modules/Exercise/classes/class.ilExcCriteriaCatalogue.php");
514 $crit_cat->setParent($exc_id);
515 $crit_cat->setTitle($a_rec[
"Title"]);
516 $crit_cat->setPosition($a_rec[
"Pos"]);
519 $a_mapping->addMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Id"], $crit_cat->getId());
524 $crit_cat_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Parent"]);
525 if ($crit_cat_id > 0)
527 include_once(
"./Modules/Exercise/classes/class.ilExcCriteria.php");
529 $crit->setParent($crit_cat_id);
530 $crit->setTitle($a_rec[
"Title"]);
531 $crit->setDescription($a_rec[
"Descr"]);
532 $crit->setPosition($a_rec[
"Pos"]);
533 $crit->setRequired($a_rec[
"Required"]);
534 $crit->importDefinition($a_rec[
"Def"]);
static getInstanceByType($a_type)
Class ilExcCriteriaCatalogue.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
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)
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
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.