ILIAS  release_8 Revision v8.24
ilExAssignmentTypesGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilExAssignmentTypesGUI:

Public Member Functions

 getById (int $a_id)
 Get type gui object by id. More...
 
 getByClassName ($a_class_name)
 Get type gui object by classname. More...
 
 isExAssTypeGUIClass ($a_string)
 Checks if a class name is a valid exercise assignment type GUI class (case insensitive, since ilCtrl uses lower keys due to historic reasons) More...
 
 getIdForClassName ($a_string)
 Get type id for class name. More...
 

Static Public Member Functions

static getInstance ()
 Get instance. More...
 

Protected Member Functions

 __construct ()
 Constructor. More...
 

Protected Attributes

array $class_names
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Assignment types gui.

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilExAssignmentTypesGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentTypesGUI::__construct ( )
protected

Constructor.

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

40 {
41 }

Member Function Documentation

◆ getByClassName()

ilExAssignmentTypesGUI::getByClassName (   $a_class_name)

Get type gui object by classname.

Parameters

return

Definition at line 91 of file class.ilExAssignmentTypesGUI.php.

92 {
93 $id = $this->getIdForClassName($a_class_name);
94 return $this->getById($id);
95 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getById(int $a_id)
Get type gui object by id.
getIdForClassName($a_string)
Get type id for class name.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $id, getById(), and getIdForClassName().

+ Here is the call graph for this function:

◆ getById()

ilExAssignmentTypesGUI::getById ( int  $a_id)

Get type gui object by id.

Centralized ID management is still an issue to be tackled in the future and caused by initial consts definition.

Parameters
int$a_idtype id

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

60 {
61 switch ($a_id) {
63 return new ilExAssTypeUploadGUI();
64
66 return new ilExAssTypeBlogGUI();
67
69 return new ilExAssTypePortfolioGUI();
70
72 return new ilExAssTypeUploadTeamGUI();
73
75 return new ilExAssTypeTextGUI();
76
78 return new ilExAssTypeWikiTeamGUI();
79 }
80
81 // we should throw some exception here
82 throw new ilExcUnknownAssignmentTypeException("Unkown Assignment Type ($a_id).");
83 }
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...
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...
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 TYPE_UPLOAD
direct checks against const should be avoided, use type objects instead
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilExAssignment\TYPE_BLOG, ilExAssignment\TYPE_PORTFOLIO, ilExAssignment\TYPE_TEXT, ilExAssignment\TYPE_UPLOAD, ilExAssignment\TYPE_UPLOAD_TEAM, and ilExAssignment\TYPE_WIKI_TEAM.

Referenced by getByClassName().

+ Here is the caller graph for this function:

◆ getIdForClassName()

ilExAssignmentTypesGUI::getIdForClassName (   $a_string)

Get type id for class name.

Parameters
$a_string
Returns
null|int

Definition at line 120 of file class.ilExAssignmentTypesGUI.php.

121 {
122 foreach ($this->class_names as $k => $cn) {
123 if (strtolower($cn) === strtolower($a_string)) {
124 return $k;
125 }
126 }
127 return null;
128 }

Referenced by getByClassName().

+ Here is the caller graph for this function:

◆ getInstance()

static ilExAssignmentTypesGUI::getInstance ( )
static

Get instance.

Definition at line 46 of file class.ilExAssignmentTypesGUI.php.

47 {
48 return new self();
49 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ isExAssTypeGUIClass()

ilExAssignmentTypesGUI::isExAssTypeGUIClass (   $a_string)

Checks if a class name is a valid exercise assignment type GUI class (case insensitive, since ilCtrl uses lower keys due to historic reasons)

Parameters
string

Definition at line 104 of file class.ilExAssignmentTypesGUI.php.

104 : bool
105 {
106 foreach ($this->class_names as $cn) {
107 if (strtolower($cn) === strtolower($a_string)) {
108 return true;
109 }
110 }
111 return false;
112 }

Field Documentation

◆ $class_names

array ilExAssignmentTypesGUI::$class_names
protected
Initial value:
= array(
ilExAssignment::TYPE_UPLOAD => "ilExAssTypeUploadGUI",
ilExAssignment::TYPE_BLOG => "ilExAssTypeBlogGUI",
ilExAssignment::TYPE_PORTFOLIO => "ilExAssTypePortfolioGUI",
ilExAssignment::TYPE_UPLOAD_TEAM => "ilExAssTypeUploadTeamGUI",
ilExAssignment::TYPE_TEXT => "ilExAssTypeTextGUI",
ilExAssignment::TYPE_WIKI_TEAM => "ilExAssTypeWikiTeamGUI"
)

Definition at line 27 of file class.ilExAssignmentTypesGUI.php.


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