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

Public Member Functions

 __construct (ilObjLTIConsumer $object)
 
 executeCommand ()
 
 getObject ()
 

Data Fields

const PART_FILTER_ACTIVE_ONLY = 1
 
const PART_FILTER_INACTIVE_ONLY = 2
 
const PART_FILTER_ALL_USERS = 3
 
const PART_FILTER_MANSCORING_DONE = 4
 
const PART_FILTER_MANSCORING_NONE = 5
 

Protected Member Functions

 showCmd ()
 
 initTableData ()
 
 initHighScoreTable ()
 
 initUserRankTable ()
 
 buildTableGUI (string $tableId)
 

Protected Attributes

ilObjLTIConsumer $object
 
ilLTIConsumerAccess $access
 

Private Member Functions

 getTableDataRange (?bool $scopeUserRank=false)
 

Private Attributes

array $tableData
 
string $tableHtml = ''
 
int $userRank
 
ilGlobalTemplateInterface $main_tpl
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumerScoringGUI::__construct ( ilObjLTIConsumer  $object)

Definition at line 56 of file class.ilLTIConsumerScoringGUI.php.

57 {
58 global $DIC;
59 $this->main_tpl = $DIC->ui()->mainTemplate();
60 $this->object = $object;
61
62 $this->access = ilLTIConsumerAccess::getInstance($this->object);
63 }
static getInstance(ilObjLTIConsumer $object)
global $DIC
Definition: shib_login.php:26

References $DIC, $object, ILIAS\Repository\access(), and ilLTIConsumerAccess\getInstance().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildTableGUI()

ilLTIConsumerScoringGUI::buildTableGUI ( string  $tableId)
protected

Definition at line 189 of file class.ilLTIConsumerScoringGUI.php.

190 {
191 $isMultiActorReport = $this->access->hasOutcomesAccess();
193 $this,
194 'show',
195 $isMultiActorReport,
196 $tableId,
197 $this->access->hasOutcomesAccess()
198 );
199 }

References ILIAS\Repository\access().

Referenced by initHighScoreTable(), initUserRankTable(), and showCmd().

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

◆ executeCommand()

ilLTIConsumerScoringGUI::executeCommand ( )
Exceptions
ilCmiXapiException

Definition at line 68 of file class.ilLTIConsumerScoringGUI.php.

68 : void
69 {
70 global $DIC; /* @var \ILIAS\DI\Container $DIC */
71
72 if (!$this->access->hasHighscoreAccess()) {
73 throw new ilCmiXapiException('access denied!');
74 }
75
76 switch ($DIC->ctrl()->getNextClass($this)) {
77 default:
78 $cmd = $DIC->ctrl()->getCmd('show') . 'Cmd';
79 $this->{$cmd}();
80 }
81 }

References $DIC, and ILIAS\Repository\access().

+ Here is the call graph for this function:

◆ getObject()

ilLTIConsumerScoringGUI::getObject ( )

Definition at line 201 of file class.ilLTIConsumerScoringGUI.php.

References $object.

◆ getTableDataRange()

ilLTIConsumerScoringGUI::getTableDataRange ( ?bool  $scopeUserRank = false)
private
Returns
mixed[]

Definition at line 147 of file class.ilLTIConsumerScoringGUI.php.

147 : array
148 {
149 if (false === $scopeUserRank) {
150 return array_slice($this->tableData, 0, $this->object->getHighscoreTopNum());
151 } else {
152 $offset = $this->userRank - 2 < 0 ? 0 : $this->userRank - 2;
153 $length = 5;
154 return array_slice($this->tableData, $offset, $length);
155 }
156 return [];
157 }

References ILIAS\Repository\object().

Referenced by initHighScoreTable(), and initUserRankTable().

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

◆ initHighScoreTable()

ilLTIConsumerScoringGUI::initHighScoreTable ( )
protected
Returns
$this

Definition at line 162 of file class.ilLTIConsumerScoringGUI.php.

162 : self
163 {
164 if (!$this->object->getHighscoreTopTable() || !$this->object->getHighscoreEnabled()) {
165 $this->tableHtml .= '';
166 return $this;
167 }
168 $table = $this->buildTableGUI('highscore');
169 $table->setData($this->getTableDataRange());
170 $this->tableHtml .= $table->getHTML();
171 return $this;
172 }
getTableDataRange(?bool $scopeUserRank=false)

References buildTableGUI(), getTableDataRange(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ initTableData()

ilLTIConsumerScoringGUI::initTableData ( )
protected
Returns
$this

Definition at line 108 of file class.ilLTIConsumerScoringGUI.php.

108 : self
109 {
110 $aggregateEndPointUrl = str_replace(
111 'data/xAPI',
112 'api/statements/aggregate',
113 $this->object->getProvider()->getXapiLaunchUrl() // should be named endpoint not launch url
114 );
115
117 $this->object->getProvider()->getXapiLaunchKey(),
118 $this->object->getProvider()->getXapiLaunchSecret()
119 );
120
121 $filter = new ilCmiXapiStatementsReportFilter();
122 $filter->setActivityId($this->object->getActivityId());
123
124 $linkBuilder = new ilCmiXapiHighscoreReportLinkBuilder(
125 $this->object->getId(),
126 $aggregateEndPointUrl,
127 $filter
128 );
129
130 $request = new ilCmiXapiHighscoreReportRequest(
131 $basicAuth,
132 $linkBuilder
133 );
134
135 $scoringReport = $request->queryReport($this->object->getId());
136
137 if (true === $scoringReport->initTableData()) {
138 $this->tableData = $scoringReport->getTableData();
139 $this->userRank = $scoringReport->getUserRank();
140 }
141 return $this;
142 }
static buildBasicAuth($lrsKey, $lrsSecret)

References ilCmiXapiLrsType\buildBasicAuth(), and ILIAS\Repository\object().

Referenced by showCmd().

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

◆ initUserRankTable()

ilLTIConsumerScoringGUI::initUserRankTable ( )
protected
Returns
$this

Definition at line 177 of file class.ilLTIConsumerScoringGUI.php.

177 : self
178 {
179 if (!$this->object->getHighscoreOwnTable() || !$this->object->getHighscoreEnabled()) {
180 $this->tableHtml .= '';
181 return $this;
182 }
183 $table = $this->buildTableGUI('userRank');
184 $table->setData($this->getTableDataRange(true));
185 $this->tableHtml .= $table->getHTML();
186 return $this;
187 }

References buildTableGUI(), getTableDataRange(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ showCmd()

ilLTIConsumerScoringGUI::showCmd ( )
protected

Definition at line 83 of file class.ilLTIConsumerScoringGUI.php.

83 : void
84 {
85 global $DIC; /* @var \ILIAS\DI\Container $DIC */
86
87 try {
88 $this->initTableData()
89 ->initHighScoreTable()
90 ->initUserRankTable()
91 ;
92 } catch (Exception $e) {
93 $this->main_tpl->setOnScreenMessage('failure', $e->getMessage());
94 //$DIC->ui()->mainTemplate()->
95 $table = $this->buildTableGUI('fallback');
96 $table->setData(array());
97 $table->setMaxCount(0);
98 $table->resetOffset();
99 $this->tableHtml = $table->getHTML();
100 }
101
102 $DIC->ui()->mainTemplate()->setContent($this->tableHtml);
103 }

References $DIC, Vendor\Package\$e, buildTableGUI(), and initTableData().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilLTIConsumerAccess ilLTIConsumerScoringGUI::$access
protected

Definition at line 48 of file class.ilLTIConsumerScoringGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilLTIConsumerScoringGUI::$main_tpl
private

Definition at line 53 of file class.ilLTIConsumerScoringGUI.php.

◆ $object

ilObjLTIConsumer ilLTIConsumerScoringGUI::$object
protected

Definition at line 43 of file class.ilLTIConsumerScoringGUI.php.

Referenced by __construct(), and getObject().

◆ $tableData

array ilLTIConsumerScoringGUI::$tableData
private

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

◆ $tableHtml

string ilLTIConsumerScoringGUI::$tableHtml = ''
private

Definition at line 51 of file class.ilLTIConsumerScoringGUI.php.

◆ $userRank

int ilLTIConsumerScoringGUI::$userRank
private

Definition at line 52 of file class.ilLTIConsumerScoringGUI.php.

◆ PART_FILTER_ACTIVE_ONLY

const ilLTIConsumerScoringGUI::PART_FILTER_ACTIVE_ONLY = 1

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

◆ PART_FILTER_ALL_USERS

const ilLTIConsumerScoringGUI::PART_FILTER_ALL_USERS = 3

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

◆ PART_FILTER_INACTIVE_ONLY

const ilLTIConsumerScoringGUI::PART_FILTER_INACTIVE_ONLY = 2

Definition at line 33 of file class.ilLTIConsumerScoringGUI.php.

◆ PART_FILTER_MANSCORING_DONE

const ilLTIConsumerScoringGUI::PART_FILTER_MANSCORING_DONE = 4

Definition at line 35 of file class.ilLTIConsumerScoringGUI.php.

◆ PART_FILTER_MANSCORING_NONE

const ilLTIConsumerScoringGUI::PART_FILTER_MANSCORING_NONE = 5

Definition at line 36 of file class.ilLTIConsumerScoringGUI.php.


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