156 : bool {
157 switch ($cmd) {
159 $protect_by_write_protection();
160
161 if ($this->is_in_test_with_random_question_set || $this->is_in_test_with_results) {
162 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'questionlist_cannot_be_altered'));
163 return true;
164 }
165
166 $data = $get_table()->getTableComponent()->getData();
167 $this->test_obj->setQuestionOrder(array_flip(
$data), []);
168 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'),
true);
169 return true;
170
173 current($row_ids),
174 \ilAssQuestionPreviewGUI::class,
176 );
177 return false;
178
181 current($row_ids),
182 \ilTestCorrectionsGUI::class,
183 'showQuestion'
184 );
185 return false;
186
189 current($row_ids),
190 \ilAssQuestionPreviewGUI::class,
192 );
193 return false;
194
196 $question_id = current($row_ids);
197 $qtype = $this->test_obj->getQuestionType($question_id);
198 $target_class = $qtype . 'GUI';
200 $question_id,
201 $target_class,
202 'editQuestion'
203 );
204 return false;
205
208 current($row_ids),
209 \ilAssQuestionPageGUI::class,
210 'edit'
211 );
212 return false;
213
216 current($row_ids),
217 \ilAssQuestionFeedbackEditingGUI::class,
219 );
220 return false;
221
223 echo $this->ui_renderer->renderAsync(
225 );
227
229 $row_ids = $this->request->getParsedBody()['interruptive_items'] ?? [];
230 if (array_filter($row_ids) === []) {
231
232 return true;
233 }
234
235 if ($this->is_in_test_with_random_question_set
236 || $this->is_in_test_with_results
237 && !$this->is_adjusting_questions_with_results_allowed) {
238 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'questionlist_cannot_be_altered'));
239 return true;
240 }
241
242 $protect_by_write_protection();
243 if ($this->is_in_test_with_results) {
244 $this->test_obj->removeQuestionsWithResults($row_ids);
245 } else {
246 $this->test_obj->removeQuestions($row_ids);
247 $this->test_obj->saveCompleteStatus($this->test_question_set_config_factory->getQuestionSetConfig());
248 }
249 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'tst_questions_removed'),
true);
250 return true;
251
253 if (array_filter($row_ids) === []) {
254 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_questions_selected'));
255 return true;
256 }
257
258 if ($this->is_in_test_with_random_question_set || $this->is_in_test_with_results) {
259 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'questionlist_cannot_be_altered'));
260 return true;
261 }
262
263 $protect_by_write_protection();
264 $this->test_obj->copyQuestions($row_ids);
265 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'copy_questions_success'),
true);
266 return true;
267
269 if (array_filter($row_ids) === []) {
270 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'tst_no_question_selected_for_moving_to_qpl'));
271 return true;
272 }
273 $protect_by_write_protection();
275 return true;
276 }
277 $copy_and_link_to_questionpool();
278 return false;
279
281 if (array_filter($row_ids) === []) {
282 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_questions_selected'));
283 return true;
284 }
285 $protect_by_write_protection();
286 $this->question_printer->printSelectedQuestions(
287 array_reduce(
288 Types::cases(),
289 function (array
$c,
Types $v): array {
290 $c[$v->getLabel($this->
lng)] = $this->table_query
291 ->getPrintViewTypeURL(self::ACTION_PRINT_QUESTIONS, $v->value)->__toString();
293 },
294 []
295 ),
296 Types::tryFrom($this->table_query->getPrintViewType()) ?? Types::RESULTS_VIEW_TYPE_SHOW,
297 $row_ids
298 );
299 return false;
300
302 $protect_by_write_protection();
303 $this->question_printer->printAnswers(current($row_ids));
304 return false;
305
307 $protect_by_write_protection();
310 $question_object->deliverFileUploadZIPFile(
311 $this->test_obj->getRefId(),
312 $this->test_obj->getTestId(),
313 $this->test_obj->getTitle()
314 );
315 }
316
317
318 default:
319 throw new \InvalidArgumentException("No such table_cmd: '$cmd'.");
320 }
321 }
checkQuestionParametersForCopyToPool(array $question_ids)
const ACTION_DELETE_CONFIRMED
redirectWithQuestionParameters(int $question_id, string $target_class, string $cmd)
getDeleteConfirmation(array $row_ids)
const ACTION_DOWNLOAD_FILE_QUESTION_ANSWERS
const ACTION_PRINT_ANSWERS
const ACTION_EDIT_QUESTION
const ACTION_PRINT_QUESTIONS
static instantiateQuestion(int $question_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...