ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 Constructor. More...
 
 getObjectives ()
 
 getAssignments ()
 
 setSection ($a_section)
 Set current section. More...
 
 getSection ()
 
 getFailures ($a_section)
 Get failures by section. More...
 
 setCmdClass ($a_cmd_class)
 Command class. More...
 
 getCmdClass ()
 Get cmd class. More...
 
 getParentObject ()
 Get parent object. More...
 
 getSettings ()
 
 getFirstFailedStep ()
 Get first failed step. More...
 
 getHTML ()
 Get html. More...
 
 getErrorMessages ($a_section)
 Get error messages. More...
 

Static Public Member Functions

static getInstance (ilObject $a_parent)
 Get instance. More...
 

Data Fields

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

 appendFailure ($a_section, $a_failure_msg_key)
 Append failure. More...
 
 getSettingsStatus ()
 Check if course is lo confgured. More...
 
 getObjectivesAvailableStatus ($a_set_errors=false)
 
 getMaterialsStatus ($a_set_errors=true)
 Get status of materials. More...
 
 getInitialTestStatus ($a_set_errors=true)
 Get initial test status. More...
 
 getQualifiedTestStatus ($a_set_errors=true)
 Check status of qualified test. More...
 
 lookupQuestionsAssigned ($a_test_ref_id)
 Check if questions are assigned. More...
 
 getObjectivesStatus ($a_set_errors=true)
 
 getStartStatus ()
 
 checkNumberOfTries ()
 
 checkTestOnline ($a_ref_id)
 Check if test is online. More...
 

Protected Attributes

 $section = NULL
 
 $failures_by_section = array()
 
 $objectives = array()
 
 $settings = NULL
 
 $assignments = null
 
 $parent_obj = NULL
 
 $cmd_class = NULL
 
 $html = ''
 
 $tpl = NULL
 
 $ctrl = NULL
 
 $lng = NULL
 

Static Protected Attributes

static $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
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilLOEditorStatus::__construct ( ilObject  $a_parent)

Constructor.

Parameters
ilObject

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

References $GLOBALS, ilCourseObjective\_getObjectiveIds(), ilLOTestAssignments\getInstance(), ilLOSettings\getInstanceByObjId(), getParentObject(), and settings().

45  {
46  $this->parent_obj = $a_parent;
47  $this->settings = ilLOSettings::getInstanceByObjId($this->getParentObject()->getId());
48  $this->assignments = ilLOTestAssignments::getInstance($this->getParentObject()->getId());
49 
50  $this->ctrl = $GLOBALS['ilCtrl'];
51  $this->lng = $GLOBALS['lng'];
52 
53  include_once './Modules/Course/classes/class.ilCourseObjective.php';
54  $this->objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId());
55  }
static getInstanceByObjId($a_obj_id)
get singleton instance
static getInstance($a_container_id)
Get instance by container id.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getObjectiveIds($course_id, $a_activated_only=false)
getParentObject()
Get parent object.
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ appendFailure()

ilLOEditorStatus::appendFailure (   $a_section,
  $a_failure_msg_key 
)
protected

Append failure.

Parameters
type$a_section
type$a_failure_msg_key

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

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

117  {
118  $this->failures_by_section[$a_section][] = $a_failure_msg_key;
119  }
+ Here is the caller graph for this function:

◆ checkNumberOfTries()

ilLOEditorStatus::checkNumberOfTries ( )
protected

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

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

613  {
614  $qt = $this->getSettings()->getQualifiedTest();
615  if(!$qt)
616  {
617  return true;
618  }
619 
620  include_once './Services/Object/classes/class.ilObjectFactory.php';
621  $factory = new ilObjectFactory();
622  $tst = $factory->getInstanceByRefId($qt,false);
623 
624  if(!$tst instanceof ilObjTest)
625  {
626  return true;
627  }
628  $tries = $tst->getNrOfTries();
629  if(!$tries)
630  {
631  return true;
632  }
633 
634  $obj_tries = 0;
635  foreach($this->getObjectives() as $objective)
636  {
637  include_once './Modules/Course/classes/class.ilCourseObjective.php';
638  $obj_tries += ilCourseObjective::lookupMaxPasses($objective);
639  }
640  $GLOBALS['ilLog']->write(__METHOD__.': '.$obj_tries);
641  return $obj_tries <= $tries;
642  }
Class ilObjectFactory.
static lookupMaxPasses($a_objective_id)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the call graph for this function:

