4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
23 return array(
"4.1.0",
"4.4.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")
54 "Description" =>
"text",
56 "PassNr" =>
"integer",
57 "ShowSubmissions" =>
"integer");
61 if ($a_entity ==
"exc_assignment")
68 "ExerciseId" =>
"integer",
70 "Instruction" =>
"text",
72 "Mandatory" =>
"integer",
73 "OrderNr" =>
"integer",
74 "Dir" =>
"directory");
79 "ExerciseId" =>
"integer",
81 "Deadline" =>
"integer",
82 "Instruction" =>
"text",
84 "Mandatory" =>
"integer",
85 "OrderNr" =>
"integer",
89 ,
"PeerMin" =>
"integer"
90 ,
"PeerDeadline" =>
"integer"
92 ,
"FeedbackFile" =>
"integer"
93 ,
"FeedbackCron" =>
"integer"
94 ,
"FeedbackDate" =>
"integer"
95 ,
"FeedbackDir" =>
"directory"
108 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
112 if (!is_array($a_ids))
114 $a_ids = array($a_ids);
117 if ($a_entity ==
"exc")
124 " pass_mode, pass_nr, show_submissions".
125 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id) ".
127 $ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
132 if ($a_entity ==
"exc_assignment")
138 " instruction, title, start_time, mandatory, order_nr".
139 " FROM exc_assignment ".
141 $ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
146 " instruction, title, start_time, mandatory, order_nr, peer, peer_min, peer_dl peer_deadline,".
147 " fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date".
148 " FROM exc_assignment".
150 $ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
165 if ($a_entity ==
"exc_assignment")
168 if($a_set[
"StartTime"] !=
"")
173 if($a_set[
"Deadline"] !=
"")
179 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
181 $a_set[
"Dir"] = $fstorage->getPath();
183 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
185 $a_set[
"FeedbackDir"] = $fstorage->getGlobalFeedbackPath();
202 "exc_assignment" => array(
"ids" => $a_rec[
"Id"])
216 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
224 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
226 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
233 $newObj->setType(
"exc");
234 $newObj->create(
true);
237 $newObj->setTitle($a_rec[
"Title"]);
238 $newObj->setDescription($a_rec[
"Description"]);
239 $newObj->setPassMode($a_rec[
"PassMode"]);
240 $newObj->setPassNr($a_rec[
"PassNr"]);
241 $newObj->setShowSubmissions($a_rec[
"ShowSubmissions"]);
245 $this->current_exc = $newObj;
247 $a_mapping->addMapping(
"Modules/Exercise",
"exc", $a_rec[
"Id"], $newObj->getId());
251 case "exc_assignment":
252 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"ExerciseId"]);
255 if (is_object($this->current_exc) && $this->current_exc->getId() == $exc_id)
257 $exc = $this->current_exc;
261 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
265 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
268 $ass->setExerciseId($exc_id);
270 if ($a_rec[
"StartTime"] !=
"")
276 if ($a_rec[
"Deadline"] !=
"")
282 $ass->setInstruction($a_rec[
"Instruction"]);
283 $ass->setTitle($a_rec[
"Title"]);
284 $ass->setMandatory($a_rec[
"Mandatory"]);
285 $ass->setOrderNr($a_rec[
"OrderNr"]);
288 $ass->setType($a_rec[
"Type"]);
291 $ass->setPeerReview($a_rec[
"Peer"]);
292 $ass->setPeerReviewMin($a_rec[
"PeerMin"]);
293 $ass->setPeerReviewDeadline($a_rec[
"PeerDeadline"]);
294 $ass->setFeedbackFile($a_rec[
"FeedbackFile"]);
295 $ass->setFeedbackCron($a_rec[
"FeedbackCron"]);
296 $ass->setFeedbackDate($a_rec[
"FeedbackDate"]);
300 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
305 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
309 $target_dir = $fstorage->getPath();
314 $dir = str_replace(
"..",
"", $a_rec[
"FeedbackDir"]);
318 $target_dir = $fstorage->getGlobalFeedbackPath();
322 $a_mapping->addMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"Id"], $ass->getId());