ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLOEditorStatus Class Reference

Presentation of the status of single steps during the configuration process. More...

+ Collaboration diagram for ilLOEditorStatus:

Public Member Functions

 __construct (ilObject $a_parent)
 
 getObjectives ()
 
 getAssignments ()
 
 setSection (int $a_section)
 
 getSection ()
 
 getFailures (int $a_section)
 
 setCmdClass (object $a_cmd_class)
 
 getCmdClass ()
 
 getParentObject ()
 
 getSettings ()
 
 getFirstFailedStep ()
 
 getHTML ()
 
 getFailureMessages (int $a_section)
 
 determineStatus (bool $done, int $section)
 
 determineActiveSection ()
 
 hasSectionErrors (int $a_section)
 

Static Public Member Functions

static getInstance (ilObject $a_parent)
 

Data Fields

const SECTION_UNDEFINED = 0
 
const SECTION_SETTINGS = 1
 
const SECTION_MATERIALS = 2
 
const SECTION_ITES = 3
 
const SECTION_QTEST = 4
 
const SECTION_OBJECTIVES = 5
 
const SECTION_OBJECTIVES_NEW = 6
 

Protected Member Functions

 initTestTypeFromQuery ()
 
 appendFailure (int $a_section, string $a_failure_msg_key, bool $is_error=false)
 
 getSettingsStatus ()
 
 getObjectivesAvailableStatus ($a_set_errors=false)
 
 getMaterialsStatus (bool $a_set_errors=true)
 
 getInitialTestStatus (bool $a_set_errors=true)
 
 getQualifiedTestStatus (bool $a_set_errors=true)
 
 lookupQuestionsAssigned (int $a_test_ref_id)
 
 getObjectivesStatus (bool $a_set_errors=true)
 
 getStartStatus ()
 
 checkNumberOfTries ()
 
 checkTestOnline (int $a_ref_id)
 

Protected Attributes

int $section = self::SECTION_UNDEFINED
 
array $failures_by_section = []
 
array $error_by_section = []
 
array $objectives = []
 
int $forced_test_type = 0
 
ilLOSettings $settings
 
ilLOTestAssignments $assignments
 
ilObject $parent_obj
 
object $cmd_class = null
 
string $html = ''
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilTree $tree
 
ilGlobalTemplateInterface $tpl
 
UiRenderer $ui_renderer
 
UiWorkflow $workflow
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Services $http
 

Static Protected Attributes

static self $instance = null
 

Detailed Description

Presentation of the status of single steps during the configuration process.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 29 of file class.ilLOEditorStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ilLOEditorStatus::__construct ( ilObject  $a_parent)

Definition at line 67 of file class.ilLOEditorStatus.php.

