ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilIndividualAssessmentMembersGUI Class Reference

For the purpose of streamlining the grading and learning-process status definition outside of tests, SCORM courses e.t.c. More...

+ Collaboration diagram for ilIndividualAssessmentMembersGUI:

Public Member Functions

 __construct (ilObjIndividualAssessmentGUI $a_parent_gui, int $a_ref_id)
 
 executeCommand ()
 
 addUsersFromSearch (array $user_ids)
 
 addUsers (array $user_ids)
 Add users to corresponding iass-object. More...
 
 removeUser ()
 Remove users from corresponding iass-object. More...
 

Data Fields

const F_STATUS = "status"
 
const F_SORT = "sortation"
 
const S_NAME_ASC = "user_lastname:asc"
 
const S_NAME_DESC = "user_lastname:desc"
 
const S_EXAMINER_ASC = "examiner_login:asc"
 
const S_EXAMINER_DESC = "examiner_login:desc"
 
const S_CHANGETIME_ASC = "change_time:asc"
 
const S_CHANGETIME_DESC = "change_time:desc"
 

Protected Member Functions

 addedUsers ()
 
 view ()
 
 filterViewableOrGradeableEntries (array $entries)
 
 removeUserConfirmation ()
 Display confirmation form for user might be removed. More...
 
 getViewControls (array $get)
 
 getModeControl (array $get, ViewControl\Factory $vc_factory)
 
 getSortationControl (ViewControl\Factory $vc_factory)
 
 getModeOptions ()
 
 getActiveLabelForModeByFilter ($filter)
 
 getLinkForStatusFilter ($value)
 
 getFilterValue (array $get)
 
 getSortOptions ()
 
 getSortValue (array $get)
 
 txt (string $code)
 

Protected Attributes

 $ctrl
 
 $parent_gui
 
 $ref_id
 
 $tpl
 
 $lng
 
 $object
 
 $iass_access
 

Detailed Description

For the purpose of streamlining the grading and learning-process status definition outside of tests, SCORM courses e.t.c.

the IndividualAssessment is used. It caries a LPStatus, which is set Individually.

@ilCtrl_Calls ilIndividualAssessmentMembersGUI: ilRepositorySearchGUI @ilCtrl_Calls ilIndividualAssessmentMembersGUI: ilIndividualAssessmentMemberGUI

Definition at line 20 of file class.ilIndividualAssessmentMembersGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentMembersGUI::__construct ( ilObjIndividualAssessmentGUI  $a_parent_gui,
int  $a_ref_id 
)

Definition at line 48 of file class.ilIndividualAssessmentMembersGUI.php.

51 {
52 global $DIC;
53 $this->ctrl = $DIC['ilCtrl'];
54 $this->parent_gui = $a_parent_gui;
55 $this->object = $a_parent_gui->object;
56 $this->ref_id = $a_ref_id;
57 $this->tpl = $DIC['tpl'];
58 $this->lng = $DIC['lng'];
59 $this->toolbar = $DIC['ilToolbar'];
60 $this->user = $DIC["ilUser"];
61 $this->iass_access = $this->object->accessHandler();
62 $this->factory = $DIC->ui()->factory();
63 $this->renderer = $DIC->ui()->renderer();
64 }
user()
Definition: user.php:4
global $DIC
Definition: saml.php:7

References $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addedUsers()

ilIndividualAssessmentMembersGUI::addedUsers ( )
protected

Definition at line 106 of file class.ilIndividualAssessmentMembersGUI.php.

107 {
108 if (!$_GET['failure']) {
109 ilUtil::sendSuccess($this->txt('iass_add_user_success'));
110 } else {
111 ilUtil::sendFailure($this->txt('iass_add_user_failure'));
112 }
113 $this->view();
114 }
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_GET, ilUtil\sendFailure(), txt(), and view().

+ Here is the call graph for this function:

◆ addUsers()

ilIndividualAssessmentMembersGUI::addUsers ( array  $user_ids)

