ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Exercise\Grades\GradesTableBuilder Class Reference
+ Inheritance diagram for ILIAS\Exercise\Grades\GradesTableBuilder:
+ Collaboration diagram for ILIAS\Exercise\Grades\GradesTableBuilder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, protected \ilObjExercise $exercise, protected \ilExerciseMembers $members, protected array $assignments, object $parent_gui, string $parent_cmd)
 
- Public Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 __construct (protected object $parent_gui, protected string $parent_cmd, bool $numeric_ids=true)
 
 getTable ()
 

Protected Member Functions

 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 build (TableAdapterGUI $table)
 
 getStatusIcon (string $status)
 
- Protected Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 getNamespace ()
 
 getOrderingCommand ()
 
 activeAction (string $action, array $data_row)
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 build (TableAdapterGUI $table)
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Repository\Table\CommonTableBuilder
TableAdapterGUI $table
 

Detailed Description

Definition at line 29 of file GradesTableBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\Grades\GradesTableBuilder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected \ilObjExercise  $exercise,
protected \ilExerciseMembers  $members,
protected array  $assignments,
object  $parent_gui,
string  $parent_cmd 
)
Parameters
\ilExAssignment[]$assignments

Definition at line 34 of file GradesTableBuilder.php.

42 {
43 parent::__construct($parent_gui, $parent_cmd);
44 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ILIAS\Exercise\Grades\GradesTableBuilder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 94 of file GradesTableBuilder.php.

94 : TableAdapterGUI
95 {
96 $lng = $this->domain->lng();
97 $lng->loadLanguageModule('trac');
98
99 $table = $table->linkColumn('name', $lng->txt('name'), true);
100 foreach ($this->assignments as $assignment) {
102 'assignment_' . $assignment->getId(),
103 $assignment->getTitle()
104 );
105 }
106
107 return $table
108 ->iconColumn('total', $lng->txt('exc_total_exc'))
109 ->textColumn('mark', $lng->txt('exc_mark'))
110 ->textColumn('remark', $lng->txt('trac_comment'))
111 ->singleAction('editMark', $lng->txt('exc_mark'), true)
112 ->singleAction('editRemark', $lng->txt('trac_comment'), true);
113 }
linkColumn(string $key, string $title, bool $sortable=false)
iconColumn(string $key, string $title, bool $sortable=false)
global $lng
Definition: privfeed.php:26

References $lng, ILIAS\Repository\Table\CommonTableBuilder\$table, ILIAS\Repository\Table\TableAdapterGUI\iconColumn(), and ILIAS\Repository\Table\TableAdapterGUI\linkColumn().

+ Here is the call graph for this function:

◆ getId()

ILIAS\Exercise\Grades\GradesTableBuilder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 46 of file GradesTableBuilder.php.

46 : string
47 {
48 return 'exc_grades_' . $this->exercise->getId();
49 }

◆ getRetrieval()

ILIAS\Exercise\Grades\GradesTableBuilder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 56 of file GradesTableBuilder.php.

56 : RetrievalInterface
57 {
58 return $this->domain->gradesRetrieval(
59 $this->exercise,
60 $this->members,
61 $this->assignments
62 );
63 }

◆ getStatusIcon()

ILIAS\Exercise\Grades\GradesTableBuilder::getStatusIcon ( string  $status)
protected

Definition at line 115 of file GradesTableBuilder.php.

116 {
118 $lng = $this->domain->lng();
119
120 switch ($status) {
121 case 'passed':
122 $path = $icons->getImagePathCompleted();
123 break;
124 case 'failed':
125 $path = $icons->getImagePathFailed();
126 break;
127 default:
128 $path = $icons->getImagePathNotAttempted();
129 break;
130 }
131
132 return $icons->getIconComponent($path, $lng->txt('exc_' . $status));
133 }
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
This describes how an icon could be modified during construction of UI.
Definition: Icon.php:29

References $lng, ilLPStatusIcons\getInstance(), and ilLPStatusIcons\ICON_VARIANT_LONG.

Referenced by ILIAS\Exercise\Grades\GradesTableBuilder\transformRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ILIAS\Exercise\Grades\GradesTableBuilder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 51 of file GradesTableBuilder.php.

51 : string
52 {
53 return $this->domain->lng()->txt('exc_grades');
54 }

◆ transformRow()

ILIAS\Exercise\Grades\GradesTableBuilder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 65 of file GradesTableBuilder.php.

65 : array
66 {
67 $lng = $this->domain->lng();
68 $factory = $this->gui->ui()->factory();
69 $ctrl = $this->gui->ctrl();
70
71 $ctrl->setParameter($this->parent_gui, 'part_id', $data_row['id']);
72 $target = $ctrl->getLinkTarget($this->parent_gui, 'showParticipant');
73 $ctrl->setParameter($this->parent_gui, 'part_id', '');
74
75 $row = [
76 'id' => $data_row['id'],
77 'name' => $factory->link()->standard(
78 $data_row['name'] . ' [' . $data_row['login'] . ']',
80 ),
81 'total' => $this->getStatusIcon($data_row['total']),
82 'mark' => $data_row['mark'],
83 'remark' => $data_row['remark']
84 ];
85
86 foreach ($this->assignments as $assignment) {
87 $key = 'assignment_' . $assignment->getId();
88 $row[$key] = $this->getStatusIcon($data_row[$key]);
89 }
90
91 return $row;
92 }

References $lng, ILIAS\Scripts\PHPStan\$target, and ILIAS\Exercise\Grades\GradesTableBuilder\getStatusIcon().

+ Here is the call graph for this function:

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