3 declare(strict_types=0);
    41     protected int $section = self::SECTION_UNDEFINED;
    65     protected \ILIAS\HTTP\Services 
$http;
    71         $this->parent_obj = $a_parent;
    76         $this->
ctrl = $DIC->ctrl();
    77         $this->
lng = $DIC->language();
    78         $this->tree = $DIC->repositoryTree();
    79         $this->tpl = $DIC->ui()->mainTemplate();
    80         $this->workflow = $DIC->ui()->factory()->listing()->workflow();
    81         $this->ui_renderer = $DIC->ui()->renderer();
    82         $this->
http = $DIC->http();
    88         if (self::$instance !== null) {
    89             return self::$instance;
    91         return self::$instance = 
new self($a_parent);
    96         if ($this->forced_test_type > 0) {
   100         if ($this->
http->wrapper()->query()->has(
'tt')) {
   101             return $this->
http->wrapper()->query()->retrieve(
   124         $this->section = $a_section;
   134         return (array) ($this->failures_by_section[$a_section] ?? []);
   137     protected function appendFailure(
int $a_section, 
string $a_failure_msg_key, 
bool $is_error = 
false): void
   139         $this->failures_by_section[$a_section][] = $a_failure_msg_key;
   141             $this->error_by_section[$a_section] = $a_section;
   147         $this->cmd_class = $a_cmd_class;
   171             return 'showObjectiveCreation';
   176         if ($this->
getSettings()->worksWithInitialTest()) {
   179                 if ($this->
getSettings()->hasSeparateInitialTests()) {
   180                     return 'testsOverviewInitial';
   182                     return 'testOverviewInitial';
   188             if ($this->
getSettings()->hasSeparateQualifiedTests()) {
   189                 return 'testsOverviewQualified';
   191                 return 'testOverviewQualified';
   194         return 'listObjectives';
   204         $steps[] = $this->workflow->step(
   205             $this->
lng->txt(
'crs_objective_status_settings'),
   213         $steps[] = $this->workflow->step(
   214             $this->
lng->txt(
'crs_objective_status_objective_creation'),
   218                 : $this->
ctrl->getLinkTarget($this->
getCmdClass(), 
'showObjectiveCreation')
   219         )->withStatus($this->
determineStatus($done, self::SECTION_OBJECTIVES_NEW));
   226         $steps[] = $this->workflow->step(
   227             $this->
lng->txt(
'crs_objective_status_materials'),
   229             $this->
ctrl->getLinkTargetByClass(
'ilobjcoursegui', 
'enableAdministrationPanel')
   236             $command = $this->
getSettings()->hasSeparateInitialTests() ?
   241             $steps[] = $this->workflow->step(
   242                 $this->
lng->txt(
'crs_objective_status_itest'),
   251         $command = $this->
getSettings()->hasSeparateQualifiedTests() ?
   255         $steps[] = $this->workflow->step(
   256             $this->
lng->txt(
'crs_objective_status_qtest'),
   266         $steps[] = $this->workflow->step(
   267             $this->
lng->txt(
'crs_objective_status_objectives'),
   270         )->withStatus($this->
determineStatus($done, self::SECTION_OBJECTIVES));
   272         $list = $this->workflow->linear(
   273             $this->
lng->txt(
'crs_objective_status_configure'),
   276         return $this->ui_renderer->render($list);
   285         foreach ($this->
getFailures($a_section) as $failure_code) {
   286             $mess[] = $this->
lng->txt($failure_code);
   294             return Step::SUCCESSFULLY;
   296             return Step::UNSUCCESSFULLY;
   297         } elseif ($this->section === $section) {
   298             return Step::IN_PROGRESS;
   300             return Step::NOT_STARTED;
   308             self::SECTION_SETTINGS => 0,
   309             self::SECTION_OBJECTIVES_NEW => 1,
   310             self::SECTION_MATERIALS => 2,
   311             self::SECTION_ITES => 3,
   312             self::SECTION_QTEST => $itest_enabled ? 4 : 3,
   313             self::SECTION_OBJECTIVES => $itest_enabled ? 5 : 4
   321         return isset($this->error_by_section[$a_section]);
   333         if (!$ret && $a_set_errors) {
   334             $this->
appendFailure(self::SECTION_OBJECTIVES_NEW, 
'crs_no_objectives_created');
   342         $childs = $this->tree->getChilds($this->
getParentObject()->getRefId());
   343         foreach ($childs as $tnode) {
   344             if ($tnode[
'type'] == 
'rolf') {
   347             if ($tnode[
'child'] == $this->
getSettings()->getInitialTest()) {
   350             if ($tnode[
'child'] == $this->
getSettings()->getQualifiedTest()) {
   356             $this->
appendFailure(self::SECTION_MATERIALS, 
'crs_loc_err_stat_no_materials');
   363         if ($this->
getSettings()->hasSeparateInitialTests()) {
   364             if (count($this->objectives) <= 0) {
   370                 if (!$this->tree->isInTree($tst_ref)) {
   372                         $this->
appendFailure(self::SECTION_ITES, 
'crs_loc_err_stat_no_it');
   378                         $this->
appendFailure(self::SECTION_ITES, 
'crs_loc_err_stat_tst_offline', 
true);
   387         if (!$this->tree->isInTree($tst_ref)) {
   389                 $this->
appendFailure(self::SECTION_ITES, 
'crs_loc_err_stat_no_it');
   395                 $this->
appendFailure(self::SECTION_ITES, 
'crs_loc_err_stat_tst_offline', 
true);
   404         if ($this->
getSettings()->hasSeparateQualifiedTests()) {
   405             if (count($this->objectives) <= 0) {
   414                 if (!$this->tree->isInTree($tst_ref)) {
   416                         $this->
appendFailure(self::SECTION_QTEST, 
'crs_loc_err_stat_no_qt');
   422                         $this->
appendFailure(self::SECTION_QTEST, 
'crs_loc_err_stat_tst_offline', 
true);
   429         $tst_ref = $this->
getSettings()->getQualifiedTest();
   430         if (!$this->tree->isInTree($tst_ref)) {
   432                 $this->
appendFailure(self::SECTION_QTEST, 
'crs_loc_err_stat_no_qt');
   438                 $this->
appendFailure(self::SECTION_QTEST, 
'crs_loc_err_stat_tst_offline', 
true);
   450                     $this->parent_obj->getId(),
   479         if ($num_active === 0) {
   481                 $this->
appendFailure(self::SECTION_OBJECTIVES, 
'crs_loc_err_no_active_lo');
   487             if ($obj->getMaterials() === []) {
   489                     $this->
appendFailure(self::SECTION_OBJECTIVES, 
'crs_loc_err_no_active_mat');
   499                     $this->
appendFailure(self::SECTION_OBJECTIVES, 
'crs_loc_err_no_active_qst');
   507                 $this->
appendFailure(self::SECTION_OBJECTIVES, 
'crs_loc_err_no_active_qst');
   527         $tst = $factory->getInstanceByRefId($qt, 
false);
   532         $tries = $tst->getNrOfTries();
   541         return $obj_tries <= $tries;
 
determineStatus(bool $done, int $section)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
appendFailure(int $a_section, string $a_failure_msg_key, bool $is_error=false)
 
static lookupSequences(int $a_container_id, int $a_objective_id, int $a_test_id)
 
getFailures(int $a_section)
 
getObjectivesAvailableStatus($a_set_errors=false)
 
ILIAS HTTP Services $http
 
static lookupQuestionsByObjective(int $a_test_id, int $a_objective)
 
Presentation of the status of single steps during the configuration process. 
 
ILIAS Refinery Factory $refinery
 
lookupQuestionsAssigned(int $a_test_ref_id)
 
setCmdClass(object $a_cmd_class)
 
getFailureMessages(int $a_section)
 
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
 
ilGlobalTemplateInterface $tpl
 
static _lookupObjId(int $ref_id)
 
ilLOTestAssignments $assignments
 
class ilCourseObjectiveMaterials 
 
static http()
Fetches the global http state from ILIAS. 
 
static _getCountObjectives(int $a_obj_id, bool $a_activated_only=false)
 
static getInstance(ilObject $a_parent)
 
getInitialTestStatus(bool $a_set_errors=true)
 
static lookupMaxPasses(int $a_objective_id)
 
This is the interface for a workflow factory. 
 
const SECTION_OBJECTIVES_NEW
 
static getInstanceByObjId(int $a_obj_id)
 
static _isOffline(int $obj_id)
returns the objects's OFFline status 
 
static lookupRandomTest(int $a_test_obj_id)
 
setSection(int $a_section)
 
checkTestOnline(int $a_ref_id)
 
getMaterialsStatus(bool $a_set_errors=true)
 
static getInstance(int $a_container_id)
 
const TYPE_TEST_QUALIFIED
 
getQualifiedTestStatus(bool $a_set_errors=true)
 
__construct(ilObject $a_parent)
 
getObjectivesStatus(bool $a_set_errors=true)
 
array $failures_by_section
 
hasSectionErrors(int $a_section)