288 $this->groupSets = null;
289 $this->groups = null;
290 $this->primaryResourceLinkId = null;
291 $this->shareApproved = null;
292 $this->created = null;
293 $this->updated = null;
315 $this->settingsChanged =
false;
326 public function delete():
bool 383 if (is_null($this->platform)) {
384 if (!is_null($this->context) || !is_null($this->contextId)) {
385 $this->platform = $this->
getContext()->getPlatform();
387 $this->platform = Platform::fromRecordId($this->platformId, $this->
getDataConnector());
410 $this->platform = null;
421 if (is_null($this->context) && !is_null($this->contextId)) {
435 if (is_null($this->contextId) && !is_null($this->context)) {
436 $this->contextId = $this->context->getRecordId();
458 if ($this->contextId !== $contextId) {
459 $this->context = null;
510 if (empty($this->dataConnector)) {
512 if (!empty($this->platform)) {
513 $this->dataConnector = $this->platform->getDataConnector();
528 if (array_key_exists($name, $this->
settings)) {
545 if ($value !== $old_value) {
546 if (!empty($value)) {
551 $this->settingsChanged =
true;
581 if ($this->settingsChanged) {
597 $has = !empty($this->
getSetting(
'ext_ims_lis_basic_outcome_url')) || !empty($this->
getSetting(
'lis_outcome_service_url'));
598 if (!$has && !empty($this->
getSetting(
'custom_lineitem_url')) && !empty($this->
getSetting(
'custom_ags_scopes'))) {
620 $has = !empty($this->
getSetting(
'custom_link_memberships_url'));
623 $has = !empty($this->
getSetting(
'ext_ims_lis_memberships_url'));
652 if (!empty($this->
getSetting(
'custom_ags_scopes'))) {
655 $has = !empty($this->
getSetting(
'custom_lineitems_url'));
670 if (!empty($this->
getSetting(
'custom_ags_scopes'))) {
673 $has = !empty($this->
getSetting(
'custom_lineitem_url'));
688 if (!empty($this->
getSetting(
'custom_ags_scopes'))) {
691 $has = !empty($this->
getSetting(
'custom_lineitem_url'));
720 $this->extResponse =
'';
723 $sourcedId = $userResult->ltiResultSourcedId;
726 $urlAGS = $sourceResourceLink->getSetting(
'custom_lineitem_url');
727 $urlLTI11 = $sourceResourceLink->getSetting(
'lis_outcome_service_url');
728 $urlExt = $sourceResourceLink->getSetting(
'ext_ims_lis_basic_outcome_url');
730 if (!empty($urlAGS)) {
731 if (($action === self::EXT_READ) && ($ltiOutcome->type === self::EXT_TYPE_DECIMAL) && $sourceResourceLink->hasResultService()) {
733 $ok = !empty($ltiOutcome);
734 } elseif ((($action === self::EXT_WRITE) && $this->
checkValueType($ltiOutcome, array(self::EXT_TYPE_DECIMAL)) && $sourceResourceLink->hasScoreService()) ||
735 ($action === self::EXT_DELETE)) {
736 if ($action === self::EXT_DELETE) {
738 $ltiOutcome->activityProgress =
'Initialized';
739 $ltiOutcome->gradingProgress =
'NotReady';
744 if (!$ok && is_null($ltiOutcome->
getValue())) {
747 if (!$ok && !empty($urlLTI11)) {
750 if (($action === self::EXT_READ) && ($ltiOutcome->type === self::EXT_TYPE_DECIMAL)) {
752 } elseif (($action === self::EXT_WRITE) && $this->
checkValueType($ltiOutcome, array(self::EXT_TYPE_DECIMAL))) {
753 $do =
'replaceResult';
757 } elseif ($action === self::EXT_DELETE) {
758 $do =
'deleteResult';
762 if ($action === self::EXT_WRITE) {
763 $comment = (empty($ltiOutcome->comment)) ?
'' : trim($ltiOutcome->comment);
764 if (!empty(
$comment) && !empty($sourceResourceLink->getSetting(
'ext_outcome_data_values_accepted'))) {
765 $resultDataTypes = explode(
',', $sourceResourceLink->getSetting(
'ext_outcome_data_values_accepted'));
766 $resultDataType =
'';
767 if (count($resultDataTypes) === 1) {
768 $resultDataType = $resultDataTypes[0];
769 } elseif (count($resultDataTypes) > 1) {
770 $isUrl = (strpos(
$comment,
'http://') === 0) || (strpos(
$comment,
'https://') === 0);
771 if ($isUrl && in_array(
'ltiLaunchUrl', $resultDataTypes)) {
772 $resultDataType =
'ltiLaunchUrl';
773 } elseif ($isUrl && in_array(
'url', $resultDataTypes)) {
774 $resultDataType =
'url';
775 } elseif (in_array(
'text', $resultDataTypes)) {
776 $resultDataType =
'text';
779 if (!empty($resultDataType)) {
783 <{$resultDataType}>{
$comment}</{$resultDataType}>
793 <textString>{$outcome}</textString>
798 $sourcedId = htmlentities($sourcedId);
802 <sourcedId>{$sourcedId}</sourcedId>
809 if (!isset($this->extNodes[
'imsx_POXBody'][
"{$do}Response"][
'result'][
'resultScore'][
'textString'])) {
812 $ltiOutcome->
setValue($this->extNodes[
'imsx_POXBody'][
"{$do}Response"][
'result'][
'resultScore'][
'textString']);
815 case self::EXT_WRITE:
816 case self::EXT_DELETE:
823 if (!$ok && !empty($urlExt)) {
826 if (($action === self::EXT_READ) && ($ltiOutcome->type === self::EXT_TYPE_DECIMAL)) {
827 $do =
'basic-lis-readresult';
828 } elseif (($action === self::EXT_WRITE) && $this->
checkValueType($ltiOutcome, array(self::EXT_TYPE_DECIMAL))) {
829 $do =
'basic-lis-updateresult';
833 } elseif ($action === self::EXT_DELETE) {
834 $do =
'basic-lis-deleteresult';
838 $params[
'sourcedid'] = $sourcedId;
839 $params[
'result_resultscore_textstring'] = $outcome;
840 if (!empty($ltiOutcome->language)) {
841 $params[
'result_resultscore_language'] = $ltiOutcome->language;
843 if (!empty($ltiOutcome->status)) {
844 $params[
'result_statusofresult'] = $ltiOutcome->status;
846 if (!empty($ltiOutcome->date)) {
847 $params[
'result_date'] = $ltiOutcome->date;
849 if (!empty($ltiOutcome->type)) {
850 $params[
'result_resultvaluesourcedid'] = $ltiOutcome->type;
852 if (!empty($ltiOutcome->dataSource)) {
853 $params[
'result_datasource'] = $ltiOutcome->dataSource;
855 if ($this->
doService($do, $urlExt,
$params,
'https://purl.imsglobal.org/spec/lti-ext/scope/outcomes')) {
858 if (isset($this->extNodes[
'result'][
'resultscore'][
'textstring'])) {
859 $ltiOutcome->
setValue($this->extNodes[
'result'][
'resultscore'][
'textstring']);
862 case self::EXT_WRITE:
863 case self::EXT_DELETE:
872 $hook =
new $className($this);
873 $response = $hook->doOutcomesService($action, $ltiOutcome, $userResult);
876 if ($action === self::EXT_READ) {
909 $this->extResponse =
'';
912 $do =
'basic-lti-loadsetting';
914 case self::EXT_WRITE:
915 $do =
'basic-lti-savesetting';
917 case self::EXT_DELETE:
918 $do =
'basic-lti-deletesetting';
925 if (is_null($value)) {
930 if ($this->
doService($do,
$url,
$params,
'https://purl.imsglobal.org/spec/lti-ext/scope/setting')) {
933 if (isset($this->extNodes[
'setting'][
'value'])) {
934 $response = $this->extNodes[
'setting'][
'value'];
940 case self::EXT_WRITE:
941 $this->
setSetting(
'ext_ims_lti_tool_setting', $value);
945 case self::EXT_DELETE:
962 $has = !empty($this->
getSetting(
'custom_link_setting_url'));
979 if (!empty($this->
getSetting(
'custom_link_setting_url'))) {
983 $this->lastServiceRequest =
$service->getHttpMessage();
984 $ok = $settings !==
false;
988 $hook =
new $className($this);
989 $settings = $hook->getToolSettings($mode, $simple);
1003 if (!empty($this->
getSetting(
'custom_link_setting_url'))) {
1007 $this->lastServiceRequest =
$service->getHttpMessage();
1011 $hook =
new $className($this);
1012 $ok = $hook->setToolSettings($settings);
1029 'Method ceLTIc\LTI\ResourceLink::hasMembershipService() has been deprecated; please use ceLTIc\LTI\ResourceLink::hasMembershipsService() instead.',
1046 'Method ceLTIc\LTI\ResourceLink::getMembership() has been deprecated; please use ceLTIc\LTI\ResourceLink::getMemberships() instead.',
1060 $userResults = array();
1061 $hasLtiLinkService = !empty($this->
getSetting(
'custom_link_memberships_url'));
1062 $hasLtiContextService = !empty($this->
getContextId()) &&
1065 $hasExtService = !empty($this->
getSetting(
'ext_ims_lis_memberships_url'));
1067 if (($hasLtiContextService && (!$withGroups || $hasGroupsService)) || (!$hasExtService && !$hasApiHook)) {
1069 $url = $this->
getContext()->getSetting(
'custom_context_memberships_v2_url');
1072 $url = $this->
getContext()->getSetting(
'custom_context_memberships_url');
1079 $userResults =
$service->getWithGroups();
1081 $this->lastServiceRequest =
$service->getHttpMessage();
1082 $ok = $userResults !==
false;
1083 } elseif ($hasLtiLinkService) {
1092 $userResults =
$service->getWithGroups();
1094 $this->lastServiceRequest =
$service->getHttpMessage();
1096 $ok = $userResults !==
false;
1098 if (!$ok && $hasExtService) {
1099 $this->extResponse =
'';
1105 'basic-lis-readmembershipsforcontextwithgroups',
1108 'https://purl.imsglobal.org/spec/lti-ext/scope/memberships' 1113 'basic-lis-readmembershipsforcontext',
1116 'https://purl.imsglobal.org/spec/lti-ext/scope/memberships' 1120 $this->groupSets = array();
1121 $this->groups = array();
1122 if (isset($this->extNodes[
'memberships'])) {
1123 $memberships = $this->extNodes[
'memberships'];
1124 } elseif (isset($this->extNodes[
'members'])) {
1125 $memberships = $this->extNodes[
'members'];
1131 if (!isset($memberships[
'member'])) {
1133 } elseif (!isset($memberships[
'member'][0])) {
1135 $members[0] = $memberships[
'member'];
1137 $members = $memberships[
'member'];
1140 for (
$i = 0;
$i < count($members);
$i++) {
1144 $firstname = (isset($members[$i][
'person_name_given'])) ? $members[$i][
'person_name_given'] :
'';
1145 $lastname = (isset($members[$i][
'person_name_family'])) ? $members[$i][
'person_name_family'] :
'';
1146 $fullname = (isset($members[$i][
'person_name_full'])) ? $members[$i][
'person_name_full'] :
'';
1147 $userresult->setNames($firstname, $lastname, $fullname);
1150 if (isset($members[$i][
'person_sourcedid'])) {
1151 $userresult->sourcedId = $members[
$i][
'person_sourcedid'];
1155 $email = (isset($members[$i][
'person_contact_email_primary'])) ? $members[$i][
'person_contact_email_primary'] :
'';
1159 if (isset($members[$i][
'roles'])) {
1164 if (!isset($members[$i][
'groups'][
'group'])) {
1166 } elseif (!isset($members[$i][
'groups'][
'group'][0])) {
1168 $groups[0] = $members[
$i][
'groups'][
'group'];
1170 $groups = $members[
$i][
'groups'][
'group'];
1172 for ($j = 0; $j < count($groups); $j++) {
1173 $group = $groups[$j];
1174 if (isset($group[
'set'])) {
1175 $set_id = $group[
'set'][
'id'];
1176 if (!isset($this->groupSets[$set_id])) {
1177 $this->groupSets[$set_id] = array(
'title' => $group[
'set'][
'title'],
'groups' => array(),
1178 'num_members' => 0,
'num_staff' => 0,
'num_learners' => 0);
1180 $this->groupSets[$set_id][
'num_members']++;
1181 if ($userresult->isStaff()) {
1182 $this->groupSets[$set_id][
'num_staff']++;
1184 if ($userresult->isLearner()) {
1185 $this->groupSets[$set_id][
'num_learners']++;
1187 if (!in_array($group[
'id'], $this->groupSets[$set_id][
'groups'])) {
1188 $this->groupSets[$set_id][
'groups'][] = $group[
'id'];
1190 $this->groups[$group[
'id']] = array(
'title' => $group[
'title'],
'set' => $set_id);
1192 $this->groups[$group[
'id']] = array(
'title' => $group[
'title']);
1194 $userresult->groups[] = $group[
'id'];
1196 if (isset($members[$i][
'lis_result_sourcedid'])) {
1197 $userresult->ltiResultSourcedId = $members[
$i][
'lis_result_sourcedid'];
1199 $userResults[] = $userresult;
1202 $userResults =
false;
1204 $ok = $userResults !==
false;
1206 if (!$ok && $hasApiHook) {
1208 $hook =
new $className($this);
1209 $userResults = $hook->getMemberships($withGroups);
1210 $ok = $userResults !==
false;
1214 foreach ($userResults as $userresult) {
1216 if (!empty($userresult->ltiResultSourcedId)) {
1217 $userresult->save();
1223 foreach ($oldUsers as $id => $userresult) {
1224 $userresult->delete();
1228 return $userResults;
1241 return $this->
getDataConnector()->getUserResultSourcedIDsResourceLink($this, $localOnly, $idScope);
1261 public function getLineItems(
string $resourceId = null,
string $tag = null,
int $limit = null)
1264 $this->extRequest =
'';
1265 $this->extRequestHeaders =
'';
1266 $this->extResponse =
'';
1267 $this->extResponseHeaders =
'';
1268 $this->lastServiceRequest = null;
1270 if (!empty($lineItemService)) {
1271 $lineItems = $lineItemService->getAll($this->ltiResourceLinkId, $resourceId, $tag, $limit);
1272 $http = $lineItemService->getHttpMessage();
1273 $this->extResponse =
$http->response;
1274 $this->extResponseHeaders =
$http->responseHeaders;
1275 $this->extRequest =
$http->request;
1276 $this->extRequestHeaders =
$http->requestHeaders;
1277 $this->lastServiceRequest =
$http;
1292 if (!empty($lineItemService)) {
1294 $ok = $lineItemService->createLineItem($lineItem);
1308 $this->extRequest =
'';
1309 $this->extRequestHeaders =
'';
1310 $this->extResponse =
'';
1311 $this->extResponseHeaders =
'';
1312 $this->lastServiceRequest = null;
1316 $outcomes = $resultService->getAll($limit);
1317 $http = $resultService->getHttpMessage();
1318 $this->extResponse =
$http->response;
1319 $this->extResponseHeaders =
$http->responseHeaders;
1320 $this->extRequest =
$http->request;
1321 $this->extRequestHeaders =
$http->requestHeaders;
1322 $this->lastServiceRequest =
$http;
1338 $this->extRequest =
'';
1339 $this->extRequestHeaders =
'';
1340 $this->extResponse =
'';
1341 $this->extResponseHeaders =
'';
1342 $this->lastServiceRequest = null;
1346 $status = $assessmentControlService->submitAction($assessmentControlAction, $user, $attemptNumber);
1347 $http = $assessmentControlService->getHttpMessage();
1348 $this->extResponse =
$http->response;
1349 $this->extResponseHeaders =
$http->responseHeaders;
1350 $this->extRequest =
$http->request;
1351 $this->extRequestHeaders =
$http->requestHeaders;
1352 $this->lastServiceRequest =
$http;
1390 if (!empty($ltiResourceLinkId)) {
1391 $resourceLink->load();
1392 if (is_null($resourceLink->id) && !empty($tempId)) {
1393 $resourceLink->ltiResourceLinkId = $tempId;
1394 $resourceLink->load();
1399 return $resourceLink;
1412 $resourceLink->setContext($context);
1415 if (!empty($ltiResourceLinkId)) {
1416 $resourceLink->load();
1417 if (is_null($resourceLink->id) && !empty($tempId)) {
1418 $resourceLink->ltiResourceLinkId = $tempId;
1419 $resourceLink->load();
1422 $resourceLink->setContext($context);
1425 return $resourceLink;
1438 $resourceLink->load($id);
1440 return $resourceLink;
1452 private function load(
int $id = null): bool
1468 if (empty($supportedTypes)) {
1469 $supportedTypes = explode(
1471 str_replace(
' ',
'', strtolower($this->
getSetting(
'ext_ims_lis_resultvalue_sourcedids', self::EXT_TYPE_DECIMAL)))
1474 $type = $ltiOutcome->type;
1477 $ok = in_array(
$type, $supportedTypes) || empty($value);
1480 if (
$type === self::EXT_TYPE_PERCENTAGE) {
1481 if (substr($value, -1) ===
'%') {
1482 $value = substr($value, 0, -1);
1484 $ok = is_numeric($value) && ($value >= 0) && ($value <= 100);
1486 $ltiOutcome->
setValue($value / 100);
1487 $ltiOutcome->type = self::EXT_TYPE_DECIMAL;
1489 } elseif (
$type === self::EXT_TYPE_RATIO) {
1490 $parts = explode(
'/', $value, 2);
1494 $ltiOutcome->type = self::EXT_TYPE_DECIMAL;
1497 } elseif (
$type === self::EXT_TYPE_LETTER_AF) {
1498 if (in_array(self::EXT_TYPE_LETTER_AF_PLUS, $supportedTypes)) {
1500 $ltiOutcome->type = self::EXT_TYPE_LETTER_AF_PLUS;
1501 } elseif (in_array(self::EXT_TYPE_TEXT, $supportedTypes)) {
1503 $ltiOutcome->type = self::EXT_TYPE_TEXT;
1506 } elseif (
$type === self::EXT_TYPE_LETTER_AF_PLUS) {
1507 if (in_array(self::EXT_TYPE_LETTER_AF, $supportedTypes) && (strlen($value) === 1)) {
1509 $ltiOutcome->type = self::EXT_TYPE_LETTER_AF;
1510 } elseif (in_array(self::EXT_TYPE_TEXT, $supportedTypes)) {
1512 $ltiOutcome->type = self::EXT_TYPE_TEXT;
1515 } elseif (
$type === self::EXT_TYPE_TEXT) {
1516 $ok = is_numeric($value) && ($value >= 0) && ($value <= 1);
1518 $ltiOutcome->type = self::EXT_TYPE_DECIMAL;
1519 } elseif (substr($value, -1) ===
'%') {
1520 $value = substr($value, 0, -1);
1521 $ok = is_numeric($value) && ($value >= 0) && ($value <= 100);
1523 if (in_array(self::EXT_TYPE_PERCENTAGE, $supportedTypes)) {
1524 $ltiOutcome->type = self::EXT_TYPE_PERCENTAGE;
1526 $ltiOutcome->
setValue($value / 100);
1527 $ltiOutcome->type = self::EXT_TYPE_DECIMAL;
1548 $this->extRequest =
'';
1549 $this->extRequestHeaders =
'';
1550 $this->extResponse =
'';
1551 $this->extResponseHeaders =
'';
1552 $this->lastServiceRequest = null;
1554 $params[
'lti_version'] = $this->
getPlatform()->ltiVersion;
1555 $params[
'lti_message_type'] =
$type;
1559 $accessToken = $this->platform->getAccessToken();
1561 if (empty($accessToken)) {
1563 $this->platform->setAccessToken($accessToken);
1569 $accessToken->expires = time();
1570 $accessToken->get($scope,
true);
1571 $this->platform->setAccessToken($accessToken);
1577 $signed = $this->
getPlatform()->addSignature($url, $params,
'POST',
'application/x-www-form-urlencoded');
1579 if (is_array($signed)) {
1580 $http =
new HttpMessage($url,
'POST', $signed);
1582 $http =
new HttpMessage($url,
'POST', $params, $signed);
1584 if (
$http->send()) {
1586 $this->extResponse =
$http->response;
1587 $this->extResponseHeaders =
$http->responseHeaders;
1590 $this->extDoc->loadXML(
$http->response);
1591 $this->extNodes = $this->
domnodeToArray($this->extDoc->documentElement);
1592 if (isset($this->extNodes[
'statusinfo'][
'codemajor']) && ($this->extNodes[
'statusinfo'][
'codemajor'] ===
'Success')) {
1598 $retry = $retry && !$newToken && !$ok;
1600 $accessToken = $this->platform->getAccessToken();
1601 $accessToken->expires = time();
1602 $accessToken->get($scope,
true);
1603 $this->platform->setAccessToken($accessToken);
1607 $this->extRequest =
$http->request;
1608 $this->extRequestHeaders =
$http->requestHeaders;
1609 $this->lastServiceRequest =
$http;
1624 $this->extRequest =
'';
1625 $this->extRequestHeaders =
'';
1626 $this->extResponse =
'';
1627 $this->extResponseHeaders =
'';
1628 $this->lastServiceRequest = null;
1631 $outcome = $resultService->get($userResult);
1632 $http = $resultService->getHttpMessage();
1633 $this->extResponse =
$http->response;
1634 $this->extResponseHeaders =
$http->responseHeaders;
1635 $this->extRequest =
$http->request;
1636 $this->extRequestHeaders =
$http->requestHeaders;
1637 $this->lastServiceRequest =
$http;
1653 $this->extRequest =
'';
1654 $this->extRequestHeaders =
'';
1655 $this->extResponse =
'';
1656 $this->extResponseHeaders =
'';
1657 $this->lastServiceRequest = null;
1660 $scoreService->submit($ltiOutcome, $userResult);
1661 $http = $scoreService->getHttpMessage();
1662 $this->extResponse =
$http->response;
1663 $this->extResponseHeaders =
$http->responseHeaders;
1665 $this->extRequest =
$http->request;
1666 $this->extRequestHeaders =
$http->requestHeaders;
1667 $this->lastServiceRequest =
$http;
1683 $this->extRequest =
'';
1684 $this->extRequestHeaders =
'';
1685 $this->extResponse =
'';
1686 $this->extResponseHeaders =
'';
1687 $this->lastServiceRequest = null;
1690 $xmlRequest = <<< EOD
1691 <?xml version =
"1.0" encoding =
"UTF-8"?>
1692 <imsx_POXEnvelopeRequest xmlns =
"http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0">
1694 <imsx_POXRequestHeaderInfo>
1695 <imsx_version>V1.0</imsx_version>
1696 <imsx_messageIdentifier>{$id}</imsx_messageIdentifier>
1697 </imsx_POXRequestHeaderInfo>
1704 </imsx_POXEnvelopeRequest>
1706 $scope =
'https://purl.imsglobal.org/spec/lti-bo/scope/basicoutcome';
1710 $accessToken = $this->platform->getAccessToken();
1712 if (empty($accessToken)) {
1714 $this->platform->setAccessToken($accessToken);
1720 $accessToken->expires = time();
1721 $accessToken->get(
$scope,
true);
1722 $this->platform->setAccessToken($accessToken);
1728 $header = $this->
getPlatform()->addSignature($url, $xmlRequest,
'POST',
'application/xml');
1730 $http = new \ILIAS\LTI\ToolProvider\Http\HttpMessage($url,
'POST', $xmlRequest, $header);
1731 if (
$http->send()) {
1733 $this->extResponse =
$http->response;
1734 $this->extResponseHeaders =
$http->responseHeaders;
1737 $this->extDoc->loadXML(
$http->response);
1738 $this->extNodes = $this->
domnodeToArray($this->extDoc->documentElement);
1739 if (isset($this->extNodes[
'imsx_POXHeader'][
'imsx_POXResponseHeaderInfo'][
'imsx_statusInfo'][
'imsx_codeMajor']) &&
1740 ($this->extNodes[
'imsx_POXHeader'][
'imsx_POXResponseHeaderInfo'][
'imsx_statusInfo'][
'imsx_codeMajor'] ===
'success')) {
1746 $retry = $retry && !$newToken && !$ok;
1748 $accessToken = $this->platform->getAccessToken();
1749 $accessToken->expires = time();
1750 $accessToken->get(
$scope,
true);
1751 $this->platform->setAccessToken($accessToken);
1755 $this->extRequest =
$http->request;
1756 $this->extRequestHeaders =
$http->requestHeaders;
1757 $this->lastServiceRequest =
$http;
1774 $lineItemService =
false;
1777 return $lineItemService;
1788 switch ($node->nodeType) {
1789 case XML_CDATA_SECTION_NODE:
1791 $output = trim($node->textContent);
1793 case XML_ELEMENT_NODE:
1794 for (
$i = 0;
$i < $node->childNodes->length;
$i++) {
1795 $child = $node->childNodes->item(
$i);
1797 if (isset($child->tagName)) {
1798 $output[$child->tagName][] = $v;
1806 if (is_array($output)) {
1807 if ($node->hasAttributes()) {
1808 foreach ($node->attributes as $attrNode) {
1809 $output[
'@attributes'][$attrNode->name] = (string) $attrNode->value;
1812 foreach ($output as $t => $v) {
1813 if (is_array($v) && (count($v) === 1) && ($t !==
'@attributes')) {
1814 $output[$t] = $v[0];
getRecordId()
Get the context record ID.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
static fromRecordId(int $id, \ILIAS\LTI\ToolProvider\DataConnector\DataConnector $dataConnector)
Load the context from the database.
Class to represent a platform context.
getDataConnector()
Get the data connector.