154 : bool {
155 switch ($cmd) {
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);
161 return true;
162
165 current($row_ids),
166 \ilAssQuestionPreviewGUI::class,
168 );
169 return false;
170
173 current($row_ids),
174 \ilTestCorrectionsGUI::class,
175 'showQuestion'
176 );
177 return false;
178
181 current($row_ids),
182 \ilAssQuestionPreviewGUI::class,
184 );
185 return false;
186
188 $question_id = current($row_ids);
189 $qtype = $this->test_obj->getQuestionType($question_id);
190 $target_class = $qtype . 'GUI';
192 $question_id,
193 $target_class,
194 'editQuestion'
195 );
196 return false;
197
200 current($row_ids),
201 \ilAssQuestionPageGUI::class,
202 'edit'
203 );
204 return false;
205
208 current($row_ids),
209 \ilAssQuestionFeedbackEditingGUI::class,
211 );
212 return false;
213
215 echo $this->ui_renderer->renderAsync(
217 );
219
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'));
224 return true;
225 }
226 $protect_by_write_protection();
227 if ($this->is_in_test_with_results) {
228 $this->test_obj->removeQuestionsWithResults($row_ids);
229 } else {
230 $this->test_obj->removeQuestions($row_ids);
231 $this->test_obj->saveCompleteStatus($this->test_question_set_config_factory->getQuestionSetConfig());
232 }
233 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'tst_questions_removed'),
true);
234 return true;
235
237 if (array_filter($row_ids) === []) {
238 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_questions_selected'));
239 return true;
240 }
241 $protect_by_write_protection();
242 $this->test_obj->copyQuestions($row_ids);
243 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'copy_questions_success'),
true);
244 return true;
245
247 if (array_filter($row_ids) === []) {
248 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'tst_no_question_selected_for_moving_to_qpl'));
249 return true;
250 }
251 $protect_by_write_protection();
253 return true;
254 }
255 $copy_and_link_to_questionpool();
256 return false;
257
259 if (array_filter($row_ids) === []) {
260 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_questions_selected'));
261 return true;
262 }
263 $protect_by_write_protection();
264 $this->question_printer->printSelectedQuestions(
265 array_reduce(
266 Types::cases(),
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();
271 },
272 []
273 ),
274 Types::tryFrom($this->table_query->getPrintViewType()) ?? Types::RESULTS_VIEW_TYPE_SHOW,
275 $row_ids
276 );
277 return false;
278
280 $protect_by_write_protection();
281 $this->question_printer->printAnswers(current($row_ids));
282 return false;
283
285 $protect_by_write_protection();
288 $question_object->deliverFileUploadZIPFile(
289 $this->test_obj->getRefId(),
290 $this->test_obj->getTestId(),
291 $this->test_obj->getTitle()
292 );
293 }
294
295
296 default:
297 throw new \InvalidArgumentException("No such table_cmd: '$cmd'.");
298 }
299 }
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...