4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
26 return array(
"4.1.0");
38 return "http://www.ilias.de/xml/Modules/Exercise/".$a_entity;
47 protected function getTypes($a_entity, $a_version)
49 if ($a_entity ==
"exc")
57 "Description" =>
"text",
59 "PassNr" =>
"integer",
60 "ShowSubmissions" =>
"integer");
64 if ($a_entity ==
"exc_assignment")
71 "ExerciseId" =>
"integer",
73 "Instruction" =>
"text",
75 "Mandatory" =>
"integer",
76 "OrderNr" =>
"integer",
77 "Dir" =>
"directory");
89 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
93 if (!is_array($a_ids))
95 $a_ids = array($a_ids);
98 if ($a_entity ==
"exc")
104 " pass_mode, pass_nr, show_submissions".
105 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id) ".
107 $ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
112 if ($a_entity ==
"exc_assignment")
118 " instruction, title, start_time, mandatory, order_nr".
119 " FROM exc_assignment ".
121 $ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
136 if ($a_entity ==
"exc_assignment")
139 if($a_set[
"StartTime"] !=
"")
144 if($a_set[
"Deadline"] !=
"")
150 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
152 $a_set[
"Dir"] = $fstorage->getPath();
169 "exc_assignment" => array(
"ids" => $a_rec[
"Id"])
183 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
191 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
193 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
200 $newObj->setType(
"exc");
201 $newObj->create(
true);
204 $newObj->setTitle($a_rec[
"Title"]);
205 $newObj->setDescription($a_rec[
"Description"]);
206 $newObj->setPassMode($a_rec[
"PassMode"]);
207 $newObj->setPassNr($a_rec[
"PassNr"]);
208 $newObj->setShowSubmissions($a_rec[
"ShowSubmissions"]);
212 $this->current_exc = $newObj;
214 $a_mapping->addMapping(
"Modules/Exercise",
"exc", $a_rec[
"Id"], $newObj->getId());
218 case "exc_assignment":
219 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"ExerciseId"]);
222 if (is_object($this->current_exc) && $this->current_exc->getId() == $exc_id)
224 $exc = $this->current_exc;
228 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
232 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
235 $ass->setExerciseId($exc_id);
237 if ($a_rec[
"StartTime"] !=
"")
243 if ($a_rec[
"Deadline"] !=
"")
249 $ass->setInstruction($a_rec[
"Instruction"]);
250 $ass->setTitle($a_rec[
"Title"]);
251 $ass->setMandatory($a_rec[
"Mandatory"]);
252 $ass->setOrderNr($a_rec[
"OrderNr"]);
255 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
258 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
262 $target_dir = $fstorage->getPath();
266 $a_mapping->addMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"Id"], $ass->getId());