ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\Questions\Properties\Properties Class Reference
+ Inheritance diagram for ILIAS\Test\Questions\Properties\Properties:
+ Collaboration diagram for ILIAS\Test\Questions\Properties\Properties:

Public Member Functions

 __construct (private readonly int $question_id, private readonly GeneralQuestionProperties $question_properties,)
 
 getQuestionId ()
 
 getGeneralQuestionProperties ()
 
 getSequenceInformation ()
 
 withSequenceInformation (PropertySequence $sequence)
 
 getAggregatedResults ()
 
 withAggregatedResults (PropertyAggregatedResults $aggregated_results)
 
 getAsQuestionsTableRow (Language $lng, UIFactory $ui_factory, Refinery $refinery, \Closure $question_target_link_builder, OrderingRowBuilder $row_builder, TitleColumnsBuilder $title_builder)
 
 getQuestionId ()
 

Private Attributes

PropertySequence $sequence = null
 
PropertyAggregatedResults $aggregated_results
 

Detailed Description

Definition at line 31 of file Properties.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Questions\Properties\Properties::__construct ( private readonly int  $question_id,
private readonly GeneralQuestionProperties  $question_properties 
)

Definition at line 36 of file Properties.php.

39 {
40 if ($question_id !== $question_properties->getQuestionId()) {
41 throw new \Exception(
42 sprintf(
43 'The question ids do not match. Id local: %s. Id properties: %s.',
44 $question_id,
45 $question_properties->getQuestionId()
46 )
47 );
48 }
49
50 $this->aggregated_results = new PropertyAggregatedResults($question_id);
51 }

Member Function Documentation

◆ getAggregatedResults()

ILIAS\Test\Questions\Properties\Properties::getAggregatedResults ( )

Definition at line 75 of file Properties.php.

75 : ?PropertyAggregatedResults
76 {
78 }
PropertyAggregatedResults $aggregated_results
Definition: Properties.php:34

References ILIAS\Test\Questions\Properties\Properties\$aggregated_results.

◆ getAsQuestionsTableRow()

ILIAS\Test\Questions\Properties\Properties::getAsQuestionsTableRow ( Language  $lng,
UIFactory  $ui_factory,
Refinery  $refinery,
\Closure  $question_target_link_builder,
OrderingRowBuilder  $row_builder,
TitleColumnsBuilder  $title_builder 
)

Definition at line 87 of file Properties.php.

94 : OrderingRow {
95 return $row_builder->buildOrderingRow(
96 (string) $this->question_id,
97 [
98 'question_id' => $this->question_id,
99 'title' => $ui_factory->link()->standard(
100 $refinery->encode()->htmlSpecialCharsAsEntities()->transform(
101 $this->question_properties->getTitle()
102 ),
103 $question_target_link_builder($this->question_id)
104 ),
105 'description' => $this->question_properties->getDescription(),
106 'type_tag' => $this->question_properties->getTypeName($lng),
107 'points' => $this->question_properties->getAvailablePoints(),
108 'author' => $this->question_properties->getAuthor(),
109 'complete' => $this->question_properties->isRequiredInformationComplete(),
110 'lifecycle' => \ilAssQuestionLifecycle::getInstance($this->question_properties->getLifecycle())->getTranslation($lng) ?? '',
111 'qpl' => $title_builder->buildAccessCheckedQuestionpoolTitleAsLink($this->question_properties->getOriginObjectId()),
112 'nr_of_answers' => $this->getAggregatedResults()->getNumberOfAnswers(),
113 'average_points' => $this->getAggregatedResults()->getAveragePoints(),
114 'percentage_points_achieved' => "{$this->getAggregatedResults()->getPercentageOfPointsAchieved()}%"
115 ]
116 );
117 }
global $lng
Definition: privfeed.php:31

◆ getGeneralQuestionProperties()

ILIAS\Test\Questions\Properties\Properties::getGeneralQuestionProperties ( )

Definition at line 58 of file Properties.php.

58 : GeneralQuestionProperties
59 {
60 return $this->question_properties;
61 }

◆ getQuestionId()

ILIAS\Test\Questions\Properties\Properties::getQuestionId ( )

Implements ILIAS\Test\Questions\Properties\Property.

Definition at line 53 of file Properties.php.

53 : int
54 {
55 return $this->question_id;
56 }

◆ getSequenceInformation()

ILIAS\Test\Questions\Properties\Properties::getSequenceInformation ( )

Definition at line 63 of file Properties.php.

63 : ?PropertySequence
64 {
65 return $this->sequence;
66 }

References ILIAS\Test\Questions\Properties\Properties\$sequence.

◆ withAggregatedResults()

ILIAS\Test\Questions\Properties\Properties::withAggregatedResults ( PropertyAggregatedResults  $aggregated_results)

Definition at line 80 of file Properties.php.

80 : self
81 {
82 $clone = clone $this;
83 $clone->aggregated_results = $aggregated_results;
84 return $clone;
85 }

References ILIAS\Test\Questions\Properties\Properties\$aggregated_results.

◆ withSequenceInformation()

ILIAS\Test\Questions\Properties\Properties::withSequenceInformation ( PropertySequence  $sequence)

Definition at line 68 of file Properties.php.

68 : self
69 {
70 $clone = clone $this;
71 $clone->sequence = $sequence;
72 return $clone;
73 }

References ILIAS\Test\Questions\Properties\Properties\$sequence.

Field Documentation

◆ $aggregated_results

PropertyAggregatedResults ILIAS\Test\Questions\Properties\Properties::$aggregated_results
private

◆ $sequence

PropertySequence ILIAS\Test\Questions\Properties\Properties::$sequence = null
private

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