29 protected \ILIAS\DI\Container
$DIC;
63 $this->main_tpl =
$DIC->ui()->mainTemplate();
158 $this->infoMessages[] = $infoMessage;
168 $this->failureMessages[] = $failureMessage;
173 bool $a_multipart =
false,
174 string $a_target =
""
176 if ($this->globalToolbar instanceof parent) {
177 $this->globalToolbar->setFormAction($a_val, $a_multipart, $a_target);
179 parent::setFormAction($a_val, $a_multipart, $a_target);
185 if ($this->globalToolbar instanceof parent) {
186 $this->globalToolbar->addButtonInstance($a_button);
188 parent::addButtonInstance($a_button);
194 if ($this->globalToolbar instanceof parent) {
195 $this->globalToolbar->setCloseFormTag($a_val);
197 parent::setCloseFormTag($a_val);
203 bool $a_output_label =
false
205 if ($this->globalToolbar instanceof parent) {
206 $this->globalToolbar->addInputItem($a_item, $a_output_label);
208 parent::addInputItem($a_item, $a_output_label);
214 if ($this->globalToolbar instanceof parent) {
215 $this->globalToolbar->addFormInput($formInput);
221 if ($this->globalToolbar instanceof parent) {
222 $this->globalToolbar->setItems(array());
224 $this->setItems(array());
230 if (is_object($target)) {
231 $target = get_class($target);
239 if (is_array($target)) {
243 return array($this->getClassName($target));
248 return array_merge(self::$TARGET_CLASS_PATH_BASE, $this->getClassNameArray($target));
253 $this->
ctrl->setParameterByClass($this->getClassName($target), $parameter, $value);
258 return $this->
ctrl->getLinkTargetByClass($this->getClassPath($target), $cmd);
263 return $this->
ctrl->getFormActionByClass($this->getClassPath($target));
268 if (!strlen($this->getSessionLockString())) {
269 $this->setSessionLockString($this->buildSessionLockString());
275 return md5(
$_COOKIE[session_name()] . time());
280 if (!$this->getTestOBJ()->isSkillServiceEnabled()) {
284 $questionContainerId = $this->getTestOBJ()->getId();
286 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
287 require_once
'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
290 $assignmentList->setParentObjId($questionContainerId);
291 $assignmentList->loadFromDb();
293 foreach ($assignmentList->getUniqueAssignedSkills() as
$data) {
294 foreach (
$data[
'skill']->getLevelData() as $level) {
296 $treshold->setTestId($this->getTestOBJ()->getTestId());
297 $treshold->setSkillBaseId(
$data[
'skill_base_id']);
298 $treshold->setSkillTrefId(
$data[
'skill_tref_id']);
299 $treshold->setSkillLevelId($level[
'id']);
301 if (!$treshold->dbRecordExists()) {
312 $message = $this->
lng->txt(
'tst_skl_level_thresholds_missing');
314 $linkTarget = $this->buildLinkTarget(
315 array(
'ilTestSkillAdministrationGUI',
'ilTestSkillLevelThresholdsGUI'),
319 $link = $this->DIC->ui()->factory()->link()->standard(
320 $this->DIC->language()->txt(
'tst_skl_level_thresholds_link'),
324 $msgBox = $this->DIC->ui()->factory()->messageBox()->failure(
$message)->withLinks(array($link));
326 return $this->DIC->ui()->renderer()->render($msgBox);
331 if (!$this->testOBJ->isFixedTest()) {
335 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
337 $assignmentList->setParentObjId($this->testOBJ->getId());
338 $assignmentList->loadFromDb();
340 return $assignmentList->hasSkillsAssignedLowerThanBarrier();
345 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
348 $this->
lng->txt(
'tst_skill_triggerings_num_req_answers_not_reached_warn'),
355 if (!$this->testOBJ->isDynamicTest()) {
356 $this->ensureInitialisedSessionLockString();
358 $this->setParameter($this->getTestPlayerGUI(),
'lock', $this->getSessionLockString());
359 $this->setParameter($this->getTestPlayerGUI(),
'sequence', $this->getTestSession()->getLastSequence());
360 $this->setParameter(
'ilObjTestGUI',
'ref_id', $this->getTestOBJ()->getRefId());
362 $this->setFormAction($this->buildFormAction($this->getTestPlayerGUI()));
365 $online_access =
false;
366 if ($this->getTestOBJ()->getFixedParticipants()) {
367 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
369 if ($online_access_result ===
true) {
370 $online_access =
true;
372 $this->addInfoMessage($online_access_result);
376 if (!$this->getTestOBJ()->getOfflineStatus() && $this->getTestOBJ()->isComplete($this->getTestQuestionSetConfig())) {
377 if ((!$this->getTestOBJ()->getFixedParticipants() || $online_access) && $this->
access->checkAccess(
"read",
"", $this->getTestOBJ()->getRefId())) {
378 $executable = $this->getTestOBJ()->isExecutable(
379 $this->getTestSession(),
380 $this->getTestSession()->getUserId(),
381 $allowPassIncrease =
true
384 if ($executable[
"executable"]) {
385 if ($this->getTestOBJ()->areObligationsEnabled() && $this->getTestOBJ()->hasObligations($this->getTestOBJ()->getTestId())) {
386 $this->addInfoMessage($this->
lng->txt(
'tst_test_contains_obligatory_questions'));
389 if ($this->getTestSession()->getActiveId() > 0) {
391 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
393 $testPassesSelector->setActiveId($this->getTestSession()->getActiveId());
394 $testPassesSelector->setLastFinishedPass($this->getTestSession()->getLastFinishedPass());
396 $closedPasses = $testPassesSelector->getClosedPasses();
397 $existingPasses = $testPassesSelector->getExistingPasses();
399 if ($existingPasses > $closedPasses) {
401 $btn->setCaption(
'tst_resume_test');
402 $btn->setCommand(
'resumePlayer');
403 $btn->setPrimary(
true);
404 $this->addButtonInstance($btn);
407 $btn->setCaption($this->getTestOBJ()->getStartTestLabel($this->getTestSession()->getActiveId()),
false);
408 $btn->setCommand(
'startPlayer');
409 $btn->setPrimary(
true);
410 $this->addButtonInstance($btn);
415 $btn->setCaption($this->getTestOBJ()->getStartTestLabel($this->getTestSession()->getActiveId()),
false);
416 $btn->setCommand(
'startPlayer');
417 $btn->setPrimary(
true);
418 $this->addButtonInstance($btn);
421 $this->addInfoMessage($executable[
'errormessage']);
426 if ($this->getItems()) {
427 $this->addSeparator();
430 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
431 $anonymous_id =
new ilTextInputGUI($this->
lng->txt(
'enter_anonymous_code'),
'anonymous_id');
432 $anonymous_id->setSize(8);
433 $this->addInputItem($anonymous_id,
true);
435 $button->setCaption(
'submit');
436 $button->setCommand(
'setAnonymousId');
437 $this->addButtonInstance($button);
440 if ($this->getTestOBJ()->getOfflineStatus() && !$this->getTestQuestionSetConfig()->areDepenciesBroken()) {
445 if ($this->
access->checkAccess(
"write",
"", $this->getTestOBJ()->getRefId())) {
446 $links[] = $this->DIC->ui()->factory()->link()->standard(
447 $this->DIC->language()->txt(
'test_edit_settings'),
448 $this->buildLinkTarget(
'ilobjtestsettingsgeneralgui')
452 $msgBox = $this->DIC->ui()->factory()->messageBox()->info(
$message)->withLinks($links);
454 $this->populateMessage($this->DIC->ui()->renderer()->render($msgBox));
457 if ($this->
access->checkAccess(
"write",
"", $this->getTestOBJ()->getRefId())) {
458 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
460 require_once
'Modules/Test/classes/class.ilTestSkillLevelThresholdImportFails.php';
463 if ($qsaImportFails->failedImportsRegistered() || $sltImportFails->failedImportsRegistered()) {
464 $importFailsMsg = array();
466 if ($qsaImportFails->failedImportsRegistered()) {
467 $importFailsMsg[] = $qsaImportFails->getFailedImportsMessage($this->
lng);
470 if ($sltImportFails->failedImportsRegistered()) {
471 $importFailsMsg[] = $sltImportFails->getFailedImportsMessage($this->
lng);
474 $message = implode(
'<br />', $importFailsMsg);
476 $button = $this->DIC->ui()->factory()->button()->standard(
477 $this->DIC->language()->txt(
'ass_skl_import_fails_remove_btn'),
478 $this->DIC->ctrl()->getLinkTargetByClass(
'ilObjTestGUI',
'removeImportFails')
481 $msgBox = $this->DIC->ui()->factory()->messageBox()->failure(
$message)->withButtons(array($button));
483 $this->populateMessage($this->DIC->ui()->renderer()->render($msgBox));
484 } elseif ($this->getTestOBJ()->isSkillServiceToBeConsidered()) {
485 if ($this->areSkillLevelThresholdsMissing()) {
486 $this->populateMessage($this->getSkillLevelThresholdsMissingInfo());
489 if ($this->hasFixedQuestionSetSkillAssignsLowerThanBarrier()) {
490 $this->addInfoMessage($this->getSkillAssignBarrierInfo());
494 if ($this->getTestQuestionSetConfig()->areDepenciesBroken()) {
495 $this->addFailureMessage($this->getTestQuestionSetConfig()->getDepenciesBrokenMessage($this->
lng));
498 } elseif ($this->getTestQuestionSetConfig()->areDepenciesInVulnerableState()) {
499 $this->addInfoMessage($this->getTestQuestionSetConfig()->getDepenciesInVulnerableStateMessage($this->
lng));
506 $this->DIC->ui()->mainTemplate()->setCurrentBlock(
'mess');
507 $this->DIC->ui()->mainTemplate()->setVariable(
'MESSAGE',
$message);
508 $this->DIC->ui()->mainTemplate()->parseCurrentBlock();
513 $info_messages = $this->getInfoMessages();
514 if ($info_messages !== array()) {
515 $this->main_tpl->setOnScreenMessage(
'info', array_pop($info_messages));
518 $failure_messages = $this->getFailureMessages();
519 if ($failure_messages !== array()) {
520 $this->main_tpl->setOnScreenMessage(
'failure', array_pop($failure_messages));
Class ilCtrl provides processing control methods.
static getSkillTriggerAnswerNumberBarrier()
static _lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CMD_SHOW_SKILL_THRESHOLDS
This class represents a text property in a property form.
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Readable part of repository interface to ilComponentDataDB.