ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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)
 

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.

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

Referenced by ILIAS\Test\Questions\Properties\Properties\getAsQuestionsTableRow().

75  : ?PropertyAggregatedResults
76  {
78  }
PropertyAggregatedResults $aggregated_results
Definition: Properties.php:34
+ Here is the caller graph for this function:

◆ 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.

References ILIAS\Test\Utilities\TitleColumnsBuilder\buildAccessCheckedQuestionpoolTitleAsLink(), ILIAS\UI\Component\Table\OrderingRowBuilder\buildOrderingRow(), ILIAS\Test\Questions\Properties\Properties\getAggregatedResults(), and ilAssQuestionLifecycle\getInstance().

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
+ Here is the call graph for this function:

◆ 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.

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

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

◆ withAggregatedResults()

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

Definition at line 80 of file Properties.php.

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

80  : self
81  {
82  $clone = clone $this;
83  $clone->aggregated_results = $aggregated_results;
84  return $clone;
85  }
PropertyAggregatedResults $aggregated_results
Definition: Properties.php:34

◆ withSequenceInformation()

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

Definition at line 68 of file Properties.php.

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

Referenced by ILIAS\Test\Questions\Properties\DatabaseRepository\buildQuestionPropertiesFromGeneralQuestionPropertiesAndSquenceProperties().

68  : self
69  {
70  $clone = clone $this;
71  $clone->sequence = $sequence;
72  return $clone;
73  }
+ Here is the caller graph for this function:

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: