ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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
 
ilObjCmiXapi $object
 

Protected Member Functions

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

Protected Attributes

ilCmiXapiAccess $access
 

Private Member Functions

 getTableDataRange (bool $scopeUserRank=false)
 

Private Attributes

array $tableData
 
string $tableHtml = ''
 
int $userRank = null
 
ilGlobalTemplateInterface $main_tpl
 
ILIAS DI Container $dic
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilCmiXapiScoringGUI::__construct ( ilObjCmiXapi  $object)

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

51 {
52 global $DIC;
53 $this->dic = $DIC;
54 $this->main_tpl = $DIC->ui()->mainTemplate();
55 $this->object = $object;
56
57 $this->access = ilCmiXapiAccess::getInstance($this->object);
58 }
static getInstance(ilObjCmiXapi $object)
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilterCmd()

ilCmiXapiScoringGUI::applyFilterCmd ( )
protected

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

84 : void
85 {
86 $table = $this->buildTableGUI("");
87 $table->writeFilterToSession();
88 $table->resetOffset();
89 $this->showCmd();
90 }

References buildTableGUI(), and showCmd().

+ Here is the call graph for this function:

◆ buildTableGUI()

ilCmiXapiScoringGUI::buildTableGUI ( string  $tableId)
protected

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

172 {
173 $isMultiActorReport = $this->access->hasOutcomesAccess();
174 return new ilCmiXapiScoringTableGUI(
175 $this,
176 'show',
177 $isMultiActorReport,
178 $tableId,
179 $this->access->hasOutcomesAccess()
180 );
181 }

References ILIAS\Repository\access().

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

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

◆ executeCommand()

ilCmiXapiScoringGUI::executeCommand ( )
Exceptions
ilCmiXapiException

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

63 : void
64 {
65 if (!$this->access->hasHighscoreAccess()) {
66 throw new ilCmiXapiException('access denied!');
67 }
68
69 switch ($this->dic->ctrl()->getNextClass($this)) {
70 default:
71 $cmd = $this->dic->ctrl()->getCmd('show') . 'Cmd';
72 $this->{$cmd}();
73 }
74 }

References ILIAS\Repository\access().

+ Here is the call graph for this function:

◆ getTableDataRange()

ilCmiXapiScoringGUI::getTableDataRange ( bool  $scopeUserRank = false)
private

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

136 : array
137 {
138 if (false === $scopeUserRank) {
139 return array_slice($this->tableData, 0, $this->object->getHighscoreTopNum());
140 } else {
141 $offset = $this->userRank - 2 < 0 ? 0 : $this->userRank - 2;
142 $length = 5;
143 return array_slice($this->tableData, $offset, $length);
144 }
145 }

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()

ilCmiXapiScoringGUI::initHighScoreTable ( )
protected

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

147 : self
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(bool $scopeUserRank=false)

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

+ Here is the call graph for this function:

◆ initTableData()

ilCmiXapiScoringGUI::initTableData ( )
protected

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

112 : self
113 {
114 $filter = new ilCmiXapiStatementsReportFilter();
115 $filter->setActivityId($this->object->getActivityId());
116
117 $linkBuilder = new ilCmiXapiHighscoreReportLinkBuilder(
118 $this->object->getId(),
119 $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
120 $filter
121 );
122
123 $request = new ilCmiXapiHighscoreReportRequest(
124 $this->object->getLrsType()->getBasicAuth(),
125 $linkBuilder
126 );
127
128 $scoringReport = $request->queryReport($this->object->getId());
129 if (true === $scoringReport->initTableData()) {
130 $this->tableData = $scoringReport->getTableData();
131 $this->userRank = $scoringReport->getUserRank();
132 }
133 return $this;
134 }

References ILIAS\Repository\object().

Referenced by showCmd().

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

◆ initUserRankTable()

ilCmiXapiScoringGUI::initUserRankTable ( )
protected

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

159 : self
160 {
161 if (!$this->object->getHighscoreOwnTable() || !$this->object->getHighscoreEnabled()) {
162 $this->tableHtml .= '';
163 return $this;
164 }
165 $table = $this->buildTableGUI('userRank');
166 $table->setData($this->getTableDataRange(true));
167 $this->tableHtml .= $table->getHTML();
168 return $this;
169 }

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

+ Here is the call graph for this function:

◆ resetFilterCmd()

ilCmiXapiScoringGUI::resetFilterCmd ( )
protected

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

76 : void
77 {
78 $table = $this->buildTableGUI("");
79 $table->resetFilter();
80 $table->resetOffset();
81 $this->showCmd();
82 }

References buildTableGUI(), and showCmd().

+ Here is the call graph for this function:

◆ showCmd()

ilCmiXapiScoringGUI::showCmd ( )
protected

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

92 : void
93 {
94 try {
95 $this->initTableData()
96 ->initHighScoreTable()
97 ->initUserRankTable()
98 ;
99 //$table->setData($this->tableData);
100 } catch (Exception $e) {
101 $this->main_tpl->setOnScreenMessage('failure', $e->getMessage());
102 $table = $this->buildTableGUI('fallback');
103 $table->setData(array());
104 $table->setMaxCount(0);
105 $table->resetOffset();
106 $this->tableHtml = $table->getHTML();
107 }
108
109 $this->dic->ui()->mainTemplate()->setContent($this->tableHtml);
110 }

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

Referenced by applyFilterCmd(), and resetFilterCmd().

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

Field Documentation

◆ $access

ilCmiXapiAccess ilCmiXapiScoringGUI::$access
protected

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

◆ $dic

ILIAS DI Container ilCmiXapiScoringGUI::$dic
private

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

◆ $main_tpl

ilGlobalTemplateInterface ilCmiXapiScoringGUI::$main_tpl
private

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

◆ $object

ilObjCmiXapi ilCmiXapiScoringGUI::$object

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

Referenced by __construct().

◆ $tableData

array ilCmiXapiScoringGUI::$tableData
private

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

◆ $tableHtml

string ilCmiXapiScoringGUI::$tableHtml = ''
private

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

◆ $userRank

int ilCmiXapiScoringGUI::$userRank = null
private

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

◆ PART_FILTER_ACTIVE_ONLY

const ilCmiXapiScoringGUI::PART_FILTER_ACTIVE_ONLY = 1

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

◆ PART_FILTER_ALL_USERS

const ilCmiXapiScoringGUI::PART_FILTER_ALL_USERS = 3

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

◆ PART_FILTER_INACTIVE_ONLY

const ilCmiXapiScoringGUI::PART_FILTER_INACTIVE_ONLY = 2

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

◆ PART_FILTER_MANSCORING_DONE

const ilCmiXapiScoringGUI::PART_FILTER_MANSCORING_DONE = 4

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

◆ PART_FILTER_MANSCORING_NONE

const ilCmiXapiScoringGUI::PART_FILTER_MANSCORING_NONE = 5

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


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