ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAssQuestionType Class Reference
+ Collaboration diagram for ilAssQuestionType:

Public Member Functions

 __construct ()
 
 getId ()
 
 setId (int $id)
 
 getTag ()
 
 setTag (string $tag)
 
 setPlugin (bool $is_plugin)
 
 setPluginName (?string $plugin_name)
 
 isImportable ()
 

Static Public Member Functions

static completeMissingPluginName (array $question_type_data)
 

Protected Attributes

ilComponentRepository $component_repository
 
int $id
 
string $tag = ''
 
bool $is_plugin
 
string $plugin_name = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionType::__construct ( )

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

35 {
36 global $DIC;
37 $this->component_repository = $DIC['component.repository'];
38 }
global $DIC
Definition: shib_login.php:26

References $DIC.

Member Function Documentation

◆ completeMissingPluginName()

static ilAssQuestionType::completeMissingPluginName ( array  $question_type_data)
static

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

104 : array
105 {
106 if ($question_type_data['plugin']
107 && $question_type_data['plugin_name'] !== null
108 && $question_type_data['plugin_name'] !== '') {
109 $question_type_data['plugin_name'] = $question_type_data['type_tag'];
110 }
111
112 return $question_type_data;
113 }

Referenced by ilObjTest\getAvailableQuestions(), ilAssQuestionList\load(), ilAssQuestionTypeList\load(), and ilTestRandomQuestionSetStagingPoolQuestionList\loadQuestions().

+ Here is the caller graph for this function:

◆ getId()

ilAssQuestionType::getId ( )

Definition at line 40 of file class.ilAssQuestionType.php.

40 : int
41 {
42 return $this->id;
43 }

References $id.

◆ getTag()

ilAssQuestionType::getTag ( )

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

50 : string
51 {
52 return $this->tag;
53 }

References $tag.

◆ isImportable()

ilAssQuestionType::isImportable ( )
Returns
bool

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

73 : bool
74 {
75 if (!$this->is_plugin) {
76 return true;
77 }
78
79 if (!isset($this->plugin_name)) {
80 return false;
81 }
82
83 // Plugins MAY overwrite this method an report back their activation status
84 if (!$this->component_repository->getComponentByTypeAndName(
86 'TestQuestionPool'
87 )->getPluginSlotById('qst')->hasPluginName($this->plugin_name)) {
88 return false;
89 }
90
91 return $this->component_repository
92 ->getComponentByTypeAndName(
94 'TestQuestionPool'
95 )
96 ->getPluginSlotById(
97 'qst'
98 )
99 ->getPluginByName(
100 $this->plugin_name
101 )->isActive();
102 }

References ilComponentInfo\TYPE_COMPONENT.

◆ setId()

ilAssQuestionType::setId ( int  $id)

Definition at line 45 of file class.ilAssQuestionType.php.

45 : void
46 {
47 $this->id = $id;
48 }

References $id.

◆ setPlugin()

ilAssQuestionType::setPlugin ( bool  $is_plugin)

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

60 : void
61 {
62 $this->is_plugin = $is_plugin;
63 }

References $is_plugin.

◆ setPluginName()

ilAssQuestionType::setPluginName ( ?string  $plugin_name)

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

65 : void
66 {
67 $this->plugin_name = $plugin_name;
68 }

References $plugin_name.

◆ setTag()

ilAssQuestionType::setTag ( string  $tag)

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

55 : void
56 {
57 $this->tag = $tag;
58 }

References $tag.

Field Documentation

◆ $component_repository

ilComponentRepository ilAssQuestionType::$component_repository
protected

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

◆ $id

int ilAssQuestionType::$id
protected

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

Referenced by getId(), and setId().

◆ $is_plugin

bool ilAssQuestionType::$is_plugin
protected

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

Referenced by setPlugin().

◆ $plugin_name

string ilAssQuestionType::$plugin_name = null
protected

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

Referenced by setPluginName().

◆ $tag

string ilAssQuestionType::$tag = ''
protected

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

Referenced by getTag(), and setTag().


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