19 declare(strict_types=1);
71 return $this->test_obj;
76 $this->test_obj = $test_obj;
81 return $this->question_set_config;
86 $this->question_set_config = $question_set_config;
111 switch ($this->
ctrl->getNextClass($this)) {
112 case 'ilrepositorysearchgui':
114 $gui->setCallback($this, self::CALLBACK_ADD_PARTICIPANT, array());
116 $gui->addUserAccessFilterCallable($this->participant_access_filter->getManageParticipantsUserFilter(
117 $this->getTestObj()->getRefId()
121 $this->
ctrl->setReturn($this, self::CMD_SHOW);
122 $this->
ctrl->forwardCommand($gui);
126 case "iltestevaluationgui":
130 $this->
tabs->clearTargets();
131 $this->
tabs->clearSubTabs();
133 $this->
ctrl->forwardCommand($gui);
139 $command = $this->
ctrl->getCmd(self::CMD_SHOW) .
'Cmd';
146 $filter_closure = $this->participant_access_filter->getManageParticipantsUserFilter($this->
getTestObj()->getRefId());
147 $filtered_user_ids = $filter_closure($user_ids);
150 foreach ($filtered_user_ids as $user_id) {
151 $client_ip = $_POST[
"client_ip"][$countusers] ??
'';
152 $this->
getTestObj()->inviteUser($user_id, $client_ip);
158 $message = $this->
lng->txt(
"tst_invited_selected_users");
161 $this->main_tpl->setOnScreenMessage(
'info',
$message,
true);
163 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"tst_invited_nobody"),
true);
167 $this->
ctrl->redirect($this, self::CMD_SHOW);
175 $table_gui->setParticipantHasSolutionsFilterEnabled(
179 if ($this->
getTestObj()->getFixedParticipants()) {
180 $table_gui->setTitle($this->
lng->txt(
'tst_tbl_invited_users'));
182 $table_gui->setTitle($this->
lng->txt(
'tst_tbl_participants'));
191 $table_gui->initFilter($this->
getTestObj()->getFixedParticipants());
192 $table_gui->writeFilterToSession();
193 $table_gui->resetOffset();
200 $table_gui->resetFilter();
201 $table_gui->resetOffset();
210 if ($this->
getTestObj()->getFixedParticipants()) {
211 $participant_list = $this->
getTestObj()->getInvitedParticipantList()->getAccessFilteredList(
212 $this->participant_access_filter->getManageParticipantsUserFilter($this->getTestObj()->getRefId())
215 $table_gui->setData($this->
applyFilterCriteria($participant_list->getParticipantsTableRows()));
216 $table_gui->setRowKeyDataField(
'usr_id');
217 $table_gui->setManageInviteesCommandsEnabled(
true);
218 $table_gui->setDescription($this->
lng->txt(
"fixed_participants_hint"));
220 $participant_list = $this->
getTestObj()->getActiveParticipantList()->getAccessFilteredList(
221 $this->participant_access_filter->getManageParticipantsUserFilter($this->getTestObj()->getRefId())
224 $table_gui->setData($participant_list->getParticipantsTableRows());
225 $table_gui->setRowKeyDataField(
'active_id');
228 $table_gui->setManageResultsCommandsEnabled(
true);
233 $table_gui->setAnonymity($this->
getTestObj()->getAnonymity());
235 $table_gui->initColumns();
236 $table_gui->initCommands();
238 $table_gui->initFilter();
239 $table_gui->setFilterCommand(self::CMD_SET_FILTER);
240 $table_gui->setResetCommand(self::CMD_RESET_FILTER);
242 $this->main_tpl->setContent($this->
ctrl->getHTML($table_gui));
249 if (!is_string($selected_pax)) {
253 $filter = unserialize($selected_pax, [
'allowed_classes' =>
false]);
255 if (!is_string($filter) || $filter ===
'all') {
261 foreach ($in_rows as $row) {
262 $query = $this->db->query(
263 'SELECT count(solution_id) count 265 WHERE active_fi = ' . $this->db->quote($row[
'active_id'])
266 .
' HAVING count ' . ($filter ===
'withSolutions' ?
'>' :
'=') .
' 0' 269 if (is_array($this->db->fetchAssoc($query))) {
279 if ($this->
getTestObj()->getFixedParticipants()) {
284 $this->
toolbar->addSeparator();
298 'auto_complete_name' => $this->
lng->txt(
'user'),
299 'submit_name' => $this->
lng->txt(
'add')
304 $search_btn = $this->ui_factory->button()->standard(
305 $this->
lng->txt(
'tst_search_users'),
306 $this->
ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start')
315 $finish_all_user_passes_btn = $DIC->ui()->factory()->button()->standard(
316 $DIC->language()->txt(
'finish_all_user_passes'),
317 $DIC->ctrl()->getLinkTargetByClass(
'iltestevaluationgui',
'finishAllUserPasses')
324 $filter_closure = $this->participant_access_filter->getManageParticipantsUserFilter($this->
getTestObj()->getRefId());
325 $selected_users = $filter_closure($this->testrequest->raw(
'chbUser') ?? []);
327 if ($selected_users === []) {
328 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"select_one_user"),
true);
331 foreach ($selected_users as $user_id) {
332 $this->
getTestObj()->setClientIP($user_id, $_POST[
"clientip_" . $user_id]);
335 $this->
ctrl->redirect($this, self::CMD_SHOW);
340 $filter_closure = $this->participant_access_filter->getManageParticipantsUserFilter($this->
getTestObj()->getRefId());
341 $a_user_ids = $filter_closure((array) $_POST[
"chbUser"]);
343 if (is_array($a_user_ids)) {
344 foreach ($a_user_ids as $user_id) {
348 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"select_one_user"),
true);
351 $this->
ctrl->redirect($this, self::CMD_SHOW);
static get(string $a_var)
__construct(protected ilObjTest $test_obj, protected ilTestQuestionSetConfig $question_set_config, protected ilAccess $access, protected ilGlobalTemplateInterface $main_tpl, protected UIFactory $ui_factory, protected UIRenderer $ui_renderer, protected ilLanguage $lng, protected ilCtrl $ctrl, protected ilDBInterface $db, protected ilTabsGUI $tabs, protected ilToolbarGUI $toolbar, protected InternalRequestService $testrequest)
setTestObj(ilObjTest $test_obj)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilTestObjectiveOrientedContainer $objective_parent
applyFilterCriteria(array $in_rows)
ilTestAccess $test_access
setTestAccess(ilTestAccess $test_access)
Output class for assessment test evaluation.
ilTestParticipantAccessFilterFactory $participant_access_filter
static fillAutoCompleteToolbar(object $parent_object, ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
addParticipants($user_ids=[])
addUserSearchControls(ilToolbarGUI $toolbar)
setQuestionSetConfig(ilTestQuestionSetConfig $question_set_config)
const CALLBACK_ADD_PARTICIPANT
initToolbarControls(ilTestParticipantList $participant_list)
addFinishAllPassesButton(ilToolbarGUI $toolbar)
setObjectiveParent(ilTestObjectiveOrientedContainer $objective_parent)