ILIAS  release_7 Revision v7.30-3-g800a261c036
ilExAssignmentTypesGUI Class Reference

Assignment types gui. More...

+ Collaboration diagram for ilExAssignmentTypesGUI:

Public Member Functions

 getById ($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

 $class_names
 

Detailed Description

Assignment types gui.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentTypesGUI::__construct ( )
protected

Constructor.

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

26 {
27 }

Member Function Documentation

◆ getByClassName()

ilExAssignmentTypesGUI::getByClassName (   $a_class_name)

Get type gui object by classname.

Parameters

return

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

88 {
89 $id = $this->getIdForClassName($a_class_name);
90 return $this->getById($id);
91 }
getById($a_id)
Get type gui object by id.
getIdForClassName($a_string)
Get type id for class name.

References getById(), and getIdForClassName().

+ Here is the call graph for this function:

◆ getById()

ilExAssignmentTypesGUI::getById (   $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
Returns
ilExAssignmentTypeGUIInterface

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

49 {
50 // @todo: check id
51
52 switch ($a_id) {
54 return new ilExAssTypeUploadGUI();
55 break;
56
58 return new ilExAssTypeBlogGUI();
59 break;
60
62 return new ilExAssTypePortfolioGUI();
63 break;
64
66 return new ilExAssTypeUploadTeamGUI();
67 break;
68
70 return new ilExAssTypeTextGUI();
71 break;
72
74 return new ilExAssTypeWikiTeamGUI();
75 break;
76 }
77
78 // we should throw some exception here
79 }
Blog type gui implementations.
Portfolio type gui implementations.
Text type gui implementations.
Upload type gui implementations.
Team upload type gui implementations.
Team wiki type gui implementations.

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 117 of file class.ilExAssignmentTypesGUI.php.

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

Referenced by getByClassName().

+ Here is the caller graph for this function:

◆ getInstance()

static ilExAssignmentTypesGUI::getInstance ( )
static

Get instance.

Returns
ilExAssignmentTypesGUI

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

35 {
36 return new self();
37 }

Referenced by ilExAssignmentEditorGUI\__construct(), ilExSubmissionGUI\__construct(), and ilExSubmissionBaseGUI\__construct().

+ Here is the caller graph for this function:

◆ 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
Returns
bool

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

102 {
103 foreach ($this->class_names as $cn) {
104 if (strtolower($cn) == strtolower($a_string)) {
105 return true;
106 }
107 }
108 return false;
109 }

Field Documentation

◆ $class_names

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 13 of file class.ilExAssignmentTypesGUI.php.


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