ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 randomAssignments (\ilObjExercise $exercise, \ilObjUser $user=null)
 Get random assignment manager. More...
 
 mandatoryAssignments (\ilObjExercise $exercise)
 Get mandatory assignment manager. More...
 

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 30 of file class.DomainService.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References ILIAS\Exercise\Assignment\DomainService\$domain_service, and ILIAS\Exercise\Assignment\DomainService\$repo_service.

42  {
43  $this->domain_service = $domain_service;
44  $this->repo_service = $repo_service;
45  }

Member Function Documentation

◆ mandatoryAssignments()

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

Get mandatory assignment manager.

Exceptions

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

References ilObject\getId(), and ILIAS\Exercise\Assignment\DomainService\randomAssignments().

69  : Mandatory\MandatoryAssignmentsManager
70  {
71  if (!isset(self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()])) {
72  self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()] =
73  new Mandatory\MandatoryAssignmentsManager($exercise, $this->randomAssignments($exercise));
74  }
75  return self::$managers[Mandatory\MandatoryAssignmentsManager::class][$exercise->getId()];
76  }
randomAssignments(\ilObjExercise $exercise, \ilObjUser $user=null)
Get random assignment manager.
+ 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 51 of file class.DomainService.php.

References ilObject\getId().

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

51  : Mandatory\RandomAssignmentsManager
52  {
53  if (!isset(self::$managers[Mandatory\RandomAssignmentsManager::class][$exercise->getId()])) {
54  self::$managers[Mandatory\RandomAssignmentsManager::class][$exercise->getId()] =
55  new Mandatory\RandomAssignmentsManager(
56  $exercise,
57  $this->repo_service->assignment()->randomAssignments(),
58  $this->repo_service->submission(),
59  $user
60  );
61  }
62  return self::$managers[Mandatory\RandomAssignmentsManager::class][$exercise->getId()];
63  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $domain_service

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

◆ $managers

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

Definition at line 37 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: