19declare(strict_types=1);
54 private UIFactory $ui_factory,
55 private UIRenderer $ui_renderer,
58 $this->validationFailed =
false;
59 $this->validationReports = [];
133 return implode(
'<br />', $this->validationReports);
138 return count($this->validationReports);
143 $this->validationReports[] = $validationReport;
153 $this->sync_info_message =
$message;
168 if (!$this->questionSetConfig->isQuestionAmountConfigComplete()) {
174 $this->
lng->txt(
'tst_msg_rand_quest_set_change_quest_amount_here'),
175 $this->buildGeneralConfigSubTabLink()
184 $this->
lng->txt(
'tst_msg_rand_quest_set_change_quest_amount_here'),
185 $this->buildQuestionSelectionSubTabLink()
192 if (!$this->questionSetConfig->hasSourcePoolDefinitions()) {
197 if ($this->questionSetConfig->getLastQuestionSyncTimestamp() === 0 ||
198 $this->questionSetConfig->getLastQuestionSyncTimestamp() ===
null) {
203 if (!$this->questionSetConfig->isQuestionSetBuildable()) {
206 $this->
addValidationReport(implode(
'<br />', $this->questionSetConfig->getBuildableMessages()));
210 if ($this->questionSetConfig->getLastQuestionSyncTimestamp()) {
221 $titles[] = $lostPool->getTitle();
224 return implode(
', ', $titles);
243 $this->
ctrl->setParameter(
249 $href = $this->
ctrl->getLinkTarget(
253 $label = $this->
lng->txt(
'tst_btn_rebuild_random_question_stage');
255 return $this->ui_factory->button()->standard($label, $href)->withLoadingAnimationOnClick(
true);
260 $href = $this->
ctrl->getLinkTarget(
265 $label = $this->
lng->txt(
'tst_rnd_quest_cfg_tab_general');
267 return "<a href=\"{$href}\">{$label}</a>";
272 $href = $this->
ctrl->getLinkTarget(
277 $label = $this->
lng->txt(
'tst_rnd_quest_cfg_tab_pool');
279 return "<a href=\"{$href}\">{$label}</a>";
288 if ($this->
getContext() !== self::CONTEXT_POOL_SELECTION) {
292 if ($this->questionSetConfig->doesSelectableQuestionPoolsExist()) {
305 if ($this->
getContext() != self::CONTEXT_GENERAL_CONFIG) {
309 if (!$this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
318 if ($this->
getContext() != self::CONTEXT_POOL_SELECTION) {
322 if (!$this->questionSetConfig->isQuestionAmountConfigurationModePerTest()) {
332 $this->
lng->txt(
'tst_msg_rand_quest_set_lost_pools'),
333 $this->buildLostQuestionPoolsString()
336 if ($this->
getContext() == self::CONTEXT_GENERAL_CONFIG) {
337 $action = $this->
ctrl->getLinkTarget(
342 $link = $this->ui_factory->link()->standard(
343 $this->
lng->txt(
'tst_msg_rand_quest_set_lost_pools_link'),
347 $msg_box = $this->ui_factory->messageBox()->info($report)->withLinks([$link]);
349 $msg_box = $this->ui_factory->messageBox()->info($report);
352 return $this->ui_renderer->render($msg_box);
358 $this->questionSetConfig->getLastQuestionSyncTimestamp(),
362 $this->
lng->txt(
'tst_msg_rand_quest_set_stage_pool_last_sync'),
366 $message .=
'<br>' . $this->
lng->txt(
'tst_msg_cannot_modify_random_question_set_conf_due_to_part');
368 $msg_box = $this->ui_factory->messageBox()->info(
$message);
371 $label = $this->
lng->txt(
'tst_btn_reset_pool_sync');
374 $this->ui_factory->button()->standard($label, $href)
377 $msg_box = $this->ui_factory->messageBox()
379 ->withButtons($buttons);
382 return $this->ui_renderer->render($msg_box);
387 $message = $this->
lng->txt(
'tst_msg_rand_quest_set_not_sync');
389 $msg_box = $this->ui_factory->messageBox()->info(
$message)->withButtons([$button]);
391 return $this->ui_renderer->render($msg_box);
Builds a Color from either hex- or rgb values.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
const CMD_BUILD_QUESTION_STAGE
const HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD
const CMD_SHOW_SRC_POOL_DEF_LIST
const CMD_SHOW_GENERAL_CONFIG_FORM
buildLostQuestionPoolsString()
buildLostPoolsReportMessage()
isQuestionAmountConfigPerTestHintRequired()
setValidationFailed(bool $validationFailed)
setLostPools(array $lostPools)
setSyncInfoMessage(string $message)
const CONTEXT_POOL_SELECTION
setTargetGUI(ilTestRandomQuestionSetConfigGUI $targetGUI)
setQuestionSetConfig(ilTestRandomQuestionSetConfig $questionSetConfig)
getValidationReportHtml()
getAfterRebuildQuestionStageCommand()
__construct(private ilLanguage $lng, private UIFactory $ui_factory, private UIRenderer $ui_renderer, private ilCtrlInterface $ctrl)
string $sync_info_message
const CONTEXT_GENERAL_CONFIG
isNoAvailableQuestionPoolsHintRequired()
bool $participantDataExists
isQuestionAmountConfigPerPoolHintRequired()
setContext(string $context)
ilTestRandomQuestionSetConfigGUI $targetGUI
addValidationReport(string $validationReport)
buildQuestionSelectionSubTabLink()
buildQuestionStageRebuildButton()
ilTestRandomQuestionSetConfig $questionSetConfig
setParticipantDataExists(bool $participantDataExists)
buildGeneralConfigSubTabLink()
doesParticipantDataExists()
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...