19 declare(strict_types=1);
35 private \ILIAS\DI\Container
$dic;
41 $this->main_tpl = $DIC->ui()->mainTemplate();
54 if (!$this->
access->hasStatementsAccess()) {
58 switch ($DIC->ctrl()->getNextClass($this)) {
60 $cmd = $DIC->ctrl()->getCmd(
'show') .
'Cmd';
68 $table->resetFilter();
69 $table->resetOffset();
76 $table->writeFilterToSession();
77 $table->resetOffset();
87 $statementsFilter->setActivityId($this->
object->getActivityId());
95 $this->main_tpl->setOnScreenMessage(
'failure', $e->getMessage());
96 $table->setData(array());
97 $table->setMaxCount(0);
98 $table->resetOffset();
101 $this->dic->ui()->mainTemplate()->setContent($table->getHTML());
119 if ($this->
access->hasOutcomesAccess()) {
121 if ($actor && strlen($actor)) {
127 "given actor ({$actor}) is not a valid actor for object ({$this->object->getId()})" 156 if ($period->getStartXapiDateTime()) {
160 if ($period->getEndXapiDateTime()) {
161 $filter->
setEndDate($period->getEndXapiDateTime());
170 $auto->setResultField(
'login');
171 $auto->enableFieldSearchableCheck(
true);
172 $auto->setMoreLinkAvailable(
true);
176 if ($this->dic->http()->wrapper()->query()->has(
'term')) {
177 $term = $this->dic->http()->wrapper()->query()->retrieve(
'term', $this->dic->refinery()->kindlyTo()->string());
178 } elseif ($this->dic->http()->wrapper()->post()->has(
'term')) {
179 $term = $this->dic->http()->wrapper()->post()->retrieve(
'term', $this->dic->refinery()->kindlyTo()->string());
183 echo json_encode($result);
193 if ($this->
access->hasOutcomesAccess()) {
201 $usrId = $DIC->user()->getId();
212 $this->
object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
217 $this->
object->getLrsType()->getBasicAuth(),
220 $statementsReport = $request->queryReport($this->
object->getId());
221 $data = $statementsReport->getTableData();
223 $table->
setMaxCount($statementsReport->getMaxCount());
228 $isMultiActorReport = $this->
access->hasOutcomesAccess();
230 $table->setFilterCommand(
'applyFilter');
231 $table->setResetCommand(
'resetFilter');
238 $lrsType = $this->
object->getLrsType();
241 $defaultLrs = $lrsType->getLrsEndpointStatementsAggregationLink();
243 $defaultBasicAuth = $lrsType->getBasicAuth();
246 'X-Experience-API-Version' =>
'1.0.3',
247 'Authorization' => $defaultBasicAuth,
248 'Cache-Control' =>
'no-cache, no-store, must-revalidate' 258 $defaultVerbsUrl = $defaultLrs .
"?pipeline=" . urlencode($pipeline);
263 GuzzleHttp\RequestOptions::CONNECT_TIMEOUT => 10,
264 GuzzleHttp\RequestOptions::HTTP_ERRORS =>
false 273 $promises[
'defaultVerbs'] =
$client->sendAsync($defaultVerbsRequest, $req_opts);
275 $responses = GuzzleHttp\Promise\Utils::settle($promises)->wait();
278 return json_decode($body, (
bool) JSON_OBJECT_AS_ARRAY);
292 $match[
'statement.object.objectType'] =
'Activity';
293 $match[
'statement.actor.objectType'] =
'Agent';
295 $activityId = array();
299 $activityId[
'statement.context.extensions.https://ilias&46;de/cmi5/activityid'] = $this->
object->getActivityId();
302 '$regex' =>
'^' . preg_quote($this->
object->getActivityId()) .
'' 304 $activityId[
'$or'] = [];
305 $activityId[
'$or'][] = [
'statement.object.id' => $activityQuery];
306 $activityId[
'$or'][] = [
'statement.context.contextActivities.parent.id' => $activityQuery];
309 $match[
'$and'][] = $activityId;
312 $sort[
'statement.verb.id'] = 1;
315 $group = array(
'_id' =>
'$statement.verb.id');
319 $pipeline[] = array(
'$match' => $match);
320 $pipeline[] = array(
'$group' => $group);
321 $pipeline[] = array(
'$sort' => $sort);
__construct(ilObjCmiXapi $object)
setActor(\ilCmiXapiUser $actor)
static getInstance(ilObjCmiXapi $object)
initActorFilter(ilCmiXapiStatementsReportFilter $filter, ilCmiXapiStatementsTableGUI $table)
initVerbFilter(ilCmiXapiStatementsReportFilter $filter, ilCmiXapiStatementsTableGUI $table)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
initTableData(ilCmiXapiStatementsTableGUI $table, ilCmiXapiStatementsReportFilter $filter)
setEndDate(\ilCmiXapiDateTime $endDate)
asyncUserAutocompleteCmd()
getFilterItemByPostVar(string $a_post_var)
initPeriodFilter(ilCmiXapiStatementsReportFilter $filter, ilCmiXapiStatementsTableGUI $table)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getUserIdByLogin(string $a_login)
setStartDate(\ilCmiXapiDateTime $startDate)
resetOffset(bool $a_in_determination=false)
initLimitingAndOrdering(ilCmiXapiStatementsReportFilter $filter, ilCmiXapiStatementsTableGUI $table)
setSearchFields(array $a_fields)
Set searchable fields.
ilGlobalTemplateInterface $main_tpl
setOrderDirection(string $orderDirection)
setOrderField(string $orderField)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
determineOffsetAndOrder(bool $a_omit_offset=false)
static checkResponse(array $response, &$body, array $allowedStatus=[200, 204])
setMaxCount(int $a_max_count)
set max.
static getUsersForObject(int $objId, bool $asUsrId=false)