Add users to corresponding iass-object.

To be used by repository search.

Parameters
int | string[]$user_ids

Definition at line 206 of file class.ilIndividualAssessmentMembersGUI.php.

207 {
208 if (!$this->iass_access->mayEditMembers()) {
209 $this->parent_gui->handleAccessViolation();
210 }
211 $iass = $this->object;
212 $members = $iass->loadMembers();
213 $failure = null;
214 if (count($user_ids) === 0) {
215 $failure = 1;
216 }
217 foreach ($user_ids as $user_id) {
218 $user = new ilObjUser($user_id);
219 if (!$members->userAllreadyMember($user)) {
220 $members = $members->withAdditionalUser($user);
221 } else {
222 $failure = 1;
223 }
224 }
225 $members->updateStorageAndRBAC($iass->membersStorage(), $iass->accessHandler());
227 $this->ctrl->setParameter($this, 'failure', $failure);
228 $this->ctrl->redirectByClass(array(get_class($this->parent_gui),get_class($this)), 'addedUsers');
229 }
$failure
$user
Definition: migrateto20.php:57

References $failure, $object, $user, and ilIndividualAssessmentLPInterface\updateLPStatusByIds().

Referenced by addUsersFromSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUsersFromSearch()

ilIndividualAssessmentMembersGUI::addUsersFromSearch ( array  $user_ids)
Parameters
int[]

Definition at line 191 of file class.ilIndividualAssessmentMembersGUI.php.

192 {
193 if ($user_ids && is_array($user_ids) && !empty($user_ids)) {
194 $this->addUsers($user_ids);
195 }
196
197 ilUtil::sendInfo($this->txt("search_no_selection"), true);
198 $this->ctrl->redirectByClass(array(get_class($this->parent_gui),get_class($this)), 'view');
199 }
addUsers(array $user_ids)
Add users to corresponding iass-object.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References addUsers(), ilUtil\sendInfo(), and txt().

+ Here is the call graph for this function:

◆ executeCommand()

ilIndividualAssessmentMembersGUI::executeCommand ( )

Definition at line 66 of file class.ilIndividualAssessmentMembersGUI.php.

67 {
68 if (
69 !$this->iass_access->mayEditMembers()
70 && !$this->iass_access->mayGradeUser()
71 && !$this->iass_access->mayViewUser()
72 && !$this->iass_access->mayAmendGradeUser()
73 ) {
74 $this->parent_gui->handleAccessViolation();
75 }
76
77 $cmd = $this->ctrl->getCmd();
78 $next_class = $this->ctrl->getNextClass();
79 $this->ctrl->saveParameterByClass("ilIndividualAssessmentMembersGUI", self::F_STATUS);
80 switch ($next_class) {
81 case "ilrepositorysearchgui":
82 require_once 'Services/Search/classes/class.ilRepositorySearchGUI.php';
83 $rep_search = new ilRepositorySearchGUI();
84 $rep_search->setCallback($this, "addUsersFromSearch");
85 $rep_search->addUserAccessFilterCallable(
86 function ($a_user_ids) {
87 return $a_user_ids;
88 }
89 );
90 $this->ctrl->forwardCommand($rep_search);
91 break;
92 case "ilindividualassessmentmembergui":
93 require_once 'Modules/IndividualAssessment/classes/class.ilIndividualAssessmentMemberGUI.php';
94 $member = new ilIndividualAssessmentMemberGUI($this, $this->parent_gui, $this->ref_id);
95 $this->ctrl->forwardCommand($member);
96 break;
97 default:
98 if (!$cmd) {
99 $cmd = 'view';
100 }
101 $this->$cmd();
102 break;
103 }
104 }
For the purpose of streamlining the grading and learning-process status definition outside of tests,...

◆ filterViewableOrGradeableEntries()

ilIndividualAssessmentMembersGUI::filterViewableOrGradeableEntries ( array  $entries)
protected

Definition at line 176 of file class.ilIndividualAssessmentMembersGUI.php.