References $DIC, ilCourseObjective\_getObjectiveIds(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOTestAssignments\getInstance(), ilLOSettings\getInstanceByObjId(), getParentObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\settings().

68  {
69  global $DIC;
70 
71  $this->parent_obj = $a_parent;
73  $this->assignments = ilLOTestAssignments::getInstance($this->getParentObject()->getId());
74  $this->objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId());
75 
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();
83  $this->refinery = $DIC->refinery();
84  }
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
static getInstanceByObjId(int $a_obj_id)
static getInstance(int $a_container_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ appendFailure()

ilLOEditorStatus::appendFailure ( int  $a_section,
string  $a_failure_msg_key,
bool  $is_error = false 
)
protected

Definition at line 137 of file class.ilLOEditorStatus.php.

Referenced by getInitialTestStatus(), getMaterialsStatus(), getObjectivesAvailableStatus(), getObjectivesStatus(), and getQualifiedTestStatus().

137  : void
138  {
139  $this->failures_by_section[$a_section][] = $a_failure_msg_key;
140  if ($is_error) {
141  $this->error_by_section[$a_section] = $a_section;
142  }
143  }
+ Here is the caller graph for this function:

◆ checkNumberOfTries()

ilLOEditorStatus::checkNumberOfTries ( )
protected

Definition at line 519 of file class.ilLOEditorStatus.php.

References getObjectives(), getSettings(), and ilCourseObjective\lookupMaxPasses().

519  : bool
520  {
521  $qt = $this->getSettings()->getQualifiedTest();
522  if (!$qt) {
523  return true;
524  }
525 
526  $factory = new ilObjectFactory();
527  $tst = $factory->getInstanceByRefId($qt, false);
528 
529  if (!$tst instanceof ilObjTest) {
530  return true;
531  }
532  $tries = $tst->getNrOfTries();
533  if (!$tries) {
534  return true;
535  }
536 
537  $obj_tries = 0;
538  foreach ($this->getObjectives() as $objective) {
539  $obj_tries += ilCourseObjective::lookupMaxPasses($objective);
540  }
541  return $obj_tries <= $tries;
542  }
static lookupMaxPasses(int $a_objective_id)
+ Here is the call graph for this function:

◆ checkTestOnline()

ilLOEditorStatus::checkTestOnline ( int  $a_ref_id)
protected

Definition at line 544 of file class.ilLOEditorStatus.php.

References ilObjTestAccess\_isOffline(), and ilObject\_lookupObjId().

Referenced by getInitialTestStatus(), and getQualifiedTestStatus().

544  : bool
545  {
547  }
static _lookupObjId(int $ref_id)
static _isOffline(int $obj_id)
returns the objects&#39;s OFFline status
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineActiveSection()

ilLOEditorStatus::determineActiveSection ( )

Definition at line 304 of file class.ilLOEditorStatus.php.

References $section, ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), and getParentObject().

Referenced by getHTML().

