Skip to content

Commit db5a6cb

Browse files
committed
Test: Disable Ordering and Remove MultiDelete
See: https://mantis.ilias.de/view.php?id=46844
1 parent 6fd1007 commit db5a6cb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

components/ILIAS/Test/src/Questions/Presentation/QuestionsTable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public function getTableComponent(): Ordering
6060
->withActions($this->table_actions->getActions())
6161
->withRequest($this->request);
6262

63-
if ($this->test_obj->isRandomTest()) {
63+
if ($this->test_obj->isRandomTest()
64+
|| $this->test_obj->evalTotalPersons() !== 0) {
6465
return $table->withOrderingDisabled(true);
6566
}
6667

components/ILIAS/Test/src/Questions/Presentation/QuestionsTableActions.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ public function setDisabledActions(
7777
$disable_default_actions = $this->is_in_test_with_random_question_set
7878
|| $this->is_in_test_with_results;
7979

80-
return $row->withDisabledAction(
81-
self::ACTION_DELETE,
82-
$this->is_in_test_with_random_question_set
83-
|| $this->is_in_test_with_results && !$this->is_adjusting_questions_with_results_allowed
84-
)->withDisabledAction(self::ACTION_COPY, $disable_default_actions)
80+
return $row->withDisabledAction(self::ACTION_COPY, $disable_default_actions)
8581
->withDisabledAction(self::ACTION_ADD_TO_POOL, $this->is_in_test_with_random_question_set)
8682
->withDisabledAction(self::ACTION_EDIT_QUESTION, $disable_default_actions)
8783
->withDisabledAction(self::ACTION_EDIT_PAGE, $disable_default_actions)
@@ -121,7 +117,8 @@ public function getActions(): array
121117
self::ACTION_DOWNLOAD_FILE_QUESTION_ANSWERS => $ag('single', 'download_all_files', self::ACTION_DOWNLOAD_FILE_QUESTION_ANSWERS),
122118
];
123119

124-
if (!$this->test_obj->isRandomTest()) {
120+
if (!$this->is_in_test_with_random_question_set
121+
&& (!$this->is_in_test_with_results || $this->is_adjusting_questions_with_results_allowed)) {
125122
$actions[self::ACTION_DELETE] = $ag('standard', 'delete', self::ACTION_DELETE)
126123
->withAsync();
127124
}

0 commit comments

Comments
 (0)