ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ExerciseManager.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Exercise;
22 
31 
33 {
34  public function __construct(
35  protected InternalRepoService $repo,
36  protected InternalDomainService $domain,
37  protected $obj_id
38  ) {
39  }
40 
41  public function delete(
42  \ilObjExercise $exc
43  ): void {
44  // delete assignments
45  $ass_manager = $this->domain->assignment()->assignments(
46  $this->obj_id,
47  0
48  );
49  foreach ($ass_manager->getAll() as $assignment) {
50  $this->domain->assignment()->getAssignment(
51  $assignment->getId()
52  )->delete($exc, false);
53  }
54 
55  foreach (\ilExcCriteriaCatalogue::getInstancesByParentId($this->obj_id) as $crit_cat) {
56  $crit_cat->delete();
57  }
58  }
59 }
__construct(protected InternalRepoService $repo, protected InternalDomainService $domain, protected $obj_id)
static getInstancesByParentId(int $a_parent_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjExercise.