ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ($tableId)
 

Protected Attributes

 $object
 
 $access
 

Private Member Functions

 getTableDataRange ($scopeUserRank=false)
 

Private Attributes

 $tableData
 
 $tableHtml = ''
 
 $userRank
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumerScoringGUI::__construct ( ilObjLTIConsumer  $object)
Parameters
ilObjLTIConsumer$object

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

References $object, and ilLTIConsumerAccess\getInstance().

44  {
45  $this->object = $object;
46 
47  $this->access = ilLTIConsumerAccess::getInstance($this->object);
48  }
static getInstance(ilObjLTIConsumer $object)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildTableGUI()

ilLTIConsumerScoringGUI::buildTableGUI (   $tableId)
protected
Parameters
string$tableId
Returns
ilLTIConsumerScoringTableGUI

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

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

180  {
181  $isMultiActorReport = $this->access->hasOutcomesAccess();
182  $table = new ilLTIConsumerScoringTableGUI(
183  $this,
184  'show',
185  $isMultiActorReport,
186  $tableId,
187  $this->access->hasOutcomesAccess()
188  );
189  return $table;
190  }
+ Here is the caller graph for this function:

◆ executeCommand()

ilLTIConsumerScoringGUI::executeCommand ( )
Exceptions
ilCmiXapiException

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

References $DIC.

54  {
55  global $DIC; /* @var \ILIAS\DI\Container $DIC */
56 
57  if (!$this->access->hasHighscoreAccess()) {
58  throw new ilCmiXapiException('access denied!');
59  }
60 
61  switch ($DIC->ctrl()->getNextClass($this)) {
62  default:
63  $cmd = $DIC->ctrl()->getCmd('show') . 'Cmd';
64  $this->{$cmd}();
65  }
66  }
global $DIC
Definition: goto.php:24

◆ getObject()

ilLTIConsumerScoringGUI::getObject ( )
Returns
ilObjLTIConsumer

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

References $object.

◆ getTableDataRange()

ilLTIConsumerScoringGUI::getTableDataRange (   $scopeUserRank = false)
private
Parameters
bool$scopeUserRank
Returns
array

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

Referenced by initHighScoreTable(), and initUserRankTable().

134  {
135  if (false === $scopeUserRank) {
136  return array_slice($this->tableData, 0, (int) $this->object->getHighscoreTopNum());
137  } else {
138  $offset = $this->userRank - 2 < 0 ? 0 : $this->userRank - 2;
139  $length = 5;
140  return array_slice($this->tableData, $offset, $length);
141  }
142  return [];
143  }
+ Here is the caller graph for this function:

◆ initHighScoreTable()

ilLTIConsumerScoringGUI::initHighScoreTable ( )
protected
Returns
$this

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

References buildTableGUI(), and getTableDataRange().

149  {
150  if (!$this->object->getHighscoreTopTable() || !$this->object->getHighscoreEnabled()) {
151  $this->tableHtml .= '';
152  return $this;
153  }
154  $table = $this->buildTableGUI('highscore');
155  $table->setData($this->getTableDataRange());
156  $this->tableHtml .= $table->getHTML();
157  return $this;
158  }
+ Here is the call graph for this function:

◆ initTableData()

ilLTIConsumerScoringGUI::initTableData ( )
protected
Returns
$this

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

References ilCmiXapiLrsType\buildBasicAuth().

Referenced by showCmd().

94  {
95  $aggregateEndPointUrl = str_replace(
96  'data/xAPI',
97  'api/statements/aggregate',
98  $this->object->getProvider()->getXapiLaunchUrl() // should be named endpoint not launch url
99  );
100 
102  $this->object->getProvider()->getXapiLaunchKey(),
103  $this->object->getProvider()->getXapiLaunchSecret()
104  );
105 
106  $filter = new ilCmiXapiStatementsReportFilter();
107  $filter->setActivityId($this->object->getActivityId());
108 
109  $linkBuilder = new ilCmiXapiHighscoreReportLinkBuilder(
110  $this->object,
111  $aggregateEndPointUrl,
112  $filter
113  );
114 
116  $basicAuth,
117  $linkBuilder
118  );
119 
120  $scoringReport = $request->queryReport($this->object);
121 
122  if (true === $scoringReport->initTableData()) {
123  $this->tableData = $scoringReport->getTableData();
124  $this->userRank = $scoringReport->getUserRank();
125  }
126  return $this;
127  }
static buildBasicAuth($lrsKey, $lrsSecret)
+ 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 163 of file class.ilLTIConsumerScoringGUI.php.

References buildTableGUI(), and getTableDataRange().

164  {
165  if (!$this->object->getHighscoreOwnTable() || !$this->object->getHighscoreEnabled()) {
166  $this->tableHtml .= '';
167  return $this;
168  }
169  $table = $this->buildTableGUI('userRank');
170  $table->setData($this->getTableDataRange(true));
171  $this->tableHtml .= $table->getHTML();
172  return $this;
173  }
+ Here is the call graph for this function:

◆ showCmd()

ilLTIConsumerScoringGUI::showCmd ( )
protected

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

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

69  {
70  global $DIC; /* @var \ILIAS\DI\Container $DIC */
71 
72  try {
73  $this->initTableData()
74  ->initHighScoreTable()
75  ->initUserRankTable()
76  ;
77  } catch (Exception $e) {
78  ilUtil::sendFailure($e->getMessage());
79  //$DIC->ui()->mainTemplate()->
80  $table = $this->buildTableGUI('fallback');
81  $table->setData(array());
82  $table->setMaxCount(0);
83  $table->resetOffset();
84  $this->tableHtml = $table->getHTML();
85  }
86 
87  $DIC->ui()->mainTemplate()->setContent($this->tableHtml);
88  }
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilLTIConsumerScoringGUI::$access
protected

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

◆ $object

ilLTIConsumerScoringGUI::$object
protected

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

Referenced by __construct(), and getObject().

◆ $tableData

ilLTIConsumerScoringGUI::$tableData
private

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

◆ $tableHtml

ilLTIConsumerScoringGUI::$tableHtml = ''
private

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

◆ $userRank

ilLTIConsumerScoringGUI::$userRank
private

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

◆ PART_FILTER_ACTIVE_ONLY

const ilLTIConsumerScoringGUI::PART_FILTER_ACTIVE_ONLY = 1

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

◆ PART_FILTER_ALL_USERS

const ilLTIConsumerScoringGUI::PART_FILTER_ALL_USERS = 3

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

◆ PART_FILTER_INACTIVE_ONLY

const ilLTIConsumerScoringGUI::PART_FILTER_INACTIVE_ONLY = 2

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

◆ PART_FILTER_MANSCORING_DONE

const ilLTIConsumerScoringGUI::PART_FILTER_MANSCORING_DONE = 4

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

◆ PART_FILTER_MANSCORING_NONE

const ilLTIConsumerScoringGUI::PART_FILTER_MANSCORING_NONE = 5

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


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