176 : array
177 {
178 $user_ids = array_map(function ($e) {
179 return $e->id();
180 }, $entries);
181 $viewable_or_gradeable_entries = $this->iass_access->filterViewableOrGradeableUsers($user_ids);
182
183 return array_filter($entries, function ($e) use ($viewable_or_gradeable_entries) {
184 return in_array($e->id(), $viewable_or_gradeable_entries);
185 });
186 }

Referenced by view().

+ Here is the caller graph for this function:

◆ getActiveLabelForModeByFilter()

ilIndividualAssessmentMembersGUI::getActiveLabelForModeByFilter (   $filter)
protected
Parameters
int | string | null$filter

Definition at line 334 of file class.ilIndividualAssessmentMembersGUI.php.

334 : string
335 {
336 switch ($filter) {
338 return $this->txt("iass_filter_not_started");
339 break;
341 return $this->txt("iass_filter_not_finalized");
342 break;
344 return $this->txt("iass_filter_finalized");
345 break;
347 return $this->txt("iass_filter_failed");
348 break;
349 default:
350 return $this->txt("iass_filter_all");
351 }
352 }

References ilIndividualAssessmentMembers\LP_ASSESSMENT_NOT_COMPLETED, ilIndividualAssessmentMembers\LP_COMPLETED, ilIndividualAssessmentMembers\LP_FAILED, ilIndividualAssessmentMembers\LP_IN_PROGRESS, and txt().

Referenced by getModeControl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilterValue()

ilIndividualAssessmentMembersGUI::getFilterValue ( array  $get)
protected
Parameters
string[]$get
Returns
int|string|null

Definition at line 370 of file class.ilIndividualAssessmentMembersGUI.php.

371 {
372 if (isset($get[self::F_STATUS])
373 && $get[self::F_STATUS] != ""
374 && in_array(
375 $get[self::F_STATUS],
376 [
381 ]
382 )
383 ) {
384 return $get[self::F_STATUS];
385 }
386
387 return null;
388 }

References F_STATUS, ilIndividualAssessmentMembers\LP_ASSESSMENT_NOT_COMPLETED, ilIndividualAssessmentMembers\LP_COMPLETED, ilIndividualAssessmentMembers\LP_FAILED, and ilIndividualAssessmentMembers\LP_IN_PROGRESS.

Referenced by view().

+ Here is the caller graph for this function:

◆ getLinkForStatusFilter()

ilIndividualAssessmentMembersGUI::getLinkForStatusFilter (   $value)
protected
Parameters
int | string | null$value

Definition at line 357 of file class.ilIndividualAssessmentMembersGUI.php.

357 : string
358 {
359 $this->ctrl->setParameterByClass("ilIndividualAssessmentMembersGUI", self::F_STATUS, $value);
360 $link = $this->ctrl->getLinkTargetByClass("ilIndividualAssessmentMembersGUI", "view");
361 $this->ctrl->setParameterByClass("ilIndividualAssessmentMembersGUI", self::F_STATUS, null);
362
363 return $link;
364 }

Referenced by getModeOptions().

+ Here is the caller graph for this function:

◆ getModeControl()

ilIndividualAssessmentMembersGUI::getModeControl ( array  $get,
ViewControl\Factory  $vc_factory 
)
protected
Parameters
string[]$get

Definition at line 286 of file class.ilIndividualAssessmentMembersGUI.php.

286 : ViewControl\Mode
287 {
288 $active = $this->getActiveLabelForModeByFilter($get[self::F_STATUS]);
289
290 return $vc_factory->mode(
291 $this->getModeOptions(),
292 ""
293 )
294 ->withActive($active);
295 }

References getActiveLabelForModeByFilter(), and getModeOptions().

Referenced by getViewControls().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getModeOptions()

ilIndividualAssessmentMembersGUI::getModeOptions ( )
protected
Returns
string[]

Definition at line 310 of file class.ilIndividualAssessmentMembersGUI.php.