304  : int
305  {
306  $itest_enabled = ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->worksWithInitialTest();
307  $active_map = array(
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
314  );
315 
316  return $active_map[$this->section];
317  }
static getInstanceByObjId(int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineStatus()

ilLOEditorStatus::determineStatus ( bool  $done,
int  $section 
)

Definition at line 291 of file class.ilLOEditorStatus.php.

References hasSectionErrors().

Referenced by getHTML().

291  : int
292  {
293  if ($done) {
294  return Step::SUCCESSFULLY;
295  } elseif ($this->hasSectionErrors($section)) {
296  return Step::UNSUCCESSFULLY;
297  } elseif ($this->section === $section) {
298  return Step::IN_PROGRESS;
299  } else {
300  return Step::NOT_STARTED;
301  }
302  }
hasSectionErrors(int $a_section)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignments()

ilLOEditorStatus::getAssignments ( )

Definition at line 117 of file class.ilLOEditorStatus.php.

References $assignments.

Referenced by getInitialTestStatus(), and getQualifiedTestStatus().

118  {
119  return $this->assignments;
120  }
Settings for LO courses.
ilLOTestAssignments $assignments
+ Here is the caller graph for this function:

◆ getCmdClass()

ilLOEditorStatus::getCmdClass ( )

Definition at line 150 of file class.ilLOEditorStatus.php.

References $cmd_class.

Referenced by getHTML().

150  : object
151  {
152  return $this->cmd_class;
153  }
+ Here is the caller graph for this function:

◆ getFailureMessages()

ilLOEditorStatus::getFailureMessages ( int  $a_section)
Returns
string[]

Definition at line 282 of file class.ilLOEditorStatus.php.

References getFailures(), and ILIAS\Repository\lng().

Referenced by getHTML().

282  : array
283  {
284  $mess = array();
285  foreach ($this->getFailures($a_section) as $failure_code) {
286  $mess[] = $this->lng->txt($failure_code);
287  }
288  return $mess;
289  }
getFailures(int $a_section)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFailures()

ilLOEditorStatus::getFailures ( int  $a_section)

Definition at line 132 of file class.ilLOEditorStatus.php.

Referenced by getFailureMessages().

132  : array
133  {
134  return (array) ($this->failures_by_section[$a_section] ?? []);
135  }
+ Here is the caller graph for this function:

◆ getFirstFailedStep()

ilLOEditorStatus::getFirstFailedStep ( )

Definition at line 165 of file class.ilLOEditorStatus.php.

References getInitialTestStatus(), getMaterialsStatus(), getObjectivesAvailableStatus(), getQualifiedTestStatus(), getSettings(), getSettingsStatus(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

165  : string
166  {
167  if (!$this->getSettingsStatus()) {
168  return 'settings';
169  }
170  if (!$this->getObjectivesAvailableStatus()) {
171  return 'showObjectiveCreation';
172  }
173  if (!$this->getMaterialsStatus(false)) {
174  return 'materials';
175  }
176  if ($this->getSettings()->worksWithInitialTest()) {
177  if (!$this->getInitialTestStatus(false)) {
178  $this->forced_test_type = ilLOSettings::TYPE_TEST_INITIAL;
179  if ($this->getSettings()->hasSeparateInitialTests()) {
180  return 'testsOverviewInitial';
181  } else {
182  return 'testOverviewInitial';
183  }
184  }
185  }
186  if (!$this->getQualifiedTestStatus(false)) {
187  $this->forced_test_type = ilLOSettings::TYPE_TEST_QUALIFIED;
188  if ($this->getSettings()->hasSeparateQualifiedTests()) {
189  return 'testsOverviewQualified';
190  } else {
191  return 'testOverviewQualified';
192  }
193  }
194  return 'listObjectives';
195  }
getObjectivesAvailableStatus($a_set_errors=false)
getInitialTestStatus(bool $a_set_errors=true)
getMaterialsStatus(bool $a_set_errors=true)
getQualifiedTestStatus(bool $a_set_errors=true)
+ Here is the call graph for this function:

◆ getHTML()

ilLOEditorStatus::getHTML ( )

Definition at line 197 of file class.ilLOEditorStatus.php.

References ILIAS\Repository\ctrl(), determineActiveSection(), determineStatus(), getCmdClass(), getFailureMessages(), ILIAS\Survey\Mode\getId(), getInitialTestStatus(), ilLOSettings\getInstanceByObjId(), getMaterialsStatus(), getObjectivesAvailableStatus(), getObjectivesStatus(), getParentObject(), getQualifiedTestStatus(), getSettings(), getSettingsStatus(), initTestTypeFromQuery(), ILIAS\Repository\lng(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

197  : string
198  {
199  $steps = [];
200  // Step 1
201  // course settings
202  $done = $this->getSettingsStatus();
203 
204  $steps[] = $this->workflow->step(
205  $this->lng->txt('crs_objective_status_settings'),
206  implode(" ", $this->getFailureMessages(self::SECTION_SETTINGS)),
207  $this->ctrl->getLinkTarget($this->getCmdClass(), 'settings')
208  )->withStatus($this->determineStatus($done, self::SECTION_SETTINGS));
209 
210  // Step 1.1
211  $done = $this->getObjectivesAvailableStatus(true);
212 
213  $steps[] = $this->workflow->step(
214  $this->lng->txt('crs_objective_status_objective_creation'),
215  implode(" ", $this->getFailureMessages(self::SECTION_OBJECTIVES_NEW)),
216  $done
217  ? $this->ctrl->getLinkTarget($this->getCmdClass(), 'listObjectives')
218  : $this->ctrl->getLinkTarget($this->getCmdClass(), 'showObjectiveCreation')
219  )->withStatus($this->determineStatus($done, self::SECTION_OBJECTIVES_NEW));
220 
221  // Step 2
222  // course material
223  $done = $this->getMaterialsStatus(true);
224  //$this->ctrl->setParameterByClass('ilobjcoursegui', 'cmd', 'enableAdministrationPanel');
225 
226  $steps[] = $this->workflow->step(
227  $this->lng->txt('crs_objective_status_materials'),
228  implode(" ", $this->getFailureMessages(self::SECTION_MATERIALS)),
229  $this->ctrl->getLinkTargetByClass('ilobjcoursegui', 'enableAdministrationPanel')
230  )->withStatus($this->determineStatus($done, self::SECTION_MATERIALS));
231 
232  // Step 3
233  // course itest
234  if (ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->worksWithInitialTest()) {
235  $done = $this->getInitialTestStatus();
236  $command = $this->getSettings()->hasSeparateInitialTests() ?
237  'testsOverview' :
238  'testOverview';
239  $this->ctrl->setParameter($this->getCmdClass(), 'tt', ilLOSettings::TYPE_TEST_INITIAL);
240 
241  $steps[] = $this->workflow->step(
242  $this->lng->txt('crs_objective_status_itest'),
243  implode(" ", $this->getFailureMessages(self::SECTION_ITES)),
244  $this->ctrl->getLinkTarget($this->getCmdClass(), $command)
245  )->withStatus($this->determineStatus($done, self::SECTION_ITES));
246  }
247 
248  // Step 4
249  // course qtest
250  $done = $this->getQualifiedTestStatus();
251  $command = $this->getSettings()->hasSeparateQualifiedTests() ?
252  'testsOverview' :
253  'testOverview';
254  $this->ctrl->setParameter($this->getCmdClass(), 'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
255  $steps[] = $this->workflow->step(
256  $this->lng->txt('crs_objective_status_qtest'),
257  implode(" ", $this->getFailureMessages(self::SECTION_QTEST)),
258  $this->ctrl->getLinkTarget($this->getCmdClass(), $command)
259  )->withStatus($this->determineStatus($done, self::SECTION_QTEST));
260 
261  // Step 5
262  // course qtest
263  $done = $this->getObjectivesStatus();
264  $this->ctrl->setParameter($this->getCmdClass(), 'tt', $this->initTestTypeFromQuery());
265 
266  $steps[] = $this->workflow->step(
267  $this->lng->txt('crs_objective_status_objectives'),
268  implode(" ", $this->getFailureMessages(self::SECTION_OBJECTIVES)),
269  $this->ctrl->getLinkTarget($this->getCmdClass(), 'listObjectives')
270  )->withStatus($this->determineStatus($done, self::SECTION_OBJECTIVES));
271 
272  $list = $this->workflow->linear(
273  $this->lng->txt('crs_objective_status_configure'),
274  $steps
275  )->withActive($this->determineActiveSection());
276  return $this->ui_renderer->render($list);
277  }
determineStatus(bool $done, int $section)
getObjectivesAvailableStatus($a_set_errors=false)
getFailureMessages(int $a_section)
getInitialTestStatus(bool $a_set_errors=true)
static getInstanceByObjId(int $a_obj_id)
getMaterialsStatus(bool $a_set_errors=true)
getQualifiedTestStatus(bool $a_set_errors=true)
getObjectivesStatus(bool $a_set_errors=true)
+ Here is the call graph for this function:

◆ getInitialTestStatus()

ilLOEditorStatus::getInitialTestStatus ( bool  $a_set_errors = true)
protected

Definition at line 361 of file class.ilLOEditorStatus.php.

References appendFailure(), checkTestOnline(), getAssignments(), getObjectives(), getSettings(), and ilLOSettings\TYPE_TEST_INITIAL.

Referenced by getFirstFailedStep(), and getHTML().

361  : bool
362  {
363  if ($this->getSettings()->hasSeparateInitialTests()) {
364  if (count($this->objectives) <= 0) {
365  return false;
366  }
367 
368  foreach ($this->getObjectives() as $objective_id) {
369  $tst_ref = $this->getAssignments()->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_INITIAL);
370  if (!$this->tree->isInTree($tst_ref)) {
371  if ($a_set_errors) {
372  $this->appendFailure(self::SECTION_ITES, 'crs_loc_err_stat_no_it');
373  }
374  return false;
375  }
376  if (!$this->checkTestOnline($tst_ref)) {
377  if ($a_set_errors) {
378  $this->appendFailure(self::SECTION_ITES, 'crs_loc_err_stat_tst_offline', true);
379  }
380  return false;
381  }
382  }
383  return true;
384  }
385 
386  $tst_ref = $this->getSettings()->getInitialTest();
387  if (!$this->tree->isInTree($tst_ref)) {
388  if ($a_set_errors) {
389  $this->appendFailure(self::SECTION_ITES, 'crs_loc_err_stat_no_it');
390  }
391  return false;
392  }
393  if (!$this->checkTestOnline($tst_ref)) {
394  if ($a_set_errors) {
395  $this->appendFailure(self::SECTION_ITES, 'crs_loc_err_stat_tst_offline', true);
396  }
397  return false;
398  }
399  return true;
400  }
appendFailure(int $a_section, string $a_failure_msg_key, bool $is_error=false)
checkTestOnline(int $a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstance()

static ilLOEditorStatus::getInstance ( ilObject  $a_parent)
static

Definition at line 86 of file class.ilLOEditorStatus.php.

References null.

Referenced by ilLOEditorGUI\executeCommand().

86  : self
87  {
88  if (self::$instance !== null) {
89  return self::$instance;
90  }
91  return self::$instance = new self($a_parent);
92  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getMaterialsStatus()

ilLOEditorStatus::getMaterialsStatus ( bool  $a_set_errors = true)
protected

Definition at line 340 of file class.ilLOEditorStatus.php.

References appendFailure(), getParentObject(), and getSettings().

Referenced by getFirstFailedStep(), and getHTML().

340  : bool
341  {
342  $childs = $this->tree->getChilds($this->getParentObject()->getRefId());
343  foreach ($childs as $tnode) {
344  if ($tnode['type'] == 'rolf') {
345  continue;
346  }
347  if ($tnode['child'] == $this->getSettings()->getInitialTest()) {
348  continue;
349  }
350  if ($tnode['child'] == $this->getSettings()->getQualifiedTest()) {
351  continue;
352  }
353  return true;
354  }
355  if ($a_set_errors) {
356  $this->appendFailure(self::SECTION_MATERIALS, 'crs_loc_err_stat_no_materials');
357  }
358  return false;
359  }
appendFailure(int $a_section, string $a_failure_msg_key, bool $is_error=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectives()

ilLOEditorStatus::getObjectives ( )
Returns
int[]

Definition at line 112 of file class.ilLOEditorStatus.php.

References $objectives.

Referenced by checkNumberOfTries(), getInitialTestStatus(), getObjectivesAvailableStatus(), getQualifiedTestStatus(), and lookupQuestionsAssigned().

112  : array
113  {
114  return $this->objectives;
115  }
+ Here is the caller graph for this function:

◆ getObjectivesAvailableStatus()

ilLOEditorStatus::getObjectivesAvailableStatus (   $a_set_errors = false)
protected

Definition at line 329 of file class.ilLOEditorStatus.php.

References appendFailure(), and getObjectives().

Referenced by getFirstFailedStep(), getHTML(), and getObjectivesStatus().

329  : bool
330  {
331  $ret = count($this->getObjectives());
332 
333  if (!$ret && $a_set_errors) {
334  $this->appendFailure(self::SECTION_OBJECTIVES_NEW, 'crs_no_objectives_created');
335  return false;
336  }
337  return true;
338  }
appendFailure(int $a_section, string $a_failure_msg_key, bool $is_error=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectivesStatus()

ilLOEditorStatus::getObjectivesStatus ( bool  $a_set_errors = true)
protected

Definition at line 472 of file class.ilLOEditorStatus.php.

References ilCourseObjective\_getCountObjectives(), ilCourseObjective\_getObjectiveIds(), appendFailure(), ILIAS\Survey\Mode\getId(), getObjectivesAvailableStatus(), getParentObject(), getSettings(), and lookupQuestionsAssigned().

Referenced by getHTML().

472  : bool
473  {
474  if (!$this->getObjectivesAvailableStatus($a_set_errors)) {
475  return false;
476  }
477 
478  $num_active = ilCourseObjective::_getCountObjectives($this->getParentObject()->getId(), true);
479  if ($num_active === 0) {
480  if ($a_set_errors) {
481  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_lo');
482  }
483  return false;
484  }
485  foreach (ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(), true) as $objective_id) {
486  $obj = new ilCourseObjectiveMaterials($objective_id);
487  if ($obj->getMaterials() === []) {
488  if ($a_set_errors) {
489  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_mat');
490  }
491  return false;
492  }
493  }
494  // check for assigned initial test questions
495  if ($this->getSettings()->worksWithInitialTest() && !$this->getSettings()->hasSeparateInitialTests()) {
496  // check for assigned questions
497  if (!$this->lookupQuestionsAssigned($this->getSettings()->getInitialTest())) {
498  if ($a_set_errors) {
499  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_qst');
500  }
501  return false;
502  }
503  }
504  // check for assigned questions
505  if (!$this->getSettings()->hasSeparateQualifiedTests() && !$this->lookupQuestionsAssigned($this->getSettings()->getQualifiedTest())) {
506  if ($a_set_errors) {
507  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_qst');
508  }
509  return false;
510  }
511  return true;
512  }
appendFailure(int $a_section, string $a_failure_msg_key, bool $is_error=false)
getObjectivesAvailableStatus($a_set_errors=false)
lookupQuestionsAssigned(int $a_test_ref_id)
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
class ilCourseObjectiveMaterials
static _getCountObjectives(int $a_obj_id, bool $a_activated_only=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentObject()

ilLOEditorStatus::getParentObject ( )

Definition at line 155 of file class.ilLOEditorStatus.php.

References $parent_obj.

Referenced by __construct(), determineActiveSection(), getHTML(), getMaterialsStatus(), and getObjectivesStatus().

155  : ilObject
156  {
157  return $this->parent_obj;
158  }
+ Here is the caller graph for this function:

◆ getQualifiedTestStatus()

ilLOEditorStatus::getQualifiedTestStatus ( bool  $a_set_errors = true)
protected

Definition at line 402 of file class.ilLOEditorStatus.php.

References appendFailure(), checkTestOnline(), getAssignments(), getObjectives(), getSettings(), and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by getFirstFailedStep(), and getHTML().

402  : bool
403  {
404  if ($this->getSettings()->hasSeparateQualifiedTests()) {
405  if (count($this->objectives) <= 0) {
406  return false;
407  }
408 
409  foreach ($this->getObjectives() as $objective_id) {
410  $tst_ref = $this->getAssignments()->getTestByObjective(
411  $objective_id,
413  );
414  if (!$this->tree->isInTree($tst_ref)) {
415  if ($a_set_errors) {
416  $this->appendFailure(self::SECTION_QTEST, 'crs_loc_err_stat_no_qt');
417  }
418  return false;
419  }
420  if (!$this->checkTestOnline($tst_ref)) {
421  if ($a_set_errors) {
422  $this->appendFailure(self::SECTION_QTEST, 'crs_loc_err_stat_tst_offline', true);
423  }
424  return false;
425  }
426  }
427  return true;
428  }
429  $tst_ref = $this->getSettings()->getQualifiedTest();
430  if (!$this->tree->isInTree($tst_ref)) {
431  if ($a_set_errors) {
432  $this->appendFailure(self::SECTION_QTEST, 'crs_loc_err_stat_no_qt');
433  }
434  return false;
435  }
436  if (!$this->checkTestOnline($tst_ref)) {
437  if ($a_set_errors) {
438  $this->appendFailure(self::SECTION_QTEST, 'crs_loc_err_stat_tst_offline', true);
439  }
440  return false;
441  }
442  return true;
443  }
appendFailure(int $a_section, string $a_failure_msg_key, bool $is_error=false)
checkTestOnline(int $a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSection()

ilLOEditorStatus::getSection ( )

Definition at line 127 of file class.ilLOEditorStatus.php.

References $section.

127  : int
128  {
129  return $this->section;
130  }

◆ getSettings()

ilLOEditorStatus::getSettings ( )

Definition at line 160 of file class.ilLOEditorStatus.php.

References $settings.

Referenced by checkNumberOfTries(), getFirstFailedStep(), getHTML(), getInitialTestStatus(), getMaterialsStatus(), getObjectivesStatus(), getQualifiedTestStatus(), and getSettingsStatus().

160  : ilLOSettings
161  {
162  return $this->settings;
163  }
Settings for LO courses.
+ Here is the caller graph for this function:

◆ getSettingsStatus()

ilLOEditorStatus::getSettingsStatus ( )
protected

Definition at line 324 of file class.ilLOEditorStatus.php.

References getSettings().

Referenced by getFirstFailedStep(), and getHTML().

324  : bool
325  {
326  return $this->getSettings()->settingsExist();
327  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStartStatus()

ilLOEditorStatus::getStartStatus ( )
protected

Definition at line 514 of file class.ilLOEditorStatus.php.

514  : bool
515  {
516  return true;
517  }

◆ hasSectionErrors()

ilLOEditorStatus::hasSectionErrors ( int  $a_section)

Definition at line 319 of file class.ilLOEditorStatus.php.

Referenced by determineStatus().

319  : bool
320  {
321  return isset($this->error_by_section[$a_section]);
322  }
+ Here is the caller graph for this function:

◆ initTestTypeFromQuery()

ilLOEditorStatus::initTestTypeFromQuery ( )
protected

Definition at line 94 of file class.ilLOEditorStatus.php.

References $forced_test_type, ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by getHTML().

94  : int
95  {
96  if ($this->forced_test_type > 0) {
98  }
99 
100  if ($this->http->wrapper()->query()->has('tt')) {
101  return $this->http->wrapper()->query()->retrieve(
102  'tt',
103  $this->refinery->kindlyTo()->int()
104  );
105  }
106  return 0;
107  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupQuestionsAssigned()

ilLOEditorStatus::lookupQuestionsAssigned ( int  $a_test_ref_id)
protected

Definition at line 445 of file class.ilLOEditorStatus.php.

References ilObject\_lookupObjId(), getObjectives(), ilCourseObjectiveQuestion\lookupQuestionsByObjective(), ilLOUtils\lookupRandomTest(), and ilLORandomTestQuestionPools\lookupSequences().

Referenced by getObjectivesStatus().

445  : bool
446  {
448  foreach ($this->getObjectives() as $objective_id) {
450  $this->parent_obj->getId(),
451  $objective_id,
452  ilObject::_lookupObjId($a_test_ref_id)
453  );
454  if ($seq === []) {
455  return false;
456  }
457  }
458  } else {
459  foreach ($this->getObjectives() as $objective_id) {
461  ilObject::_lookupObjId($a_test_ref_id),
462  $objective_id
463  );
464  if ($qsts === []) {
465  return false;
466  }
467  }
468  }
469  return true;
470  }
static lookupSequences(int $a_container_id, int $a_objective_id, int $a_test_id)
static lookupQuestionsByObjective(int $a_test_id, int $a_objective)
static _lookupObjId(int $ref_id)
static lookupRandomTest(int $a_test_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCmdClass()

ilLOEditorStatus::setCmdClass ( object  $a_cmd_class)

Definition at line 145 of file class.ilLOEditorStatus.php.

145  : void
146  {
147  $this->cmd_class = $a_cmd_class;
148  }

◆ setSection()

ilLOEditorStatus::setSection ( int  $a_section)

Definition at line 122 of file class.ilLOEditorStatus.php.

122  : void
123  {
124  $this->section = $a_section;
125  }

Field Documentation

◆ $assignments

ilLOTestAssignments ilLOEditorStatus::$assignments
protected

Definition at line 53 of file class.ilLOEditorStatus.php.

Referenced by getAssignments().

◆ $cmd_class

object ilLOEditorStatus::$cmd_class = null
protected

Definition at line 55 of file class.ilLOEditorStatus.php.

Referenced by getCmdClass().

◆ $ctrl

ilCtrlInterface ilLOEditorStatus::$ctrl
protected

Definition at line 58 of file class.ilLOEditorStatus.php.

◆ $error_by_section

array ilLOEditorStatus::$error_by_section = []
protected

Definition at line 47 of file class.ilLOEditorStatus.php.

◆ $failures_by_section

array ilLOEditorStatus::$failures_by_section = []
protected

Definition at line 44 of file class.ilLOEditorStatus.php.

◆ $forced_test_type

int ilLOEditorStatus::$forced_test_type = 0
protected

Definition at line 50 of file class.ilLOEditorStatus.php.

Referenced by initTestTypeFromQuery().

◆ $html

string ilLOEditorStatus::$html = ''
protected

Definition at line 56 of file class.ilLOEditorStatus.php.

◆ $http

ILIAS HTTP Services ilLOEditorStatus::$http
protected

Definition at line 65 of file class.ilLOEditorStatus.php.

◆ $instance

self ilLOEditorStatus::$instance = null
staticprotected

Definition at line 39 of file class.ilLOEditorStatus.php.

◆ $lng

ilLanguage ilLOEditorStatus::$lng
protected

Definition at line 59 of file class.ilLOEditorStatus.php.

◆ $objectives

array ilLOEditorStatus::$objectives = []
protected

Definition at line 49 of file class.ilLOEditorStatus.php.

Referenced by getObjectives().

◆ $parent_obj

ilObject ilLOEditorStatus::$parent_obj
protected

Definition at line 54 of file class.ilLOEditorStatus.php.

Referenced by getParentObject().

◆ $refinery

ILIAS Refinery Factory ilLOEditorStatus::$refinery
protected

Definition at line 64 of file class.ilLOEditorStatus.php.

◆ $section

int ilLOEditorStatus::$section = self::SECTION_UNDEFINED
protected

Definition at line 41 of file class.ilLOEditorStatus.php.

Referenced by determineActiveSection(), and getSection().

◆ $settings

ilLOSettings ilLOEditorStatus::$settings
protected

Definition at line 52 of file class.ilLOEditorStatus.php.

Referenced by getSettings().

◆ $tpl

ilGlobalTemplateInterface ilLOEditorStatus::$tpl
protected

Definition at line 61 of file class.ilLOEditorStatus.php.

◆ $tree

ilTree ilLOEditorStatus::$tree
protected

Definition at line 60 of file class.ilLOEditorStatus.php.

◆ $ui_renderer

UiRenderer ilLOEditorStatus::$ui_renderer
protected

Definition at line 62 of file class.ilLOEditorStatus.php.

◆ $workflow

UiWorkflow ilLOEditorStatus::$workflow
protected

Definition at line 63 of file class.ilLOEditorStatus.php.

◆ SECTION_ITES

◆ SECTION_MATERIALS

const ilLOEditorStatus::SECTION_MATERIALS = 2

Definition at line 33 of file class.ilLOEditorStatus.php.

Referenced by ilLOEditorGUI\materials().

◆ SECTION_OBJECTIVES

const ilLOEditorStatus::SECTION_OBJECTIVES = 5

◆ SECTION_OBJECTIVES_NEW

const ilLOEditorStatus::SECTION_OBJECTIVES_NEW = 6

Definition at line 37 of file class.ilLOEditorStatus.php.

Referenced by ilLOEditorGUI\showObjectiveCreation().

◆ SECTION_QTEST

◆ SECTION_SETTINGS

const ilLOEditorStatus::SECTION_SETTINGS = 1

Definition at line 32 of file class.ilLOEditorStatus.php.

Referenced by ilLOEditorGUI\settings().

◆ SECTION_UNDEFINED

const ilLOEditorStatus::SECTION_UNDEFINED = 0

Definition at line 31 of file class.ilLOEditorStatus.php.


The documentation for this class was generated from the following file: