ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilExerciseDerivedTaskAction.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
17 protected $exc_mem_repo;
18
22 protected $state_repo;
23
28 public function __construct(
31 ilExcTutorRepository $tutor_repo
32 ) {
33 $this->exc_mem_repo = $exc_mem_repo;
34 $this->state_repo = $state_repo;
35 $this->tutor_repo = $tutor_repo;
36 }
37
44 public function getOpenAssignmentsOfUser(int $user_id) : array
45 {
46 $user_exc_ids = $this->exc_mem_repo->getExerciseIdsOfUser($user_id);
47 $assignments = [];
48 foreach ($this->state_repo->getSubmitableAssignmentIdsOfUser($user_exc_ids, $user_id) as $ass_id) {
49 $assignments[] = new ilExAssignment($ass_id);
50 // to do: permission check
51 }
52 return $assignments;
53 }
54
61 public function getOpenPeerReviewsOfUser(int $user_id) : array
62 {
63 $user_exc_ids = $this->exc_mem_repo->getExerciseIdsOfUser($user_id);
64 $assignments = [];
65 foreach ($this->state_repo->getAssignmentIdsWithPeerFeedbackNeeded($user_exc_ids, $user_id) as $ass_id) {
66 $assignments[] = new ilExAssignment($ass_id);
67 // to do: permission check
68 }
69 return $assignments;
70 }
71
78 public function getOpenGradingsOfUser(int $user_id) : array
79 {
80 $user_exc_ids = $this->tutor_repo->getExerciseIdsBeingTutor($user_id);
81 $assignments = [];
82 foreach ($this->state_repo->getAssignmentIdsWithGradingNeeded($user_exc_ids) as $ass_id => $open) {
83 $assignments[] = new ilExAssignment($ass_id);
84 // to do: permission check
85 }
86 return $assignments;
87 }
88}
An exception for terminatinating execution or to throw for unit testing.
Exercise assignment.
This class determines assignment member state information directly on the persistence layer.
This should hold all accesses to exc_members table in the future.
Action class for derived tasks, mostly getting user reponsibilities by respecting permissions as well...
getOpenPeerReviewsOfUser(int $user_id)
Get all open peer reviews of a user.
getOpenAssignmentsOfUser(int $user_id)
Get all open assignments of a user.
__construct(ilExcMemberRepository $exc_mem_repo, ilExcAssMemberStateRepository $state_repo, ilExcTutorRepository $tutor_repo)
Constructor.
getOpenGradingsOfUser(int $user_id)
Get all open gradings of a user.