19declare(strict_types=0);
28use JetBrains\PhpStorm\NoReturn;
43 protected const string TABLE_ID =
'lotstasstbl';
44 protected const string ROW_ID =
'row_ids';
65 protected int $assignment_type,
66 protected int $test_type,
67 protected int $container_id,
69 protected ilUIServices $ui_services,
70 protected ilHTTPServices $http_services,
74 protected object $parent_object
76 $this->data_factory =
new ilDataFactory();
84 $this->
lng->txt(self::LNG_TABLE_COL_TITLE)
85 )->withIsSortable(
true);
88 $this->
lng->txt(self::LNG_TABLE_COL_COURSE_OBJECTIVES)
89 )->withIsSortable(
false);
92 $this->
lng->txt(self::LNG_TABLE_COL_SELECTION_OF_TEST_QUESTIONS)
93 )->withIsSortable(
false);
95 $this->
lng->txt(self::LNG_TABLE_COL_QESTIONS)
96 )->withIsSortable(
false);
102 $this->url_builder =
new URLBuilder($this->data_factory->uri($this->http_services->request()->getUri()->__toString()));
103 list($this->url_builder, $this->action_parameter_token, $this->row_id_token) =
104 $this->url_builder->acquireParameters(
105 [
'datatable', self::TABLE_ID],
106 self::TABLE_ACTION_ID,
112 $this->
lng->txt(self::LNG_TABLE_ACTION_CONFIRM_DELETE_TESTS),
113 $this->url_builder->withParameter($this->action_parameter_token, self::TABLE_ACTION_CONFIRM_DELETE_TESTS),
119 $this->
lng->txt(self::LNG_TABLE_ACTION_CONFIRM_DELETE_TEST),
120 $this->url_builder->withParameter($this->action_parameter_token, self::TABLE_ACTION_CONFIRM_DELETE_TEST),
129 switch ($this->test_type) {
135 return 'crs_loc_settings_tbl_its_q_all';
141 return 'crs_loc_settings_tbl_its_nq_all';
143 if ($this->
getSettings()->isInitialTestQualifying()) {
144 return 'crs_loc_settings_tbl_it_q';
146 if (!$this->
getSettings()->isInitialTestQualifying()) {
147 return 'crs_loc_settings_tbl_it_nq';
153 return 'crs_loc_settings_tbl_qts_all';
156 return 'crs_loc_settings_tbl_qt';
160 return 'lng_title_missing';
165 if (isset($this->table)) {
168 $this->table = $this->ui_services->factory()->table()->data(
169 $this->data_retrieval,
170 $this->
lng->txt($this->getTitleLangVar()),
173 ->withId(self::TABLE_ID)
175 ->withRequest($this->http_services->request());
180 return $this->data_retrieval->allIds();
185 $tokens = $this->http_services->wrapper()->query()->retrieve(
186 $this->row_id_token->getName(),
187 $this->refinery->custom()->transformation(fn($v) => $v)
189 return is_null($tokens)
191 : (is_array($tokens) ? $tokens : [$tokens]);
194 #[NoReturn] protected function showDeleteModal(
200 $items[] = $this->ui_services->factory()->modal()->interruptiveItem()->standard(
205 echo($this->ui_services->renderer()->renderAsync([
206 $this->ui_services->factory()->modal()->interruptive(
207 $this->lng->txt(
'crs_loc_delete_assignment'),
208 $this->lng->txt(
'crs_loc_confirm_delete_tst'),
209 (
string) $this->url_builder
211 $this->action_parameter_token,
217 )->withAffectedItems($items)
224 foreach ($ids as $assign_id) {
226 $assignment->delete();
233 $start->deleteItem($assignment->getTestRefId());
238 $this->
ctrl->redirectByClass(
'ilLOEditorGUI',
'testOverview');
244 foreach ($ids as $tst_id) {
261 $start->deleteItem($tst_id);
266 $this->
ctrl->redirectByClass(
'ilLOEditorGUI',
'testOverview');
272 return $this->ui_services->renderer()->render([$this->table]);
277 return $this->assignment_type;
287 return $this->parent_object;
292 return $this->test_type;
298 if (!$this->http_services->wrapper()->query()->has($this->action_parameter_token->getName())) {
301 $action = $this->http_services->wrapper()->query()->retrieve(
302 $this->action_parameter_token->getName(),
303 $this->refinery->to()->string()
305 $tokens = $this->http_services->wrapper()->query()->retrieve(
306 $this->row_id_token->getName(),
307 $this->refinery->custom()->transformation(fn($v) => $v)
309 $all_entries = ($tokens[0] ??
"") === self::ALL_OBJECTS;
317 if (is_null($ids[0]) || count($ids) === 0) {
323 foreach ($ids as
$id) {
327 $this->showDeleteModal(
$id_map, self::ACTION_CONFIRM_DELETE_TEST);
331 foreach ($ids as
$id) {
335 $this->showDeleteModal(
$id_map, self::ACTION_CONFIRM_DELETE_TESTS);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Provides fluid interface to RBAC services.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deleteTest(int $a_tst_ref_id)
Class ilCtrl provides processing control methods.
const TYPE_TEST_QUALIFIED
static getInstanceByObjId(int $a_obj_id)
setInitialTest(int $a_id)
setQualifiedTest(int $a_id)
Class ilLOTestAssignmentTableGUI.
__construct(protected int $assignment_type, protected int $test_type, protected int $container_id, protected ilLanguage $lng, protected ilUIServices $ui_services, protected ilHTTPServices $http_services, protected ilLOTestAssignmentTableDataRetrieval $data_retrieval, protected ilRefineryFactory $refinery, protected ilCtrl $ctrl, protected object $parent_object)
const string TABLE_COL_SELECTION_OF_TEST_QUESTIONS
const string TABLE_COL_QESTIONS
const string LNG_TABLE_ACTION_CONFIRM_DELETE_TEST
const string TABLE_COL_COURSE_OBJECTIVES
const int TYPE_MULTIPLE_ASSIGNMENTS
const string TABLE_COL_TITLE
const string TABLE_ACTION_ID
const string ACTION_CONFIRM_DELETE_TEST
const string LNG_TABLE_COL_COURSE_OBJECTIVES
const string TABLE_ACTION_CONFIRM_DELETE_TEST
ilDataFactory $data_factory
const int TYPE_SINGLE_ASSIGNMENTS
const string ACTION_CONFIRM_DELETE_TESTS
const string LNG_TABLE_COL_TITLE
const string TABLE_ACTION_CONFIRM_DELETE_TESTS
ilURLBuilderToken $row_id_token
ilURLBuilderToken $action_parameter_token
const string LNG_TABLE_ACTION_CONFIRM_DELETE_TESTS
const string LNG_TABLE_COL_SELECTION_OF_TEST_QUESTIONS
const string LNG_TABLE_COL_QESTIONS
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This describes a Data Table.