29 return array(
"4.1.0",
"4.4.0",
"5.0.0",
"5.1.0",
"5.2.0",
"5.3.0");
40 return "http://www.ilias.de/xml/Modules/Exercise/" . $a_entity;
49 protected function getTypes($a_entity, $a_version)
51 if ($a_entity ==
"exc") {
57 "Description" =>
"text",
59 "PassNr" =>
"integer",
60 "ShowSubmissions" =>
"integer" 69 "Description" =>
"text",
71 "PassNr" =>
"integer",
72 "ShowSubmissions" =>
"integer",
73 "ComplBySubmission" =>
"integer" 81 "Description" =>
"text",
83 "PassNr" =>
"integer",
84 "NrMandatoryRandom" =>
"integer",
85 "ShowSubmissions" =>
"integer",
86 "ComplBySubmission" =>
"integer",
87 "Tfeedback" =>
"integer" 92 if ($a_entity ==
"exc_assignment") {
97 "ExerciseId" =>
"integer",
99 "Instruction" =>
"text",
101 "Mandatory" =>
"integer",
102 "OrderNr" =>
"integer",
103 "Dir" =>
"directory");
108 "ExerciseId" =>
"integer",
110 "Deadline" =>
"integer",
111 "Instruction" =>
"text",
113 "Mandatory" =>
"integer",
114 "OrderNr" =>
"integer",
118 ,
"PeerMin" =>
"integer" 119 ,
"PeerDeadline" =>
"integer" 121 ,
"FeedbackFile" =>
"integer" 122 ,
"FeedbackCron" =>
"integer" 123 ,
"FeedbackDate" =>
"integer" 124 ,
"FeedbackDir" =>
"directory" 130 "ExerciseId" =>
"integer",
132 "Deadline" =>
"integer",
133 "Instruction" =>
"text",
135 "Mandatory" =>
"integer",
136 "OrderNr" =>
"integer",
140 ,
"PeerMin" =>
"integer" 141 ,
"PeerDeadline" =>
"integer" 142 ,
"PeerFile" =>
"integer" 143 ,
"PeerPersonal" =>
"integer" 145 ,
"FeedbackFile" =>
"integer" 146 ,
"FeedbackCron" =>
"integer" 147 ,
"FeedbackDate" =>
"integer" 148 ,
"FeedbackDir" =>
"directory" 155 "ExerciseId" =>
"integer",
157 "Deadline" =>
"integer",
158 "Deadline2" =>
"integer",
159 "Instruction" =>
"text",
161 "Mandatory" =>
"integer",
162 "OrderNr" =>
"integer",
163 "TeamTutor" =>
"integer",
164 "MaxFile" =>
"integer",
168 ,
"PeerMin" =>
"integer" 169 ,
"PeerDeadline" =>
"integer" 170 ,
"PeerFile" =>
"integer" 171 ,
"PeerPersonal" =>
"integer" 172 ,
"PeerChar" =>
"integer" 173 ,
"PeerUnlock" =>
"integer" 174 ,
"PeerValid" =>
"integer" 175 ,
"PeerText" =>
"integer" 176 ,
"PeerRating" =>
"integer" 177 ,
"PeerCritCat" =>
"integer" 179 ,
"FeedbackFile" =>
"integer" 180 ,
"FeedbackCron" =>
"integer" 181 ,
"FeedbackDate" =>
"integer" 182 ,
"FeedbackDir" =>
"directory" 187 "ExerciseId" =>
"integer",
189 "Deadline" =>
"integer",
190 "Deadline2" =>
"integer",
191 "Instruction" =>
"text",
193 "Mandatory" =>
"integer",
194 "OrderNr" =>
"integer",
195 "TeamTutor" =>
"integer",
196 "MaxFile" =>
"integer",
197 "Dir" =>
"directory",
199 "WebDataDir" =>
"directory" 202 ,
"PeerMin" =>
"integer" 203 ,
"PeerDeadline" =>
"integer" 204 ,
"PeerFile" =>
"integer" 205 ,
"PeerPersonal" =>
"integer" 206 ,
"PeerChar" =>
"integer" 207 ,
"PeerUnlock" =>
"integer" 208 ,
"PeerValid" =>
"integer" 209 ,
"PeerText" =>
"integer" 210 ,
"PeerRating" =>
"integer" 211 ,
"PeerCritCat" =>
"integer" 213 ,
"FeedbackFile" =>
"integer" 214 ,
"FeedbackCron" =>
"integer" 215 ,
"FeedbackDate" =>
"integer" 216 ,
"FeedbackDir" =>
"directory" 217 ,
"FbDateCustom" =>
"integer" 218 ,
"DeadlineMode" =>
"integer" 219 ,
"RelativeDeadline" =>
"integer" 220 ,
"RelDeadlineLastSubm" =>
"integer" 225 if ($a_entity ==
"exc_cit_cat") {
226 switch ($a_version) {
232 ,
"Parent" =>
"integer" 239 if ($a_entity ==
"exc_cit") {
240 switch ($a_version) {
246 ,
"Parent" =>
"integer" 251 ,
"Required" =>
"integer" 258 if ($a_entity ==
"exc_ass_file_order") {
259 switch ($a_version) {
263 ,
"AssignmentId" =>
"integer" 264 ,
"Filename" =>
"text" 265 ,
"OrderNr" =>
"integer" 270 if ($a_entity ==
"exc_ass_reminders") {
271 switch ($a_version) {
275 "AssignmentId" =>
"integer",
276 "ExerciseId" =>
"integer",
277 "Status" =>
"integer",
278 "Start" =>
"integer",
280 "Frequency" =>
"integer",
281 "LastSend" =>
"integer",
282 "TemplateId" =>
"integer" 295 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
299 if (!is_array($a_ids)) {
300 $a_ids = array($a_ids);
303 if ($a_entity ==
"exc") {
304 switch ($a_version) {
307 " pass_mode, pass_nr, show_submissions" .
308 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id)" .
309 " WHERE " .
$ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
316 " pass_mode, pass_nr, show_submissions, compl_by_submission" .
317 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id)" .
318 " WHERE " .
$ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
324 " pass_mode, pass_nr, show_submissions, compl_by_submission, tfeedback,nr_mandatory_random" .
325 " FROM exc_data JOIN object_data ON (exc_data.obj_id = object_data.obj_id)" .
326 " WHERE " .
$ilDB->in(
"exc_data.obj_id", $a_ids,
false,
"integer"));
331 if ($a_entity ==
"exc_assignment") {
332 switch ($a_version) {
335 " instruction, title, start_time, mandatory, order_nr" .
336 " FROM exc_assignment" .
337 " WHERE " .
$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
342 " instruction, title, start_time, mandatory, order_nr, peer, peer_min, peer_dl peer_deadline," .
343 " fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date" .
344 " FROM exc_assignment" .
345 " WHERE " .
$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
350 " instruction, title, start_time, mandatory, order_nr, peer, peer_min, peer_dl peer_deadline," .
351 " peer_file, peer_prsl peer_personal, fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date" .
352 " FROM exc_assignment" .
353 " WHERE " .
$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
360 " instruction, title, start_time, mandatory, order_nr, team_tutor, max_file, peer, peer_min," .
361 " peer_dl peer_deadline, peer_file, peer_prsl peer_personal, peer_char, peer_unlock, peer_valid," .
362 " peer_text, peer_rating, peer_crit_cat, fb_file feedback_file, fb_cron feedback_cron, fb_date feedback_date," .
363 " fb_date_custom, rel_deadline_last_subm, deadline_mode, relative_deadline" .
364 " FROM exc_assignment" .
365 " WHERE " .
$ilDB->in(
"exc_id", $a_ids,
false,
"integer"));
370 if ($a_entity ==
"exc_crit_cat") {
371 switch ($a_version) {
376 " FROM exc_crit_cat" .
377 " WHERE " .
$ilDB->in(
"parent", $a_ids,
false,
"integer"));
382 if ($a_entity ==
"exc_crit") {
383 switch ($a_version) {
388 ", descr, pos, required, def" .
390 " WHERE " .
$ilDB->in(
"parent", $a_ids,
false,
"integer"));
391 foreach ($this->data as $k => $v) {
392 $this->data[$k][
"DefJson"] =
"";
393 if ($v[
"Def"] !=
"") {
394 $this->data[$k][
"DefJson"] = json_encode(unserialize($v[
"Def"]));
401 if ($a_entity ==
"exc_ass_file_order") {
402 switch ($a_version) {
405 " FROM exc_ass_file_order" .
406 " WHERE " .
$ilDB->in(
"assignment_id", $a_ids,
false,
"integer"));
411 if ($a_entity ==
"exc_ass_reminders") {
412 switch ($a_version) {
414 $this->
getDirectDataFromQuery(
"SELECT type, ass_id, exc_id, status, start, end, freq, last_send, template_id" .
415 " FROM exc_ass_reminders" .
416 " WHERE " .
$ilDB->in(
"ass_id", $a_ids,
false,
"integer"));
430 if ($a_entity ==
"exc_assignment") {
432 if ($a_set[
"StartTime"] !=
"") {
436 if ($a_set[
"Deadline"] !=
"") {
440 if ($a_set[
"Deadline2"] !=
"") {
446 $a_set[
"Dir"] = $fstorage->getPath();
449 $a_set[
"FeedbackDir"] = $fstorage->getGlobalFeedbackPath();
453 $a_set[
'WebDataDir'] = $fswebstorage->getPath();
457 if ($a_entity ==
"exc_ass_reminders") {
458 if ($a_set[
"End"] !=
"") {
462 if ($a_set[
"LastSend"] !=
"") {
479 switch ($a_version) {
484 "exc_assignment" => array(
"ids" => $a_rec[
"Id"])
491 "exc_crit_cat" => array(
"ids" => $a_rec[
"Id"]),
492 "exc_assignment" => array(
"ids" => $a_rec[
"Id"])
499 "exc_crit" => array(
"ids" => $a_rec[
"Id"])
502 case "exc_assignment":
503 switch ($a_version) {
506 "exc_ass_file_order" => array(
"ids" => $a_rec[
"Id"]),
507 "exc_ass_reminders" => array(
"ids" => $a_rec[
"Id"])
523 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
530 if ($new_id = $a_mapping->getMapping(
'Services/Container',
'objs', $a_rec[
'Id'])) {
534 $newObj->setType(
"exc");
535 $newObj->create(
true);
538 $newObj->setTitle($a_rec[
"Title"]);
539 $newObj->setDescription($a_rec[
"Description"]);
540 $newObj->setPassMode($a_rec[
"PassMode"]);
541 $newObj->setPassNr($a_rec[
"PassNr"]);
542 $newObj->setNrMandatoryRandom((
int) $a_rec[
"NrMandatoryRandom"]);
543 $newObj->setShowSubmissions($a_rec[
"ShowSubmissions"]);
544 $newObj->setCompletionBySubmission($a_rec[
"ComplBySubmission"]);
545 $newObj->setTutorFeedback($a_rec[
"Tfeedback"]);
548 $this->current_exc = $newObj;
550 $a_mapping->addMapping(
"Modules/Exercise",
"exc", $a_rec[
"Id"], $newObj->getId());
551 $a_mapping->addMapping(
'Services/Object',
'objs', $a_rec[
'Id'], $newObj->getId());
552 $a_mapping->addMapping(
'Services/AdvancedMetaData',
'parent', $a_rec[
'Id'], $newObj->getId());
553 $a_mapping->addMapping(
556 $a_rec[
"Id"] .
":0:exc",
557 $newObj->getId() .
":0:exc" 561 case "exc_assignment":
562 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"ExerciseId"]);
564 if (is_object($this->current_exc) && $this->current_exc->getId() == $exc_id) {
565 $exc = $this->current_exc;
571 $ass->setExerciseId($exc_id);
573 if ($a_rec[
"StartTime"] !=
"") {
578 if ($a_rec[
"Deadline"] !=
"") {
583 $ass->setInstruction($a_rec[
"Instruction"]);
584 $ass->setTitle($a_rec[
"Title"]);
585 $ass->setMandatory($a_rec[
"Mandatory"]);
586 $ass->setOrderNr($a_rec[
"OrderNr"]);
589 $ass->setType($a_rec[
"Type"]);
592 $ass->setPeerReview($a_rec[
"Peer"]);
593 $ass->setPeerReviewMin($a_rec[
"PeerMin"]);
594 $ass->setPeerReviewDeadline($a_rec[
"PeerDeadline"]);
595 $ass->setFeedbackFile($a_rec[
"FeedbackFile"]);
596 $ass->setFeedbackCron($a_rec[
"FeedbackCron"]);
597 $ass->setFeedbackDate($a_rec[
"FeedbackDate"]);
600 $ass->setPeerReviewFileUpload($a_rec[
"PeerFile"]);
601 $ass->setPeerReviewPersonalized($a_rec[
"PeerPersonal"]);
604 if ($a_rec[
"Deadline2"] !=
"") {
606 $ass->setExtendedDeadline($deadline->get(
IL_CAL_UNIX));
608 $ass->setMaxFile($a_rec[
"MaxFile"]);
609 $ass->setTeamTutor($a_rec[
"TeamTutor"]);
610 $ass->setPeerReviewChars($a_rec[
"PeerChar"]);
611 $ass->setPeerReviewSimpleUnlock($a_rec[
"PeerUnlock"]);
612 $ass->setPeerReviewValid($a_rec[
"PeerValid"]);
613 $ass->setPeerReviewText($a_rec[
"PeerText"]);
614 $ass->setPeerReviewRating($a_rec[
"PeerRating"]);
617 $ass->setFeedbackDateCustom($a_rec[
"FbDateCustom"]);
618 $ass->setRelDeadlineLastSubmission($a_rec[
"RelDeadlineLastSubm"]);
619 $ass->setDeadlineMode($a_rec[
"DeadlineMode"]);
620 $ass->setRelativeDeadline($a_rec[
"RelativeDeadline"]);
623 if ($a_rec[
"PeerCritCat"]) {
624 $ass->setPeerReviewCriteriaCatalogue($a_mapping->getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"PeerCritCat"]));
633 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
636 $target_dir = $fstorage->getPath();
641 $dir = str_replace(
"..",
"", $a_rec[
"FeedbackDir"]);
644 $target_dir = $fstorage->getGlobalFeedbackPath();
651 $dir = str_replace(
"..",
"", $a_rec[
"WebDataDir"]);
654 $target_dir = $fwebstorage->getPath();
661 $ar->setId($ass->getId());
662 $ar->setTemplateRefId(0);
663 $ar->setContainerRefId(0);
667 $a_mapping->addMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"Id"], $ass->getId());
673 $exc_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc", $a_rec[
"Parent"]);
676 $crit_cat->setParent($exc_id);
677 $crit_cat->setTitle($a_rec[
"Title"]);
678 $crit_cat->setPosition($a_rec[
"Pos"]);
681 $a_mapping->addMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Id"], $crit_cat->getId());
686 $crit_cat_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Parent"]);
687 if ($crit_cat_id > 0) {
689 $crit->setParent($crit_cat_id);
690 $crit->setTitle($a_rec[
"Title"]);
691 $crit->setDescription($a_rec[
"Descr"]);
692 $crit->setPosition($a_rec[
"Pos"]);
693 $crit->setRequired($a_rec[
"Required"]);
694 $crit->importDefinition($a_rec[
"Def"], $a_rec[
"DefJson"]);
699 case "exc_ass_file_order":
701 $ass_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"AssignmentId"]);
707 case "exc_ass_reminders":
709 $new_ass_id = $a_mapping->getMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"AssId"]);
710 $new_exc_id = $a_mapping->getMapping(
'Modules/Exercise',
'exc', $a_rec[
'ExcId']);
714 $rmd->setReminderStatus($a_rec[
"Status"]);
715 $rmd->setReminderStart($a_rec[
"Start"]);
717 $rmd->setReminderFrequency($a_rec[
"Freq"]);
718 $rmd->setReminderLastSend($a_rec[
"LastSend"]);
719 $rmd->setReminderMailTemplate($a_rec[
"TemplateId"]);
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.
Item group active record class.
getXmlRecord($a_entity, $a_version, $a_set)
Get xml record (export)
create()
Create directory.
TODO: import/export reminder data with the exercise/assignment.
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
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.