588 $a_rec = $this->
stripTags($a_rec, [
"Instruction"]);
590 $a_rec[
"Instruction"] = $purifier->purify((
string) ($a_rec[
"Instruction"] ??
""));
594 if ($new_id = $a_mapping->
getMapping(
'Services/Container',
'objs', $a_rec[
'Id'])) {
598 $newObj->setType(
"exc");
602 $newObj->setTitle($a_rec[
"Title"]);
603 $newObj->setDescription($a_rec[
"Description"]);
604 $newObj->setPassMode($a_rec[
"PassMode"]);
605 $newObj->setPassNr((
int) $a_rec[
"PassNr"]);
606 $newObj->setNrMandatoryRandom((
int) $a_rec[
"NrMandatoryRandom"]);
607 $newObj->setShowSubmissions((
bool) (
int) $a_rec[
"ShowSubmissions"]);
608 $newObj->setCompletionBySubmission((
bool) (
int) $a_rec[
"ComplBySubmission"]);
609 $newObj->setTutorFeedback((
int) $a_rec[
"Tfeedback"]);
612 $this->current_exc = $newObj;
614 $a_mapping->
addMapping(
"Modules/Exercise",
"exc", $a_rec[
"Id"], $newObj->getId());
615 $a_mapping->
addMapping(
'Services/Object',
'objs', $a_rec[
'Id'], $newObj->getId());
616 $a_mapping->
addMapping(
'Services/AdvancedMetaData',
'parent', $a_rec[
'Id'], $newObj->getId());
620 $a_rec[
"Id"] .
":0:exc",
621 $newObj->getId() .
":0:exc" 625 case "exc_assignment":
626 $exc_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc", $a_rec[
"ExerciseId"]);
628 if (is_object($this->current_exc) && $this->current_exc->getId() == $exc_id) {
635 $ass->setExerciseId($exc_id);
637 if ($a_rec[
"StartTime"] !=
"") {
642 if ($a_rec[
"Deadline"] !=
"") {
647 $ass->setInstruction($a_rec[
"Instruction"] ??
"");
648 $ass->setTitle($a_rec[
"Title"] ??
"");
649 $ass->setMandatory((
bool) ($a_rec[
"Mandatory"] ??
false));
650 $ass->setOrderNr((
int) ($a_rec[
"OrderNr"] ?? 0));
653 $ass->setType((
int) ($a_rec[
"Type"] ?? 0));
656 $ass->setPeerReview((
bool) ($a_rec[
"Peer"] ??
false));
657 $ass->setPeerReviewMin((
int) ($a_rec[
"PeerMin"] ?? 0));
658 $ass->setPeerReviewDeadline((
int) $a_rec[
"PeerDeadline"]);
659 $ass->setFeedbackFile($a_rec[
"FeedbackFile"] ??
"");
660 $ass->setFeedbackCron((
bool) ($a_rec[
"FeedbackCron"] ??
false));
661 $ass->setFeedbackDate((
int) ($a_rec[
"FeedbackDate"] ?? 0));
664 $ass->setPeerReviewFileUpload((
bool) ($a_rec[
"PeerFile"] ??
false));
665 $ass->setPeerReviewPersonalized((
bool) ($a_rec[
"PeerPersonal"] ??
false));
668 if (($a_rec[
"Deadline2"] ??
"") !==
"") {
670 $ass->setExtendedDeadline($deadline->get(
IL_CAL_UNIX));
672 $ass->setMaxFile((
int) ($a_rec[
"MaxFile"] ?? 0));
673 $ass->setTeamTutor((
bool) ($a_rec[
"TeamTutor"] ??
false));
674 $ass->setPeerReviewChars((
int) ($a_rec[
"PeerChar"] ?? null));
675 $ass->setPeerReviewSimpleUnlock((
int) ($a_rec[
"PeerUnlock"] ?? 0));
676 $ass->setPeerReviewValid((
int) ($a_rec[
"PeerValid"] ?? 0));
677 $ass->setPeerReviewText((
bool) ($a_rec[
"PeerText"] ??
false));
678 $ass->setPeerReviewRating((
bool) ($a_rec[
"PeerRating"] ??
false));
681 $ass->setFeedbackDateCustom((
int) ($a_rec[
"FbDateCustom"] ?? 0));
682 $ass->setRelDeadlineLastSubmission((
int) ($a_rec[
"RelDeadlineLastSubm"] ?? 0));
683 $ass->setDeadlineMode((
int) ($a_rec[
"DeadlineMode"] ?? 0));
684 $ass->setRelativeDeadline((
int) ($a_rec[
"RelativeDeadline"] ?? 0));
687 if ($a_rec[
"PeerCritCat"]) {
688 $ass->setPeerReviewCriteriaCatalogue((
int) $a_mapping->
getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"PeerCritCat"]));
697 $dir = str_replace(
"..",
"", ($a_rec[
"InstructionCollection"] ??
""));
699 $if = $this->ass_domain->instructionFiles($ass->getId());
702 $dir = str_replace(
"..",
"", ($a_rec[
"Dir"] ??
""));
704 $if = $this->ass_domain->instructionFiles($ass->getId());
707 $dir = str_replace(
"..",
"", ($a_rec[
"WebDataDir"] ??
""));
709 $if = $this->ass_domain->instructionFiles($ass->getId());
715 $dir = str_replace(
"..",
"", $a_rec[
"FeedbackDir"]);
718 $target_dir = $fstorage->getGlobalFeedbackPath();
725 $ar->setId($ass->getId());
726 $ar->setTemplateRefId(0);
727 $ar->setContainerRefId(0);
731 $a_mapping->
addMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"Id"], $ass->getId());
737 $exc_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc", $a_rec[
"Parent"]);
740 $crit_cat->setParent($exc_id);
741 $crit_cat->setTitle($a_rec[
"Title"]);
742 $crit_cat->setPosition($a_rec[
"Pos"]);
745 $a_mapping->
addMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Id"], $crit_cat->getId());
750 $crit_cat_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc_crit_cat", $a_rec[
"Parent"]);
751 if ($crit_cat_id > 0) {
753 $crit->setParent($crit_cat_id);
754 $crit->setTitle($a_rec[
"Title"]);
755 $crit->setDescription($a_rec[
"Descr"]);
756 $crit->setPosition($a_rec[
"Pos"]);
757 $crit->setRequired($a_rec[
"Required"]);
758 $crit->importDefinition($a_rec[
"Def"], $a_rec[
"DefJson"]);
763 case "exc_ass_file_order":
765 $ass_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"AssignmentId"]);
771 case "exc_ass_reminders":
773 $new_ass_id = $a_mapping->
getMapping(
"Modules/Exercise",
"exc_assignment", $a_rec[
"AssId"]);
774 $new_exc_id = $a_mapping->
getMapping(
'Modules/Exercise',
'exc', $a_rec[
'ExcId']);
778 $rmd->setReminderStatus($a_rec[
"Status"]);
779 $rmd->setReminderStart((
int) ($a_rec[
"Start"] ?? 0));
780 $rmd->setReminderEnd((
int) $end->get(
IL_CAL_UNIX));
781 $rmd->setReminderFrequency((
int) ($a_rec[
"Freq"] ?? 0));
782 $rmd->setReminderLastSend((
int) ($a_rec[
"LastSend"] ?? 0));
783 $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...
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=[])