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());
230 if (is_object($target)) {
231 $target = get_class($target);
239 if (is_array($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);
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');
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()) {
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;
377 if ((!$this->
getTestOBJ()->getFixedParticipants() || $online_access) && $this->
access->checkAccess(
"read",
"", $this->getTestOBJ()->getRefId())) {
378 $executable = $this->
getTestOBJ()->isExecutable(
381 $allowPassIncrease =
true 384 if ($executable[
"executable"]) {
386 $this->
addInfoMessage($this->
lng->txt(
'tst_test_contains_obligatory_questions'));
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);
408 $btn->setCommand(
'startPlayer');
409 $btn->setPrimary(
true);
416 $btn->setCommand(
'startPlayer');
417 $btn->setPrimary(
true);
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);
435 $button->setCaption(
'submit');
436 $button->setCommand(
'setAnonymousId');
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'),
452 $msgBox = $this->
DIC->ui()->factory()->messageBox()->info(
$message)->withLinks($links);
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));
484 } elseif ($this->
getTestOBJ()->isSkillServiceToBeConsidered()) {
506 $this->
DIC->ui()->mainTemplate()->setCurrentBlock(
'mess');
507 $this->
DIC->ui()->mainTemplate()->setVariable(
'MESSAGE',
$message);
508 $this->
DIC->ui()->mainTemplate()->parseCurrentBlock();
514 if ($info_messages !== array()) {
515 $this->main_tpl->setOnScreenMessage(
'info', array_pop($info_messages));
519 if ($failure_messages !== array()) {
520 $this->main_tpl->setOnScreenMessage(
'failure', array_pop($failure_messages));
Readable part of repository interface to ilComponentDataDB.
static _lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
const CMD_SHOW_SKILL_THRESHOLDS
static getSkillTriggerAnswerNumberBarrier()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...