ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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

 __construct (protected \ILIAS\Exercise\InternalDomainService $domain, protected \ILIAS\Exercise\InternalGUIService $gui)
 
 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...
 

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentTypesGUI::__construct ( protected \ILIAS\Exercise\InternalDomainService  $domain,
protected \ILIAS\Exercise\InternalGUIService  $gui 
)

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

33 {
34 }

Member Function Documentation

◆ getByClassName()

ilExAssignmentTypesGUI::getByClassName (   $a_class_name)

Get type gui object by classname.

Parameters

return

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

95 {
96 $id = $this->getIdForClassName($a_class_name);
97 return $this->getById($id);
98 }
$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 44 of file class.ilExAssignmentTypesGUI.php.

45 {
46 switch ($a_id) {
48 return new ilExAssTypeUploadGUI(
49 $this->domain,
50 $this->gui
51 );
52
54 return new ilExAssTypeBlogGUI(
55 $this->domain,
56 $this->gui
57 );
58
60 return new ilExAssTypePortfolioGUI(
61 $this->domain,
62 $this->gui
63 );
64
66 return new ilExAssTypeUploadTeamGUI(
67 $this->domain,
68 $this->gui
69 );
70
72 return new ilExAssTypeTextGUI(
73 $this->domain,
74 $this->gui
75 );
76
78 return new ilExAssTypeWikiTeamGUI(
79 $this->domain,
80 $this->gui
81 );
82 }
83
84 // we should throw some exception here
85 throw new ilExcUnknownAssignmentTypeException("Unkown Assignment Type ($a_id).");
86 }
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...
Team wiki type gui implementations.
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 123 of file class.ilExAssignmentTypesGUI.php.

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

Referenced by getByClassName().

+ 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

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

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

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


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