ILIAS  release_7 Revision v7.30-3-g800a261c036
ilCmiXapiScoringGUI Class Reference
+ Collaboration diagram for ilCmiXapiScoringGUI:

Public Member Functions

 __construct (ilObjCmiXapi $object)
 
 executeCommand ()
 

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
 
 $object
 

Protected Member Functions

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

Protected Attributes

 $access
 

Private Member Functions

 getTableDataRange ($scopeUserRank=false)
 

Private Attributes

 $tableData
 
 $tableHtml = ''
 
 $userRank
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilCmiXapiScoringGUI::__construct ( ilObjCmiXapi  $object)
Parameters
ilObjCmiXapi$object

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

References $object, and ilCmiXapiAccess\getInstance().

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

Member Function Documentation

◆ buildTableGUI()

ilCmiXapiScoringGUI::buildTableGUI (   $tableId)
protected
Parameters
string$tableId
Returns
ilCmiXapiScoringTableGUI

Definition at line 178 of file class.ilCmiXapiScoringGUI.php.

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

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

◆ executeCommand()

ilCmiXapiScoringGUI::executeCommand ( )
Exceptions
ilCmiXapiException

Definition at line 53 of file class.ilCmiXapiScoringGUI.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

◆ getTableDataRange()

ilCmiXapiScoringGUI::getTableDataRange (   $scopeUserRank = false)
private

Definition at line 133 of file class.ilCmiXapiScoringGUI.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  }
+ Here is the caller graph for this function:

◆ initHighScoreTable()

ilCmiXapiScoringGUI::initHighScoreTable ( )
protected

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

References buildTableGUI(), and getTableDataRange().

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

◆ initTableData()

ilCmiXapiScoringGUI::initTableData ( )
protected

Definition at line 109 of file class.ilCmiXapiScoringGUI.php.

Referenced by showCmd().

110  {
111  $filter = new ilCmiXapiStatementsReportFilter();
112  $filter->setActivityId($this->object->getActivityId());
113 
114  $linkBuilder = new ilCmiXapiHighscoreReportLinkBuilder(
115  $this->object,
116  $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
117  $filter
118  );
119 
120  $request = new ilCmiXapiHighscoreReportRequest(
121  $this->object->getLrsType()->getBasicAuth(),
122  $linkBuilder
123  );
124 
125  $scoringReport = $request->queryReport($this->object);
126  if (true === $scoringReport->initTableData()) {
127  $this->tableData = $scoringReport->getTableData();
128  $this->userRank = $scoringReport->getUserRank();
129  }
130  return $this;
131  }
+ Here is the caller graph for this function:

◆ initUserRankTable()

ilCmiXapiScoringGUI::initUserRankTable ( )
protected

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

References buildTableGUI(), and getTableDataRange().

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

◆ showCmd()

ilCmiXapiScoringGUI::showCmd ( )
protected

Definition at line 84 of file class.ilCmiXapiScoringGUI.php.

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

85  {
86  global $DIC; /* @var \ILIAS\DI\Container $DIC */
87 
88  try {
89  $this->initTableData()
90  ->initHighScoreTable()
91  ->initUserRankTable()
92  ;
93  //$table->setData($this->tableData);
94  } catch (Exception $e) {
95  ilUtil::sendFailure($e->getMessage());
96  $table = $this->buildTableGUI('fallback');
97  $table->setData(array());
98  $table->setMaxCount(0);
99  $table->resetOffset();
100  $this->tableHtml = $table->getHTML();
101  }
102 
103  $DIC->ui()->mainTemplate()->setContent($this->tableHtml);
104  }
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

ilCmiXapiScoringGUI::$access
protected

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

◆ $object

ilCmiXapiScoringGUI::$object

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

Referenced by __construct().

◆ $tableData

ilCmiXapiScoringGUI::$tableData
private

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

◆ $tableHtml

ilCmiXapiScoringGUI::$tableHtml = ''
private

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

◆ $userRank

ilCmiXapiScoringGUI::$userRank
private

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

◆ PART_FILTER_ACTIVE_ONLY

const ilCmiXapiScoringGUI::PART_FILTER_ACTIVE_ONLY = 1

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

◆ PART_FILTER_ALL_USERS

const ilCmiXapiScoringGUI::PART_FILTER_ALL_USERS = 3

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

◆ PART_FILTER_INACTIVE_ONLY

const ilCmiXapiScoringGUI::PART_FILTER_INACTIVE_ONLY = 2

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

◆ PART_FILTER_MANSCORING_DONE

const ilCmiXapiScoringGUI::PART_FILTER_MANSCORING_DONE = 4

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

◆ PART_FILTER_MANSCORING_NONE

const ilCmiXapiScoringGUI::PART_FILTER_MANSCORING_NONE = 5

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


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