525 $a_rec = $this->
stripTags($a_rec, [
"Instruction"]);
527 $a_rec[
"Instruction"] = $purifier->purify((
string) ($a_rec[
"Instruction"] ??
""));
531 if ($new_id = $a_mapping->
getMapping(
'Services/Container',
'objs', $a_rec[
'Id'])) {
535 $newObj->setType(
"exc");
539 $newObj->setTitle($a_rec[
"Title"]);
540 $newObj->setDescription($a_rec[
"Description"]);
541 $newObj->setPassMode($a_rec[
"PassMode"]);
542 $newObj->setPassNr((
int) $a_rec[
"PassNr"]);
543 $newObj->setNrMandatoryRandom((
int) $a_rec[
"NrMandatoryRandom"]);
544 $newObj->setShowSubmissions((
bool) (
int) $a_rec[
"ShowSubmissions"]);
545 $newObj->setCompletionBySubmission((
bool) (
int) $a_rec[
"ComplBySubmission"]);
546 $newObj->setTutorFeedback((
int) $a_rec[
"Tfeedback"]);
549 $this->current_exc = $newObj;
551 $a_mapping->
addMapping(
"Modules/Exercise",
"exc", $a_rec[
"Id"], $newObj->getId());
552 $a_mapping->
addMapping(
'Services/Object',
'objs', $a_rec[
'Id'], $newObj->getId());
553 $a_mapping->
addMapping(
'Services/AdvancedMetaData',
'parent', $a_rec[
'Id'], $newObj->getId());
557 $a_rec[
"Id"] .
":0:exc",
558 $newObj->getId() .
":0:exc" 562 case "exc_assignment":
563 $exc_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc", $a_rec[
"ExerciseId"]);
565 if (is_object($this->current_exc) && $this->current_exc->getId() == $exc_id) {
572 $ass->setExerciseId($exc_id);
574 if ($a_rec[
"StartTime"] !=
"") {
579 if ($a_rec[
"Deadline"] !=
"") {
584 $ass->setInstruction($a_rec[
"Instruction"] ??
"");
585 $ass->setTitle($a_rec[
"Title"] ??
"");
586 $ass->setMandatory((
bool) ($a_rec[
"Mandatory"] ??
false));
587 $ass->setOrderNr((
int) ($a_rec[
"OrderNr"] ?? 0));
590 $ass->setType((
int) ($a_rec[
"Type"] ?? 0));
593 $ass->setPeerReview((
bool) ($a_rec[
"Peer"] ??
false));
594 $ass->setPeerReviewMin((
int) ($a_rec[
"PeerMin"] ?? 0));
595 $ass->setPeerReviewDeadline((
int) $a_rec[
"PeerDeadline"]);
596 $ass->setFeedbackFile($a_rec[
"FeedbackFile"] ??
"");
597 $ass->setFeedbackCron((
bool) ($a_rec[
"FeedbackCron"] ??
false));
598 $ass->setFeedbackDate((
int) ($a_rec[
"FeedbackDate"] ?? 0));
601 $ass->setPeerReviewFileUpload((
bool) ($a_rec[
"PeerFile"] ??
false));
602 $ass->setPeerReviewPersonalized((
bool) ($a_rec[
"PeerPersonal"] ??
false));
605 if (($a_rec[
"Deadline2"] ??
"") !==
"") {
607 $ass->setExtendedDeadline($deadline->get(
IL_CAL_UNIX));
609 $ass->setMaxFile((
int) ($a_rec[
"MaxFile"] ?? 0));
610 $ass->setTeamTutor((
bool) ($a_rec[
"TeamTutor"] ??
false));
611 $ass->setPeerReviewChars((
int) ($a_rec[
"PeerChar"] ?? null));
612 $ass->setPeerReviewSimpleUnlock((
bool) ($a_rec[
"PeerUnlock"] ??
false));
613 $ass->setPeerReviewValid((
int) ($a_rec[
"PeerValid"] ?? 0));
614 $ass->setPeerReviewText((
bool) ($a_rec[
"PeerText"] ??
false));
615 $ass->setPeerReviewRating((
bool) ($a_rec[
"PeerRating"] ??
false));
618 $ass->setFeedbackDateCustom((
int) ($a_rec[
"FbDateCustom"] ?? 0));
619 $ass->setRelDeadlineLastSubmission((
int) ($a_rec[
"RelDeadlineLastSubm"] ?? 0));
620 $ass->setDeadlineMode((
int) ($a_rec[
"DeadlineMode"] ?? 0));
621 $ass->setRelativeDeadline((
int) ($a_rec[
"RelativeDeadline"] ?? 0));
624 if ($a_rec[
"PeerCritCat"]) {
625 $ass->setPeerReviewCriteriaCatalogue((
int) $a_mapping->
getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"PeerCritCat"]));
634 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
637 $target_dir = $fstorage->getAbsolutePath();
642 $dir = str_replace(
"..",
"", $a_rec[
"FeedbackDir"]);
645 $target_dir = $fstorage->getGlobalFeedbackPath();
652 $dir = str_replace(
"..",
"", $a_rec[
"WebDataDir"]);
655 $target_dir = $fwebstorage->getAbsolutePath();
662 $ar->setId($ass->getId());
663 $ar->setTemplateRefId(0);
664 $ar->setContainerRefId(0);
668 $a_mapping->
addMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"Id"], $ass->getId());
674 $exc_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc", $a_rec[
"Parent"]);
677 $crit_cat->setParent($exc_id);
678 $crit_cat->setTitle($a_rec[
"Title"]);
679 $crit_cat->setPosition($a_rec[
"Pos"]);
682 $a_mapping->
addMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Id"], $crit_cat->getId());
687 $crit_cat_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Parent"]);
688 if ($crit_cat_id > 0) {
690 $crit->setParent($crit_cat_id);
691 $crit->setTitle($a_rec[
"Title"]);
692 $crit->setDescription($a_rec[
"Descr"]);
693 $crit->setPosition($a_rec[
"Pos"]);
694 $crit->setRequired($a_rec[
"Required"]);
695 $crit->importDefinition($a_rec[
"Def"], $a_rec[
"DefJson"]);
700 case "exc_ass_file_order":
702 $ass_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"AssignmentId"]);
708 case "exc_ass_reminders":
710 $new_ass_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"AssId"]);
711 $new_exc_id = $a_mapping->
getMapping(
'Modules/Exercise',
'exc', $a_rec[
'ExcId']);
715 $rmd->setReminderStatus($a_rec[
"Status"]);
716 $rmd->setReminderStart((
int) ($a_rec[
"Start"] ?? 0));
717 $rmd->setReminderEnd((
int) $end->get(
IL_CAL_UNIX));
718 $rmd->setReminderFrequency((
int) ($a_rec[
"Freq"] ?? 0));
719 $rmd->setReminderLastSend((
int) ($a_rec[
"LastSend"] ?? 0));
720 $rmd->setReminderMailTemplate((
int) ($a_rec[
"TemplateId"] ?? 0));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static getInstanceByType(string $a_type)
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMapping(string $a_comp, string $a_entity, string $a_old_id)
ilObjExercise $current_exc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static instructionFileInsertOrder(string $a_filename, int $a_ass_id, int $a_order_nr=0)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
create()
Create directory.
stripTags(array $rec, array $omit_keys=[])