◆ checkTestOnline()

ilLOEditorStatus::checkTestOnline (   $a_ref_id)
protected

Check if test is online.

Parameters
int$a_ref_id

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

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

Referenced by getInitialTestStatus(), and getQualifiedTestStatus().

649  {
650  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
652  }
static _isOnline($a_obj_id)
returns the objects&#39;s ONline status
static _lookupObjId($a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignments()

ilLOEditorStatus::getAssignments ( )
Returns
ilLOTestAssignments

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

References $assignments.

Referenced by getInitialTestStatus(), and getQualifiedTestStatus().

83  {
84  return $this->assignments;
85  }
+ Here is the caller graph for this function:

◆ getCmdClass()

ilLOEditorStatus::getCmdClass ( )

Get cmd class.

Returns
type

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

References $cmd_class.

Referenced by getHTML().

135  {
136  return $this->cmd_class;
137  }
+ Here is the caller graph for this function:

◆ getErrorMessages()

ilLOEditorStatus::getErrorMessages (   $a_section)

Get error messages.

Parameters

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

References array, and getFailures().

Referenced by getHTML().

329  {
330  $mess = array();
331  foreach($this->getFailures($a_section) as $failure_code)
332  {
333  $mess[] = $this->lng->txt($failure_code);
334  }
335  return $mess;
336  }
getFailures($a_section)
Get failures by section.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFailures()

ilLOEditorStatus::getFailures (   $a_section)

Get failures by section.

Parameters
type$a_section

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

References array.

Referenced by getErrorMessages().

107  {
108  return (array) $this->failures_by_section[$a_section];
109  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getFirstFailedStep()

ilLOEditorStatus::getFirstFailedStep ( )

Get first failed step.

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

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

161  {
162  if(!$this->getSettingsStatus(false))
163  {
164  return 'settings';
165  }
166  #if(!$this->getMaterialsStatus(false))
167  #{
168  # return 'materials';
169  #}
170  if(!$this->getObjectivesAvailableStatus())
171  {
172  return 'showObjectiveCreation';
173  }
174  if($this->getSettings()->worksWithInitialTest())
175  {
176  if(!$this->getInitialTestStatus(false))
177  {
178  $_REQUEST['tt'] = ilLOSettings::TYPE_TEST_INITIAL;
179  if($this->getSettings()->hasSeparateInitialTests())
180  {
181  return 'testsOverview';
182  }
183  else
184  {
185  return 'testOverview';
186  }
187  }
188  }
189  if(!$this->getQualifiedTestStatus(false))
190  {
191  $_REQUEST['tt'] = ilLOSettings::TYPE_TEST_QUALIFIED;
192  if($this->getSettings()->hasSeparateQualifiedTests())
193  {
194  return 'testsOverview';
195  }
196  else
197  {
198  return 'testOverview';
199  }
200  }
201  if(!$this->getObjectivesStatus(false))
202  {
203  return 'listObjectives';
204  }
205  return 'listObjectives';
206  }
getQualifiedTestStatus($a_set_errors=true)
Check status of qualified test.
getObjectivesAvailableStatus($a_set_errors=false)
getInitialTestStatus($a_set_errors=true)
Get initial test status.
getSettingsStatus()
Check if course is lo confgured.
getObjectivesStatus($a_set_errors=true)
+ Here is the call graph for this function:

◆ getHTML()

ilLOEditorStatus::getHTML ( )

Get html.

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

References $_GET, getCmdClass(), getErrorMessages(), getInitialTestStatus(), ilLOSettings\getInstanceByObjId(), getMaterialsStatus(), getObjectivesAvailableStatus(), getObjectivesStatus(), getParentObject(), getQualifiedTestStatus(), getSettings(), getSettingsStatus(), ilChecklistGUI\STATUS_NOT_OK, ilChecklistGUI\STATUS_OK, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

213  {
214  include_once("./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
215  $list = new ilChecklistGUI();
216  $list->setHeading($this->lng->txt('crs_objective_status_configure'));
217 
218 
219  // Step 1
220  // course settings
221  $done = $this->getSettingsStatus();
222 
223  $list->addEntry($this->lng->txt('crs_objective_status_settings'),
224  $this->ctrl->getLinkTarget($this->getCmdClass(),'settings'),
225  $done
228  ($this->section == self::SECTION_SETTINGS),
229  $this->getErrorMessages(self::SECTION_SETTINGS)
230  );
231 
232 
233  // Step 1.1
234  $done = $this->getObjectivesAvailableStatus(true);
235 
236  $list->addEntry($this->lng->txt('crs_objective_status_objective_creation'),
237  $done
238  ? $this->ctrl->getLinkTarget($this->getCmdClass(),'listObjectives')
239  : $this->ctrl->getLinkTarget($this->getCmdClass(),'showObjectiveCreation'),
240  $done
243  ($this->section == self::SECTION_OBJECTIVES_NEW),
244  $this->getErrorMessages(self::SECTION_OBJECTIVES_NEW)
245  );
246 
247  // Step 2
248  // course material
249  $done = $this->getMaterialsStatus(true);
250 
251  $this->ctrl->setParameterByClass('ilobjcoursegui','cmd','enableAdministrationPanel');
252  $list->addEntry($this->lng->txt('crs_objective_status_materials'),
253  $this->ctrl->getLinkTargetByClass('ilobjcoursegui',''),
254  $done
257  ($this->section == self::SECTION_MATERIALS),
258  $this->getErrorMessages(self::SECTION_MATERIALS)
259  );
260 
261 
262  // Step 3
263  // course itest
264  if(ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->worksWithInitialTest())
265  {
266  $done = $this->getInitialTestStatus();
267 
268  $command = $this->getSettings()->hasSeparateInitialTests() ?
269  'testsOverview' :
270  'testOverview';
271 
272  $this->ctrl->setParameter($this->getCmdClass(),'tt', ilLOSettings::TYPE_TEST_INITIAL);
273  $list->addEntry(
274  $this->lng->txt('crs_objective_status_itest'),
275  $this->ctrl->getLinkTarget($this->getCmdClass(),$command),
276  $done
279  ($this->section == self::SECTION_ITES),
280  $this->getErrorMessages(self::SECTION_ITES)
281  );
282  }
283 
284  // Step 4
285  // course qtest
286  $done = $this->getQualifiedTestStatus();
287 
288  $command = $this->getSettings()->hasSeparateQualifiedTests() ?
289  'testsOverview' :
290  'testOverview';
291 
292  $this->ctrl->setParameter($this->getCmdClass(),'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
293  $list->addEntry($this->lng->txt('crs_objective_status_qtest'),
294  $this->ctrl->getLinkTarget($this->getCmdClass(),$command),
295  $done
298  ($this->section == self::SECTION_QTEST),
299  $this->getErrorMessages(self::SECTION_QTEST)
300  );
301 
302  $this->ctrl->setParameter($this->getCmdClass(),'tt', $_GET["tt"]);
303 
304  // Step 5
305  // course qtest
306  $done = $this->getObjectivesStatus();
307 
308  $list->addEntry($this->lng->txt('crs_objective_status_objectives'),
309  $this->ctrl->getLinkTarget($this->getCmdClass(),'listObjectives'),
310  $done
313  ($this->section == self::SECTION_OBJECTIVES),
314  $this->getErrorMessages(self::SECTION_OBJECTIVES)
315  );
316 
317  return $list->getHTML();
318  }
getQualifiedTestStatus($a_set_errors=true)
Check status of qualified test.
static getInstanceByObjId($a_obj_id)
get singleton instance
getObjectivesAvailableStatus($a_set_errors=false)
getMaterialsStatus($a_set_errors=true)
Get status of materials.
$_GET["client_id"]
getParentObject()
Get parent object.
getCmdClass()
Get cmd class.
getErrorMessages($a_section)
Get error messages.
getInitialTestStatus($a_set_errors=true)
Get initial test status.
getSettingsStatus()
Check if course is lo confgured.
getObjectivesStatus($a_set_errors=true)
+ Here is the call graph for this function:

◆ getInitialTestStatus()

ilLOEditorStatus::getInitialTestStatus (   $a_set_errors = true)
protected

Get initial test status.

Parameters
type$a_set_errors
Returns
boolean

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

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

Referenced by getFirstFailedStep(), and getHTML().

401  {
402  if($this->getSettings()->hasSeparateInitialTests())
403  {
404  foreach($this->getObjectives() as $objective_id)
405  {
406  $tst_ref = $this->getAssignments()->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_INITIAL);
407  if(!$GLOBALS['tree']->isInTree($tst_ref))
408  {
409  if($a_set_errors)
410  {
411  $this->appendFailure(self::SECTION_ITES, 'crs_loc_err_stat_no_it');
412  }
413  return FALSE;
414  }
415  if(!$this->checkTestOnline($tst_ref))
416  {
417  if($a_set_errors)
418  {
419  $this->appendFailure(self::SECTION_ITES, 'crs_loc_err_stat_tst_offline');
420  }
421  return false;
422  }
423 
424  }
425  return TRUE;
426  }
427 
428 
429  $tst_ref = $this->getSettings()->getInitialTest();
430  if(!$GLOBALS['tree']->isInTree($tst_ref))
431  {
432  if($a_set_errors)
433  {
434  $this->appendFailure(self::SECTION_ITES, 'crs_loc_err_stat_no_it');
435  }
436  return FALSE;
437  }
438  if(!$this->checkTestOnline($tst_ref))
439  {
440  if($a_set_errors)
441  {
442  $this->appendFailure(self::SECTION_ITES, 'crs_loc_err_stat_tst_offline');
443  }
444  return false;
445  }
446  return TRUE;
447  }
checkTestOnline($a_ref_id)
Check if test is online.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
appendFailure($a_section, $a_failure_msg_key)
Append failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstance()

static ilLOEditorStatus::getInstance ( ilObject  $a_parent)
static

Get instance.

Parameters
ilObject$a_parent

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

Referenced by ilLOEditorGUI\executeCommand().

62  {
63  if(self::$instance)
64  {
65  return self::$instance;
66  }
67  return self::$instance = new self($a_parent);
68  }
+ Here is the caller graph for this function:

◆ getMaterialsStatus()

ilLOEditorStatus::getMaterialsStatus (   $a_set_errors = true)
protected

Get status of materials.

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

References $GLOBALS, appendFailure(), array, getParentObject(), and getSettings().

Referenced by getHTML().

370  {
371  $childs = $GLOBALS['tree']->getChilds($this->getParentObject()->getRefId());
372  foreach((array) $childs as $tnode)
373  {
374  if($tnode['type'] == 'rolf')
375  {
376  continue;
377  }
378  if($tnode['child'] == $this->getSettings()->getInitialTest())
379  {
380  continue;
381  }
382  if($tnode['child'] == $this->getSettings()->getQualifiedTest())
383  {
384  continue;
385  }
386  return true;
387  }
388  if($a_set_errors)
389  {
390  $this->appendFailure(self::SECTION_MATERIALS, 'crs_loc_err_stat_no_materials');
391  }
392  return false;
393  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
appendFailure($a_section, $a_failure_msg_key)
Append failure.
Create styles array
The data for the language used.
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectives()

ilLOEditorStatus::getObjectives ( )
Returns
array

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

References $objectives.

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

74  {
75  return $this->objectives;
76  }
+ Here is the caller graph for this function:

◆ getObjectivesAvailableStatus()

ilLOEditorStatus::getObjectivesAvailableStatus (   $a_set_errors = false)
protected

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

References $ret, appendFailure(), and getObjectives().

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

355  {
356  $ret = count($this->getObjectives());
357 
358  if(!$ret && $a_set_errors)
359  {
360  $this->appendFailure(self::SECTION_OBJECTIVES_NEW, 'crs_no_objectives_created');
361  }
362 
363  return $ret;
364  }
appendFailure($a_section, $a_failure_msg_key)
Append failure.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectivesStatus()

ilLOEditorStatus::getObjectivesStatus (   $a_set_errors = true)
protected

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

References ilCourseObjective\_getCountObjectives(), ilCourseObjective\_getObjectiveIds(), appendFailure(), getObjectivesAvailableStatus(), getParentObject(), getSettings(), and lookupQuestionsAssigned().

Referenced by getFirstFailedStep(), and getHTML().

540  {
541  if(!$this->getObjectivesAvailableStatus($a_set_errors))
542  {
543  return false;
544  }
545 
546  include_once './Modules/Course/classes/class.ilCourseObjective.php';
547  $num_active = ilCourseObjective::_getCountObjectives($this->getParentObject()->getId(),true);
548  if(!$num_active)
549  {
550  if($a_set_errors)
551  {
552  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_lo');
553  }
554  return false;
555  }
556  foreach(ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(),true) as $objective_id)
557  {
558  include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
559  $obj = new ilCourseObjectiveMaterials($objective_id);
560  if(!count($obj->getMaterials()))
561  {
562  if($a_set_errors)
563  {
564  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_mat');
565  }
566  return false;
567  }
568  }
569  // check for assigned initial test questions
570  if($this->getSettings()->worksWithInitialTest() && !$this->getSettings()->hasSeparateInitialTests())
571  {
572  // check for assigned questions
573  if(!$this->lookupQuestionsAssigned($this->getSettings()->getInitialTest()))
574  {
575  if($a_set_errors)
576  {
577  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_qst');
578  }
579  return false;
580  }
581  }
582  // check for assigned questions
583  if(!$this->getSettings()->hasSeparateQualifiedTests() and !$this->lookupQuestionsAssigned($this->getSettings()->getQualifiedTest()))
584  {
585  if($a_set_errors)
586  {
587  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_qst');
588  }
589  return false;
590  }
591 
592  // @deprecated
593  /*
594  if(!$this->checkNumberOfTries())
595  {
596  if($a_set_errors)
597  {
598  $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_nr_tries_exceeded');
599  }
600  return false;
601  }
602  */
603 
604  return true;
605  }
getObjectivesAvailableStatus($a_set_errors=false)
lookupQuestionsAssigned($a_test_ref_id)
Check if questions are assigned.
static _getObjectiveIds($course_id, $a_activated_only=false)
class ilCourseObjectiveMaterials
appendFailure($a_section, $a_failure_msg_key)
Append failure.
getParentObject()
Get parent object.
static _getCountObjectives($a_obj_id, $a_activated_only=false)
get count objectives
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentObject()

ilLOEditorStatus::getParentObject ( )

Get parent object.

Returns
ilObject

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

References $parent_obj.

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

145  {
146  return $this->parent_obj;
147  }
+ Here is the caller graph for this function:

◆ getQualifiedTestStatus()

ilLOEditorStatus::getQualifiedTestStatus (   $a_set_errors = true)
protected

Check status of qualified test.

Parameters
type$a_set_errors
Returns
boolean

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

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

Referenced by getFirstFailedStep(), and getHTML().

455  {
456  if($this->getSettings()->hasSeparateQualifiedTests())
457  {
458  foreach($this->getObjectives() as $objective_id)
459  {
460  $tst_ref = $this->getAssignments()->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
461  if(!$GLOBALS['tree']->isInTree($tst_ref))
462  {
463  if($a_set_errors)
464  {
465  $this->appendFailure(self::SECTION_QTEST, 'crs_loc_err_stat_no_qt');
466  }
467  return FALSE;
468  }
469  if(!$this->checkTestOnline($tst_ref))
470  {
471  if($a_set_errors)
472  {
473  $this->appendFailure(self::SECTION_QTEST, 'crs_loc_err_stat_tst_offline');
474  }
475  return false;
476  }
477  }
478  return TRUE;
479  }
480  $tst_ref = $this->getSettings()->getQualifiedTest();
481  if(!$GLOBALS['tree']->isInTree($tst_ref))
482  {
483  if($a_set_errors)
484  {
485  $this->appendFailure(self::SECTION_QTEST, 'crs_loc_err_stat_no_qt');
486  }
487  return false;
488  }
489  if(!$this->checkTestOnline($tst_ref))
490  {
491  if($a_set_errors)
492  {
493  $this->appendFailure(self::SECTION_QTEST, 'crs_loc_err_stat_tst_offline');
494  }
495  return false;
496  }
497  return true;
498  }
checkTestOnline($a_ref_id)
Check if test is online.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
appendFailure($a_section, $a_failure_msg_key)
Append failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSection()

ilLOEditorStatus::getSection ( )

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

References $section.

98  {
99  return $this->section;
100  }

◆ getSettings()

ilLOEditorStatus::getSettings ( )

◆ getSettingsStatus()

ilLOEditorStatus::getSettingsStatus ( )
protected

Check if course is lo confgured.

Returns
type

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

References getSettings().

Referenced by getFirstFailedStep(), and getHTML().

344  {
345  return $this->getSettings()->settingsExist();
346  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStartStatus()

ilLOEditorStatus::getStartStatus ( )
protected

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

608  {
609  return true;
610  }

◆ lookupQuestionsAssigned()

ilLOEditorStatus::lookupQuestionsAssigned (   $a_test_ref_id)
protected

Check if questions are assigned.

Parameters
type$a_test_ref_id

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

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

Referenced by getObjectivesStatus().

505  {
506  include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
508  {
509  foreach($this->getObjectives() as $objective_id)
510  {
511  include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
513  $this->parent_obj->getId(),
514  $objective_id,
515  ilObject::_lookupObjId($a_test_ref_id)
516  );
517  if(!$seq)
518  {
519  return false;
520  }
521  }
522  }
523  else
524  {
525  foreach($this->getObjectives() as $objective_id)
526  {
527  include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
529  if(!count($qsts))
530  {
531  return false;
532  }
533  }
534  }
535  return true;
536  }
static lookupSequence($a_container_id, $a_objective_id, $a_test_id)
static lookupRandomTest($a_test_obj_id)
Check if test is a random test.
static _lookupObjId($a_id)
static lookupQuestionsByObjective($a_test_id, $a_objective)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCmdClass()

ilLOEditorStatus::setCmdClass (   $a_cmd_class)

Command class.

Parameters
type$a_cmd_class

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

126  {
127  $this->cmd_class = $a_cmd_class;
128  }

◆ setSection()

ilLOEditorStatus::setSection (   $a_section)

Set current section.

Parameters
type$a_section

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

93  {
94  $this->section = $a_section;
95  }

Field Documentation

◆ $assignments

ilLOEditorStatus::$assignments = null
protected

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

Referenced by getAssignments().

◆ $cmd_class

ilLOEditorStatus::$cmd_class = NULL
protected

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

Referenced by getCmdClass().

◆ $ctrl

ilLOEditorStatus::$ctrl = NULL
protected

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

◆ $failures_by_section

ilLOEditorStatus::$failures_by_section = array()
protected

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

◆ $html

ilLOEditorStatus::$html = ''
protected

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

◆ $instance

ilLOEditorStatus::$instance = NULL
staticprotected

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

◆ $lng

ilLOEditorStatus::$lng = NULL
protected

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

◆ $objectives

ilLOEditorStatus::$objectives = array()
protected

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

Referenced by getObjectives().

◆ $parent_obj

ilLOEditorStatus::$parent_obj = NULL
protected

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

Referenced by getParentObject().

◆ $section

ilLOEditorStatus::$section = NULL
protected

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

Referenced by getSection().

◆ $settings

ilLOEditorStatus::$settings = NULL
protected

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

Referenced by getSettings().

◆ $tpl

ilLOEditorStatus::$tpl = NULL
protected

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

◆ SECTION_ITES

◆ SECTION_MATERIALS

const ilLOEditorStatus::SECTION_MATERIALS = 2

Definition at line 15 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 19 of file class.ilLOEditorStatus.php.

Referenced by ilLOEditorGUI\showObjectiveCreation().

◆ SECTION_QTEST

◆ SECTION_SETTINGS

const ilLOEditorStatus::SECTION_SETTINGS = 1

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

Referenced by ilLOEditorGUI\settings().


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