310 : array
311 {
312 $ret = [];
313
314 $ret[$this->txt("iass_filter_all")] = $this->getLinkForStatusFilter(null);
315 $ret[$this->txt("iass_filter_not_started")] = $this->getLinkForStatusFilter(
317 );
318 $ret[$this->txt("iass_filter_not_finalized")] = $this->getLinkForStatusFilter(
320 );
321 $ret[$this->txt("iass_filter_finalized")] = $this->getLinkForStatusFilter(
323 );
324 $ret[$this->txt("iass_filter_failed")] = $this->getLinkForStatusFilter(
326 );
327
328 return $ret;
329 }
$ret
Definition: parser.php:6

References $ret, getLinkForStatusFilter(), ilIndividualAssessmentMembers\LP_ASSESSMENT_NOT_COMPLETED, ilIndividualAssessmentMembers\LP_COMPLETED, ilIndividualAssessmentMembers\LP_FAILED, ilIndividualAssessmentMembers\LP_IN_PROGRESS, and txt().

Referenced by getModeControl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSortationControl()

ilIndividualAssessmentMembersGUI::getSortationControl ( ViewControl\Factory  $vc_factory)
protected

Definition at line 297 of file class.ilIndividualAssessmentMembersGUI.php.

297 : ViewControl\Sortation
298 {
299 $target = $link = $this->ctrl->getLinkTargetByClass("ilIndividualAssessmentMembersGUI", "view");
300 return $vc_factory->sortation(
301 $this->getSortOptions()
302 )
303 ->withTargetURL($target, self::F_SORT)
304 ->withLabel($this->txt("iass_sort"));
305 }
$target
Definition: test.php:19

References $target, getSortOptions(), and txt().

Referenced by getViewControls().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSortOptions()

ilIndividualAssessmentMembersGUI::getSortOptions ( )
protected

Definition at line 390 of file class.ilIndividualAssessmentMembersGUI.php.

390 : array
391 {
392 return array(
393 self::S_NAME_ASC => $this->txt("iass_sort_name_asc"),
394 self::S_NAME_DESC => $this->txt("iass_sort_name_desc"),
395 self::S_EXAMINER_ASC => $this->txt("iass_sort_examiner_login_asc"),
396 self::S_EXAMINER_DESC => $this->txt("iass_sort_examiner_login_desc"),
397 self::S_CHANGETIME_ASC => $this->txt("iass_sort_changetime_asc"),
398 self::S_CHANGETIME_DESC => $this->txt("iass_sort_changetime_desc")
399 );
400 }

References txt().

Referenced by getSortationControl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSortValue()

ilIndividualAssessmentMembersGUI::getSortValue ( array  $get)
protected
Parameters
string[]
Returns
string|null

Definition at line 406 of file class.ilIndividualAssessmentMembersGUI.php.

407 {
408 if (isset($get[self::F_SORT])
409 && $get[self::F_SORT] != ""
410 && in_array(
411 $get[self::F_SORT],
412 [
413 self::S_NAME_ASC,
414 self::S_NAME_DESC,
415 self::S_EXAMINER_ASC,
416 self::S_EXAMINER_DESC,
417 self::S_CHANGETIME_ASC,
418 self::S_CHANGETIME_DESC
419 ]
420 )
421 ) {
422 return $get[self::F_SORT];
423 }
424
425 return null;
426 }

References F_SORT.

Referenced by view().

+ Here is the caller graph for this function:

◆ getViewControls()

ilIndividualAssessmentMembersGUI::getViewControls ( array  $get)
protected
Returns
ViewControl[]

Definition at line 270 of file class.ilIndividualAssessmentMembersGUI.php.

270 : array
271 {
272 $ret = array();
273
274 $vc_factory = $this->factory->viewControl();
275
276 $sort = $this->getSortationControl($vc_factory);
277 $ret[] = $this->getModeControl($get, $vc_factory);
278 $ret[] = $sort;
279
280 return $ret;
281 }
getModeControl(array $get, ViewControl\Factory $vc_factory)

References $ret, getModeControl(), and getSortationControl().

Referenced by view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeUser()

ilIndividualAssessmentMembersGUI::removeUser ( )

Remove users from corresponding iass-object.

To be used by repository search.

Definition at line 252 of file class.ilIndividualAssessmentMembersGUI.php.

253 {
254 if (!$this->iass_access->mayEditMembers()) {
255 $this->parent_gui->handleAccessViolation();
256 }
257 $usr_id = $_POST['usr_id'];
258 $iass = $this->object;
259 $iass->loadMembers()
260 ->withoutPresentUser(new ilObjUser($usr_id))
261 ->updateStorageAndRBAC($iass->membersStorage(), $iass->accessHandler());
262 ilIndividualAssessmentLPInterface::updateLPStatusByIds($iass->getId(), array($usr_id));
263 ilUtil::sendSuccess($this->txt("iass_user_removed"), true);
264 $this->ctrl->redirectByClass(array(get_class($this->parent_gui),get_class($this)), 'view');
265 }
$_POST["username"]

References $_POST, $object, txt(), and ilIndividualAssessmentLPInterface\updateLPStatusByIds().

+ Here is the call graph for this function:

◆ removeUserConfirmation()

ilIndividualAssessmentMembersGUI::removeUserConfirmation ( )
protected

Display confirmation form for user might be removed.

Definition at line 234 of file class.ilIndividualAssessmentMembersGUI.php.

235 {
236 if (!$this->iass_access->mayEditMembers()) {
237 $this->parent_gui->handleAccessViolation();
238 }
239 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
240 $confirm = new ilConfirmationGUI();
241 $confirm->addItem('usr_id', $_GET['usr_id'], ilObjUser::_lookupFullname($_GET['usr_id']));
242 $confirm->setHeaderText($this->txt('iass_remove_user_qst'));
243 $confirm->setFormAction($this->ctrl->getFormAction($this));
244 $confirm->setConfirm($this->txt('remove'), 'removeUser');
245 $confirm->setCancel($this->txt('cancel'), 'view');
246 $this->tpl->setContent($confirm->getHTML());
247 }
Confirmation screen class.
static _lookupFullname($a_user_id)
Lookup Full Name.

References $_GET, ilObjUser\_lookupFullname(), and txt().

+ Here is the call graph for this function:

◆ txt()

ilIndividualAssessmentMembersGUI::txt ( string  $code)
protected

Definition at line 428 of file class.ilIndividualAssessmentMembersGUI.php.

428 : string
429 {
430 return $this->lng->txt($code);
431 }
$code
Definition: example_050.php:99

References $code.

Referenced by addedUsers(), addUsersFromSearch(), getActiveLabelForModeByFilter(), getModeOptions(), getSortationControl(), getSortOptions(), removeUser(), removeUserConfirmation(), and view().

+ Here is the caller graph for this function:

◆ view()

ilIndividualAssessmentMembersGUI::view ( )
protected

Definition at line 116 of file class.ilIndividualAssessmentMembersGUI.php.

117 {
118 if ($this->iass_access->mayEditMembers()) {
119 require_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
120
121 $search_params = ['crs', 'grp'];
122 $container_id = $this->object->getParentContainerIdByType($this->ref_id, $search_params);
123 if ($container_id !== 0) {
125 $this,
126 $this->toolbar,
127 array(
128 'auto_complete_name' => $this->txt('user'),
129 'submit_name' => $this->txt('add'),
130 'add_search' => true,
131 'add_from_container' => $container_id
132 )
133 );
134 } else {
136 $this,
137 $this->toolbar,
138 array(
139 'auto_complete_name' => $this->txt('user'),
140 'submit_name' => $this->txt('add'),
141 'add_search' => true
142 )
143 );
144 }
145 }
146
148 $this,
149 $this->lng,
150 $this->ctrl,
151 $this->object->accessHandler(),
152 $this->factory,
153 $this->renderer,
154 (int) $this->user->getId()
155 );
156
157 $get = $_GET;
158
159 $filter = $this->getFilterValue($get);
160 $sort = $this->getSortValue($get);
161 $entries = $this->filterViewableOrGradeableEntries(
162 $this->object->loadMembersAsSingleObjects($filter, $sort)
163 );
164
165 $table->setData($entries);
166 $view_constrols = $this->getViewControls($get);
167
168 $output = $table->render($view_constrols);
169
170 if (count($entries) == 0) {
171 $output .= $this->txt("iass_no_entries");
172 }
173 $this->tpl->setContent($output);
174 }
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
if(empty($password)) $table
Definition: pwgen.php:24

