ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Exercise\Assignment\DomainService Class Reference

Assignments domain service. More...

+ Collaboration diagram for ILIAS\Exercise\Assignment\DomainService:

Public Member Functions

 __construct (InternalDomainService $domain_service, InternalRepoService $repo_service)
 
 assignments (int $obj_id, int $user_id)
 
 randomAssignments (\ilObjExercise $exercise, ?\ilObjUser $user=null)
 Get random assignment manager. More...
 
 mandatoryAssignments (\ilObjExercise $exercise)
 Get mandatory assignment manager. More...
 
 state (int $ass_id, int $user_id)
 
 instructionFiles (int $ass_id)
 
 sampleSolution (int $ass_id)
 
 tutorFeedbackFile (int $ass_id)
 
 tutorFeedbackZip ()
 
 getAssignment (int $ass_id)
 

Protected Attributes

InternalDomainService $domain_service
 
InternalRepoService $repo_service
 

Static Protected Attributes

static array $managers = []
 

Detailed Description

Assignments domain service.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 35 of file class.DomainService.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\Assignment\DomainService::__construct ( InternalDomainService  $domain_service,
InternalRepoService  $repo_service 
)

Member Function Documentation

◆ assignments()

ILIAS\Exercise\Assignment\DomainService::assignments ( int  $obj_id,
int  $user_id 
)

Definition at line 53 of file class.DomainService.php.

53 : AssignmentManager
54 {
55 return new AssignmentManager(
56 $this->repo_service,
57 $this->domain_service,
58 $obj_id,
60 );
61 }

References $user_id.

◆ getAssignment()

ILIAS\Exercise\Assignment\DomainService::getAssignment ( int  $ass_id)
Exceptions

ilExcUnknownAssignmentTypeException

Definition at line 150 of file class.DomainService.php.

151 {
152 return new \ilExAssignment($ass_id);
153 }
Exercise assignment.

References $ass_id.

◆ instructionFiles()

ILIAS\Exercise\Assignment\DomainService::instructionFiles ( int  $ass_id)

Definition at line 99 of file class.DomainService.php.

99 : InstructionFileManager
100 {
101 $stakeholder = new \ilExcInstructionFilesStakeholder();
102 return new InstructionFileManager(
103 $ass_id,
104 $this->repo_service->instructionFiles(),
105 $stakeholder
106 );
107 }

References $ass_id.

◆ mandatoryAssignments()

ILIAS\Exercise\Assignment\DomainService::mandatoryAssignments ( \ilObjExercise  $exercise)

Get mandatory assignment manager.

Exceptions

ilExcUnknownAssignmentTypeException

Definition at line 85 of file class.DomainService.php.

85 : Mandatory\MandatoryAssignmentsManager
86 {
87 if (!isset(self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()])) {
88 self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()] =
89 new Mandatory\MandatoryAssignmentsManager($exercise, $this->randomAssignments($exercise));
90 }
91 return self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()];
92 }
randomAssignments(\ilObjExercise $exercise, ?\ilObjUser $user=null)
Get random assignment manager.

References $exercise, and ILIAS\Exercise\Assignment\DomainService\randomAssignments().

+ Here is the call graph for this function:

◆ randomAssignments()

ILIAS\Exercise\Assignment\DomainService::randomAssignments ( \ilObjExercise  $exercise,
?\ilObjUser  $user = null 
)

Get random assignment manager.

The manager is used if the "Pass Mode" is set to "Random Selection" in the exercise settings.

Definition at line 67 of file class.DomainService.php.

67 : Mandatory\RandomAssignmentsManager
68 {
69 if (!isset(self::$managers[Mandatory\RandomAssignmentsManager::class][$exercise->getId()])) {
70 self::$managers[Mandatory\RandomAssignmentsManager::class][$exercise->getId()] =
71 new Mandatory\RandomAssignmentsManager(
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 }

References $exercise.

Referenced by ILIAS\Exercise\Assignment\DomainService\mandatoryAssignments().

+ Here is the caller graph for this function:

◆ sampleSolution()

ILIAS\Exercise\Assignment\DomainService::sampleSolution ( int  $ass_id)

Definition at line 109 of file class.DomainService.php.

109 : SampleSolutionManager
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 }

References $ass_id.

◆ state()

ILIAS\Exercise\Assignment\DomainService::state ( int  $ass_id,
int  $user_id 
)

Definition at line 94 of file class.DomainService.php.

95 {
96 return \ilExcAssMemberState::getInstanceByIds($ass_id, $user_id);
97 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ass_id, and $user_id.

◆ tutorFeedbackFile()

ILIAS\Exercise\Assignment\DomainService::tutorFeedbackFile ( int  $ass_id)

Definition at line 120 of file class.DomainService.php.

120 : TutorFeedbackFileManager
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 }

References $ass_id.

◆ tutorFeedbackZip()

ILIAS\Exercise\Assignment\DomainService::tutorFeedbackZip ( )

Definition at line 135 of file class.DomainService.php.

135 : TutorFeedbackZipManager
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 }

Field Documentation

◆ $domain_service

InternalDomainService ILIAS\Exercise\Assignment\DomainService::$domain_service
protected

◆ $managers

array ILIAS\Exercise\Assignment\DomainService::$managers = []
staticprotected

Definition at line 42 of file class.DomainService.php.

◆ $repo_service

InternalRepoService ILIAS\Exercise\Assignment\DomainService::$repo_service
protected

The documentation for this class was generated from the following file: