ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.DomainService.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30
36{
39
40 // for managers that need to be created
41 // on the fly and should be cached
42 protected static array $managers = [];
43
44 public function __construct(
47 ) {
48 $this->domain_service = $domain_service;
49 $this->repo_service = $repo_service;
50 }
51
52
53 public function assignments(int $obj_id, int $user_id): AssignmentManager
54 {
55 return new AssignmentManager(
56 $this->repo_service,
57 $this->domain_service,
58 $obj_id,
60 );
61 }
62
67 public function randomAssignments(\ilObjExercise $exercise, ?\ilObjUser $user = null): Mandatory\RandomAssignmentsManager
68 {
69 if (!isset(self::$managers[Mandatory\RandomAssignmentsManager::class][$exercise->getId()])) {
70 self::$managers[Mandatory\RandomAssignmentsManager::class][$exercise->getId()] =
73 $this->repo_service->assignment()->randomAssignments(),
74 $this->repo_service->submission(),
75 $user
76 );
77 }
78 return self::$managers[Mandatory\RandomAssignmentsManager::class][$exercise->getId()];
79 }
80
86 {
87 if (!isset(self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()])) {
88 self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()] =
90 }
91 return self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()];
92 }
93
94 public function state(int $ass_id, int $user_id): \ilExcAssMemberState
95 {
96 return \ilExcAssMemberState::getInstanceByIds($ass_id, $user_id);
97 }
98
100 {
101 $stakeholder = new \ilExcInstructionFilesStakeholder();
102 return new InstructionFileManager(
103 $ass_id,
104 $this->repo_service->instructionFiles(),
105 $stakeholder
106 );
107 }
108
110 {
111 $stakeholder = new \ilExcSampleSolutionStakeholder();
112 return new SampleSolutionManager(
113 $ass_id,
114 $this->repo_service->sampleSolution(),
115 $stakeholder,
116 $this->domain_service
117 );
118 }
119
121 {
122 $stakeholder = new \ilExcTutorFeedbackFileStakeholder();
123 $team_stakeholder = new \ilExcTutorTeamFeedbackFileStakeholder();
124 $observer = new TutorFeedbackFileObserver($this->domain_service, $ass_id);
125 return new TutorFeedbackFileManager(
126 $ass_id,
127 $this->repo_service,
128 $this->domain_service,
129 $stakeholder,
130 $team_stakeholder,
131 $observer
132 );
133 }
134
136 {
137 $stakeholder = new \ilExcTutorFeedbackZipStakeholder();
138 $user_stakeholder = new \ilExcTutorFeedbackFileStakeholder();
139 return new TutorFeedbackZipManager(
140 $this->repo_service,
141 $this->domain_service,
142 $stakeholder,
143 $user_stakeholder
144 );
145 }
146
150 public function getAssignment(int $ass_id): \ilExAssignment
151 {
152 return new \ilExAssignment($ass_id);
153 }
154
155}
randomAssignments(\ilObjExercise $exercise, ?\ilObjUser $user=null)
Get random assignment manager.
__construct(InternalDomainService $domain_service, InternalRepoService $repo_service)
mandatoryAssignments(\ilObjExercise $exercise)
Get mandatory assignment manager.
Manages random mandatory assignments of an exercise (business logic)
Exercise assignment.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjExercise.
User class.