References $_GET, Sabre\VObject\$output, $table, ilRepositorySearchGUI\fillAutoCompleteToolbar(), filterViewableOrGradeableEntries(), getFilterValue(), getSortValue(), getViewControls(), and txt().

Referenced by addedUsers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilIndividualAssessmentMembersGUI::$ctrl
protected

Definition at line 22 of file class.ilIndividualAssessmentMembersGUI.php.

◆ $iass_access

ilIndividualAssessmentMembersGUI::$iass_access
protected

Definition at line 46 of file class.ilIndividualAssessmentMembersGUI.php.

◆ $lng

ilIndividualAssessmentMembersGUI::$lng
protected

Definition at line 26 of file class.ilIndividualAssessmentMembersGUI.php.

◆ $object

ilIndividualAssessmentMembersGUI::$object
protected

Definition at line 41 of file class.ilIndividualAssessmentMembersGUI.php.

Referenced by addUsers(), and removeUser().

◆ $parent_gui

ilIndividualAssessmentMembersGUI::$parent_gui
protected

Definition at line 23 of file class.ilIndividualAssessmentMembersGUI.php.

◆ $ref_id

ilIndividualAssessmentMembersGUI::$ref_id
protected

Definition at line 24 of file class.ilIndividualAssessmentMembersGUI.php.

◆ $tpl

ilIndividualAssessmentMembersGUI::$tpl
protected

Definition at line 25 of file class.ilIndividualAssessmentMembersGUI.php.

◆ F_SORT

const ilIndividualAssessmentMembersGUI::F_SORT = "sortation"

Definition at line 29 of file class.ilIndividualAssessmentMembersGUI.php.

Referenced by getSortValue().

◆ F_STATUS

const ilIndividualAssessmentMembersGUI::F_STATUS = "status"

Definition at line 28 of file class.ilIndividualAssessmentMembersGUI.php.

Referenced by getFilterValue().

◆ S_CHANGETIME_ASC

const ilIndividualAssessmentMembersGUI::S_CHANGETIME_ASC = "change_time:asc"

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

◆ S_CHANGETIME_DESC

const ilIndividualAssessmentMembersGUI::S_CHANGETIME_DESC = "change_time:desc"

Definition at line 36 of file class.ilIndividualAssessmentMembersGUI.php.

◆ S_EXAMINER_ASC

const ilIndividualAssessmentMembersGUI::S_EXAMINER_ASC = "examiner_login:asc"

Definition at line 33 of file class.ilIndividualAssessmentMembersGUI.php.

◆ S_EXAMINER_DESC

const ilIndividualAssessmentMembersGUI::S_EXAMINER_DESC = "examiner_login:desc"

Definition at line 34 of file class.ilIndividualAssessmentMembersGUI.php.

◆ S_NAME_ASC

const ilIndividualAssessmentMembersGUI::S_NAME_ASC = "user_lastname:asc"

Definition at line 31 of file class.ilIndividualAssessmentMembersGUI.php.

◆ S_NAME_DESC

const ilIndividualAssessmentMembersGUI::S_NAME_DESC = "user_lastname:desc"

Definition at line 32 of file class.ilIndividualAssessmentMembersGUI.php.


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