ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilExerciseDerivedTaskAction.php
Go to the documentation of this file.
1<?php
2
26{
27 protected \ILIAS\Exercise\Submission\SubmissionRepository $submission_repo;
31
32 public function __construct(
36 \ILIAS\Exercise\Submission\SubmissionRepository $submission_repo
37 ) {
38 $this->exc_mem_repo = $exc_mem_repo;
39 $this->state_repo = $state_repo;
40 $this->tutor_repo = $tutor_repo;
41 $this->submission_repo = $submission_repo;
42 }
43
49 public function getOpenAssignmentsOfUser(int $user_id): array
50 {
51 $user_exc_ids = $this->exc_mem_repo->getExerciseIdsOfUser($user_id);
52 $assignments = [];
53
54 $submission_states = $this->submission_repo->getUserSubmissionState(
56 $this->state_repo->getSubmitableAssignmentIdsOfUser($user_exc_ids, $user_id)
57 );
58 foreach ($submission_states as $ass_id => $submitted) {
59 if (!$submitted) {
60 $assignments[] = new ilExAssignment($ass_id);
61 }
62 // to do: permission check
63 }
64 return $assignments;
65 }
66
73 public function getOpenPeerReviewsOfUser(int $user_id): array
74 {
75 $user_exc_ids = $this->exc_mem_repo->getExerciseIdsOfUser($user_id);
76 $assignments = [];
77 foreach ($this->state_repo->getAssignmentIdsWithPeerFeedbackNeeded($user_exc_ids, $user_id) as $ass_id) {
78 $assignments[] = new ilExAssignment($ass_id);
79 // to do: permission check
80 }
81 return $assignments;
82 }
83
90 public function getOpenGradingsOfUser(int $user_id): array
91 {
92 $user_exc_ids = $this->tutor_repo->getExerciseIdsBeingTutor($user_id);
93 $assignments = [];
94 foreach (array_keys($this->state_repo->getAssignmentIdsWithGradingNeeded($user_exc_ids)) as $ass_id) {
95 $assignments[] = new ilExAssignment($ass_id);
96 // to do: permission check
97 }
98 return $assignments;
99 }
100}
Exercise assignment.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilExcAssMemberStateRepository $state_repo
ILIAS Exercise Submission SubmissionRepository $submission_repo
getOpenPeerReviewsOfUser(int $user_id)
Get all open peer reviews of a user.
__construct(ilExcMemberRepository $exc_mem_repo, ilExcAssMemberStateRepository $state_repo, ilExcTutorRepository $tutor_repo, \ILIAS\Exercise\Submission\SubmissionRepository $submission_repo)
getOpenAssignmentsOfUser(int $user_id)
Get all open assignments of a user.
getOpenGradingsOfUser(int $user_id)
Get all open gradings of a user.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.