156 case self::ACTION_SAVE_ORDER:
157 $protect_by_write_protection();
158 $data = $get_table()->getTableComponent()->getData();
159 $this->test_obj->setQuestionOrder(array_flip(
$data), []);
160 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'),
true);
163 case self::ACTION_PREVIEW:
166 \ilAssQuestionPreviewGUI::class,
171 case self::ACTION_ADJUST:
174 \ilTestCorrectionsGUI::class,
179 case self::ACTION_STATISTICS:
182 \ilAssQuestionPreviewGUI::class,
187 case self::ACTION_EDIT_QUESTION:
188 $question_id = current($row_ids);
189 $qtype = $this->test_obj->getQuestionType($question_id);
190 $target_class = $qtype .
'GUI';
198 case self::ACTION_EDIT_PAGE:
201 \ilAssQuestionPageGUI::class,
206 case self::ACTION_FEEDBACK:
209 \ilAssQuestionFeedbackEditingGUI::class,
214 case self::ACTION_DELETE:
215 echo $this->ui_renderer->renderAsync(
220 case self::ACTION_DELETE_CONFIRMED:
221 $row_ids = $this->request->getParsedBody()[
'interruptive_items'] ?? [];
222 if (array_filter($row_ids) === []) {
223 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_questions_selected'));
226 $protect_by_write_protection();
227 if ($this->is_in_test_with_results) {
228 $this->test_obj->removeQuestionsWithResults($row_ids);
230 $this->test_obj->removeQuestions($row_ids);
231 $this->test_obj->saveCompleteStatus($this->test_question_set_config_factory->getQuestionSetConfig());
233 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'tst_questions_removed'),
true);
236 case self::ACTION_COPY:
237 if (array_filter($row_ids) === []) {
238 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_questions_selected'));
241 $protect_by_write_protection();
242 $this->test_obj->copyQuestions($row_ids);
243 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'copy_questions_success'),
true);
246 case self::ACTION_ADD_TO_POOL:
247 if (array_filter($row_ids) === []) {
248 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'tst_no_question_selected_for_moving_to_qpl'));
251 $protect_by_write_protection();
255 $copy_and_link_to_questionpool();
258 case self::ACTION_PRINT_QUESTIONS:
259 if (array_filter($row_ids) === []) {
260 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_questions_selected'));
263 $protect_by_write_protection();
264 $this->question_printer->printSelectedQuestions(
267 function (array
$c,
Types $v): array {
268 $c[$v->getLabel($this->
lng)] = $this->table_query
269 ->getPrintViewTypeURL(self::ACTION_PRINT_QUESTIONS, $v->value)->__toString();
274 Types::tryFrom($this->table_query->getPrintViewType()) ?? Types::RESULTS_VIEW_TYPE_SHOW,
279 case self::ACTION_PRINT_ANSWERS:
280 $protect_by_write_protection();
281 $this->question_printer->printAnswers(current($row_ids));
284 case self::ACTION_DOWNLOAD_FILE_QUESTION_ANSWERS:
285 $protect_by_write_protection();
288 $question_object->deliverFileUploadZIPFile(
289 $this->test_obj->getRefId(),
290 $this->test_obj->getTestId(),
291 $this->test_obj->getTitle()
297 throw new \InvalidArgumentException(
"No such table_cmd: '$cmd'.");
redirectWithQuestionParameters(int $question_id, string $target_class, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static instantiateQuestion(int $question_id)
getDeleteConfirmation(array $row_ids)
checkQuestionParametersForCopyToPool(array $question_ids)