4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
23 return array(
"4.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");
60 if ($a_entity ==
"exc_assignment")
67 "ExerciseId" =>
"integer",
69 "Instruction" =>
"text",
71 "Mandatory" =>
"integer",
72 "OrderNr" =>
"integer",
73 "Dir" =>
"directory");
85 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
89 if (!is_array($a_ids))
91 $a_ids = array($a_ids);
94 if ($a_entity ==
"exc")
100 " pass_mode, pass_nr, show_submissions".
101 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id) ".
103 $ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
108 if ($a_entity ==
"exc_assignment")
114 " instruction, title, start_time, mandatory, order_nr".
115 " FROM exc_assignment ".
117 $ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
132 if ($a_entity ==
"exc_assignment")
135 if($a_set[
"StartTime"] !=
"")
140 if($a_set[
"Deadline"] !=
"")
146 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
148 $a_set[
"Dir"] = $fstorage->getPath();
165 "exc_assignment" => array(
"ids" => $a_rec[
"Id"])
179 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
187 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
189 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
196 $newObj->setType(
"exc");
197 $newObj->create(
true);
200 $newObj->setTitle($a_rec[
"Title"]);
201 $newObj->setDescription($a_rec[
"Description"]);
202 $newObj->setPassMode($a_rec[
"PassMode"]);
203 $newObj->setPassNr($a_rec[
"PassNr"]);
204 $newObj->setShowSubmissions($a_rec[
"ShowSubmissions"]);
208 $this->current_exc = $newObj;
210 $a_mapping->addMapping(
"Modules/Exercise",
"exc", $a_rec[
"Id"], $newObj->getId());
214 case "exc_assignment":
215 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"ExerciseId"]);
218 if (is_object($this->current_exc) && $this->current_exc->getId() == $exc_id)
220 $exc = $this->current_exc;
224 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
228 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
231 $ass->setExerciseId($exc_id);
233 if ($a_rec[
"StartTime"] !=
"")
239 if ($a_rec[
"Deadline"] !=
"")
245 $ass->setInstruction($a_rec[
"Instruction"]);
246 $ass->setTitle($a_rec[
"Title"]);
247 $ass->setMandatory($a_rec[
"Mandatory"]);
248 $ass->setOrderNr($a_rec[
"OrderNr"]);
251 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
254 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
258 $target_dir = $fstorage->getPath();
262 $a_mapping->addMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"Id"], $ass->getId());