19 declare(strict_types=1);
103 public function __construct(
int $a_id = 0,
bool $a_reference =
true)
165 return $this->mastery_score * 100;
170 $this->mastery_score = $mastery_score_percent / 100;
200 return $this->launchMethod == self::LAUNCH_METHOD_OWN_WIN;
205 return $this->launchMethod == self::LAUNCH_METHOD_EMBEDDED;
250 if ($this->
getProvider()->isProviderKeyCustomizable()) {
259 if ($this->
getProvider()->isProviderKeyCustomizable()) {
288 if (strlen($this->
getProvider()->getXapiActivityId())) {
317 $param = explode(
'=', $param);
319 if ($param[0] !=
'') {
320 $value = isset($param[1]) ? $param[1] :
'';
321 $paramsAsArray[$param[0]] = $value;
325 return $paramsAsArray;
340 $param = explode(
'=', $param);
342 if ($param[0] !=
'') {
343 $value = isset($param[1]) ? $param[1] :
'';
344 $paramsAsArray[$param[0]] = $value;
348 return $paramsAsArray;
360 $query =
"SELECT * FROM {$this->dbTableName()} WHERE obj_id = %s";
361 $res = $DIC->database()->queryF($query, [
'integer'], [$this->
getId()]);
363 while ($row = $DIC->database()->fetchAssoc(
$res)) {
402 'obj_id' => [
'integer', $this->
getId()]
409 'use_xapi' => [
'integer',$this->
getUseXapi()],
427 if ($this->ref_id > 0) {
429 switch ($activation[
"timing_type"]) {
432 if (!is_null($activation[
"timing_start"])) {
433 $activation[
"timing_start"] = (
int) $activation[
"timing_start"];
436 if (!is_null($activation[
"timing_end"])) {
437 $activation[
"timing_end"] = (
int) $activation[
"timing_end"];
452 if ($this->ref_id > 0) {
465 $item->update($this->ref_id);
471 return self::DB_TABLE_NAME;
483 $this->_highscore_enabled = $a_enabled;
502 $this->_highscore_achieved_ts = $a_achieved_ts;
520 $this->_highscore_percentage = $a_percentage;
538 $this->_highscore_wtime = $a_wtime;
558 $this->_highscore_own_table = $a_own_table;
576 $this->_highscore_top_table = $a_top_table;
597 $this->_highscore_top_num = $a_top_num;
611 if ($this->_highscore_top_num != 0) {
622 return self::HIGHSCORE_SHOW_ALL_TABLES;
625 return self::HIGHSCORE_SHOW_TOP_TABLE;
629 return self::HIGHSCORE_SHOW_OWN_TABLE;
639 case self::HIGHSCORE_SHOW_ALL_TABLES:
644 case self::HIGHSCORE_SHOW_TOP_TABLE:
649 case self::HIGHSCORE_SHOW_OWN_TABLE:
664 $roles = $DIC->access()->checkAccess(
'write',
'', $this->
getRefId()) ?
"Instructor" :
"Learner";
666 if ($DIC->rbac()->review()->isAssigned($DIC->user()->getId(),
SYSTEM_ROLE_ID)) {
667 $roles =
"Administrator";
670 if ($this->
getProvider()->getAlwaysLearner() ==
true) {
674 $resource_link_id = $this->
getRefId();
675 if ($this->
getProvider()->getUseProviderId() ==
true) {
676 $resource_link_id =
'p' . $this->
getProvider()->getId();
680 if ($this->
getProvider()->getIncludeUserPicture()) {
681 $usrImage = self::getIliasHttpPath() .
"/" . $DIC->user()->getPersonalPicturePath(
"small");
684 $documentTarget =
"window";
686 $documentTarget =
"iframe";
694 $nameGiven = $DIC->user()->getFirstname();
695 $nameFull = $DIC->user()->getFirstname();
698 $usrName = $DIC->user()->getUTitle() ? $DIC->user()->getUTitle() .
' ' :
'';
699 $usrName .= $DIC->user()->getLastname();
700 $nameFamily = $usrName;
701 $nameFull = $usrName;
704 $nameGiven = $DIC->user()->getFirstname();
705 $nameFamily = $DIC->user()->getLastname();
706 $nameFull = $DIC->user()->getFullname();
720 $provider_custom_params = self::getProviderCustomParamsArray($this->
getProvider());
722 $merged_params = array_merge($provider_custom_params, $custom_params);
724 $toolConsumerInstanceGuid =
CLIENT_ID .
".";
725 $parseIliasUrl = parse_url(self::getIliasHttpPath());
726 if (array_key_exists(
"path", $parseIliasUrl)) {
727 $toolConsumerInstanceGuid .= implode(
".", array_reverse(explode(
"/", $parseIliasUrl[
"path"])));
729 $toolConsumerInstanceGuid .= $parseIliasUrl[
"host"];
731 "lti_message_type" =>
"basic-lti-launch-request",
732 "lti_version" =>
"LTI-1p0",
733 "resource_link_id" => $resource_link_id,
734 "resource_link_title" => $this->
getTitle(),
736 "user_id" => $userIdLTI,
737 "user_image" => $usrImage,
739 "lis_person_name_given" => $nameGiven,
740 "lis_person_name_family" => $nameFamily,
741 "lis_person_name_full" => $nameFull,
742 "lis_person_contact_email_primary" => $emailPrimary,
743 "context_id" => $contextId,
744 "context_type" => $contextType,
745 "context_title" => $contextTitle,
746 "context_label" => $contextType .
" " . $contextId,
747 "launch_presentation_locale" => $this->
lng->getLangKey(),
748 "launch_presentation_document_target" => $documentTarget,
749 "launch_presentation_width" =>
"",
750 "launch_presentation_height" =>
"",
751 "launch_presentation_return_url" => $returnUrl,
752 "tool_consumer_instance_guid" => $toolConsumerInstanceGuid,
753 "tool_consumer_instance_name" => $DIC->settings()->get(
"short_inst_name") ? $DIC->settings()->get(
"short_inst_name") :
CLIENT_ID,
754 "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
755 "tool_consumer_instance_url" => ilLink::_getLink(
ROOT_FOLDER_ID,
"root"),
756 "tool_consumer_instance_contact_email" => $DIC->settings()->get(
"admin_email"),
757 "launch_presentation_css_url" =>
"",
758 "tool_consumer_info_product_family_code" =>
"ilias",
760 "lis_result_sourcedid" =>
$token,
761 "lis_outcome_service_url" => self::getIliasHttpPath() .
"/Modules/LTIConsumer/result.php?client_id=" .
CLIENT_ID,
762 "role_scope_mentor" =>
"" 769 "callback" =>
"about:blank",
770 "http_method" =>
"POST",
771 "sign_method" =>
"HMAC_SHA1",
773 "data" => ($launch_vars + $merged_params)
787 $roles = $DIC->access()->checkAccess(
'write',
'', $this->
getRefId()) ?
"Instructor" :
"Learner";
789 if ($DIC->rbac()->review()->isAssigned($DIC->user()->getId(),
SYSTEM_ROLE_ID)) {
790 $roles =
"Administrator";
793 if ($this->
getProvider()->getAlwaysLearner() ==
true) {
797 $resource_link_id = $this->
getRefId();
798 if ($this->
getProvider()->getUseProviderId() ==
true) {
799 $resource_link_id =
'p' . $this->
getProvider()->getId();
803 if ($this->
getProvider()->getIncludeUserPicture()) {
804 $usrImage = self::getIliasHttpPath() .
"/" . $DIC->user()->getPersonalPicturePath(
"small");
807 $documentTarget =
"window";
809 $documentTarget =
"iframe";
817 $nameGiven = $DIC->user()->getFirstname();
818 $nameFull = $DIC->user()->getFirstname();
821 $usrName = $DIC->user()->getUTitle() ? $DIC->user()->getUTitle() .
' ' :
'';
822 $usrName .= $DIC->user()->getLastname();
823 $nameFamily = $usrName;
824 $nameFull = $usrName;
827 $nameGiven = $DIC->user()->getFirstname();
828 $nameFamily = $DIC->user()->getLastname();
829 $nameFull = $DIC->user()->getFullname();
839 $toolConsumerInstanceGuid =
CLIENT_ID .
".";
840 $parseIliasUrl = parse_url(self::getIliasHttpPath());
841 if (array_key_exists(
"path", $parseIliasUrl)) {
842 $toolConsumerInstanceGuid .= implode(
".", array_reverse(explode(
"/", $parseIliasUrl[
"path"])));
844 $toolConsumerInstanceGuid .= $parseIliasUrl[
"host"];
846 "lti_message_type" =>
"basic-lti-launch-request",
847 "lti_version" =>
"1.3.0",
848 "resource_link_id" => (string) $resource_link_id,
849 "resource_link_title" => $this->
getTitle(),
851 "user_id" => (string) $userIdLTI,
852 "user_image" => $usrImage,
854 "lis_person_name_given" => $nameGiven,
855 "lis_person_name_family" => $nameFamily,
856 "lis_person_name_full" => $nameFull,
857 "lis_person_contact_email_primary" => $emailPrimary,
858 "context_id" => $contextId,
859 "context_type" => $contextType,
860 "context_title" => $contextTitle,
861 "context_label" => $contextType .
" " . $contextId,
862 "launch_presentation_locale" => $this->
lng->getLangKey(),
863 "launch_presentation_document_target" => $documentTarget,
864 "launch_presentation_width" =>
"",
865 "launch_presentation_height" =>
"",
866 "launch_presentation_return_url" => $returnUrl,
867 "tool_consumer_instance_guid" => $toolConsumerInstanceGuid,
868 "tool_consumer_instance_name" => $DIC->settings()->get(
"short_inst_name") ? $DIC->settings()->get(
"short_inst_name") :
CLIENT_ID,
869 "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
870 "tool_consumer_instance_url" => ilLink::_getLink(
ROOT_FOLDER_ID,
"root"),
871 "tool_consumer_instance_contact_email" => $DIC->settings()->get(
"admin_email"),
872 "launch_presentation_css_url" =>
"",
873 "tool_consumer_info_product_family_code" =>
"ilias",
875 "lis_result_sourcedid" =>
"",
876 "lis_outcome_service_url" => self::getIliasHttpPath() .
"/Modules/LTIConsumer/result.php?client_id=" .
CLIENT_ID,
877 "role_scope_mentor" =>
"" 880 $provider_custom_params = self::getProviderCustomParamsArray($this->
getProvider());
882 $merged_params = array_merge($provider_custom_params, $custom_params);
883 foreach ($merged_params as
$key => $value) {
884 $launch_vars[
'custom_' .
$key] = $value;
888 include_once(
"Modules/LTIConsumer/classes/class.ilLTIConsumerGradeService.php");
890 $launch_vars[
'custom_lineitem_url'] = self::getIliasHttpPath() .
"/Modules/LTIConsumer/ltiservices.php/gradeservice/" . $contextId .
"/lineitems/" . $this->
id .
"/lineitem";
894 $launch_vars[
'custom_lineitems_url'] = self::getIliasHttpPath() .
"/Modules/LTIConsumer/ltiservices.php/gradeservice/" . $contextId .
"/lineitems/";
896 $launch_vars[
'custom_ags_scopes'] = implode(
",", $gradeservice->getPermittedScopes());
899 if (!empty(self::verifyPrivateKey())) {
900 $DIC->ui()->mainTemplate()->setOnScreenMessage(
'failure',
'ERROR_OPEN_SSL_CONF',
true);
903 return self::LTISignJWT($launch_vars, $endpoint, $clientId, $deploymentId, $nonce);
917 $deploymentId = $provider->
getId();
919 $context = $ilLTIConsumerLaunch->getContext();
920 $contextType = $ilLTIConsumerLaunch::getLTIContextType(
$context[
"type"]);
924 $roles =
"Instructor";
927 $usrImage = self::getIliasHttpPath() .
"/" . $DIC->user()->getPersonalPicturePath(
"small");
929 $documentTarget =
"window";
931 $documentTarget =
"iframe";
938 $nameGiven = $DIC->user()->getFirstname();
939 $nameFull = $DIC->user()->getFirstname();
942 $usrName = $DIC->user()->getUTitle() ? $DIC->user()->getUTitle() .
' ' :
'';
943 $usrName .= $DIC->user()->getLastname();
944 $nameFamily = $usrName;
945 $nameFull = $usrName;
948 $nameGiven = $DIC->user()->getFirstname();
949 $nameFamily = $DIC->user()->getLastname();
950 $nameFull = $DIC->user()->getFullname();
956 $toolConsumerInstanceGuid =
CLIENT_ID .
".";
957 $parseIliasUrl = parse_url(self::getIliasHttpPath());
958 if (array_key_exists(
"path", $parseIliasUrl)) {
959 $toolConsumerInstanceGuid .= implode(
".", array_reverse(explode(
"/", $parseIliasUrl[
"path"])));
961 $toolConsumerInstanceGuid .= $parseIliasUrl[
"host"];
963 $content_select_vars = [
964 "lti_message_type" =>
"ContentItemSelectionRequest",
965 "lti_version" =>
"1.3.0",
966 "user_id" => (string) $userIdLTI,
967 "user_image" => $usrImage,
969 "lis_person_name_given" => $nameGiven,
970 "lis_person_name_family" => $nameFamily,
971 "lis_person_name_full" => $nameFull,
972 "lis_person_contact_email_primary" => $emailPrimary,
973 "context_id" => (
string) $contextId,
974 "context_type" => $contextType,
975 "context_title" => $contextTitle,
976 "context_label" => $contextType .
" " . $contextId,
977 "launch_presentation_locale" => $DIC->language()->getLangKey(),
978 "launch_presentation_document_target" => $documentTarget,
979 "launch_presentation_width" =>
"",
980 "launch_presentation_height" =>
"",
981 "tool_consumer_instance_guid" => $toolConsumerInstanceGuid,
982 "tool_consumer_instance_name" => $DIC->settings()->get(
"short_inst_name") ? $DIC->settings()->get(
"short_inst_name") :
CLIENT_ID,
983 "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
984 "tool_consumer_instance_url" => ilLink::_getLink(
ROOT_FOLDER_ID,
"root"),
985 "tool_consumer_instance_contact_email" => $DIC->settings()->get(
"admin_email"),
986 "tool_consumer_info_product_family_code" =>
"ilias",
988 "content_item_return_url" => $returnUrl,
989 "accept_types" =>
"ltiResourceLink",
990 "accept_presentation_document_targets" =>
"iframe,window,embed",
991 "accept_multiple" =>
true,
992 "auto_create" =>
true,
994 $provider_custom_params = self::getProviderCustomParamsArray($provider);
995 foreach ($provider_custom_params as
$key => $value) {
996 $content_select_vars[
'custom_' .
$key] = $value;
999 if (!empty(self::verifyPrivateKey())) {
1000 $DIC->ui()->mainTemplate()->setOnScreenMessage(
'failure',
'ERROR_OPEN_SSL_CONF',
true);
1003 return self::LTISignJWT($content_select_vars,
'',
$clientId, $deploymentId, $nonce);
1006 public static function LTISignJWT(array $parms,
string $endpoint,
string $oAuthConsumerKey,
$typeId = 0,
string $nonce =
''): array
1012 if (isset($parms[
'lti_message_type']) && array_key_exists($parms[
'lti_message_type'], $messageTypeMapping)) {
1013 $parms[
'lti_message_type'] = $messageTypeMapping[$parms[
'lti_message_type']];
1015 if (isset($parms[
'roles'])) {
1016 $roles = explode(
',', $parms[
'roles']);
1017 $newRoles = array();
1018 foreach ($roles as $role) {
1019 if (strpos($role,
'urn:lti:role:ims/lis/') === 0) {
1020 $role =
'http://purl.imsglobal.org/vocab/lis/v2/membership#' . substr($role, 21);
1021 } elseif (strpos($role,
'urn:lti:instrole:ims/lis/') === 0) {
1022 $role =
'http://purl.imsglobal.org/vocab/lis/v2/institution/person#' . substr($role, 25);
1023 } elseif (strpos($role,
'urn:lti:sysrole:ims/lis/') === 0) {
1024 $role =
'http://purl.imsglobal.org/vocab/lis/v2/system/person#' . substr($role, 24);
1025 } elseif ((strpos($role,
'://') ===
false) && (strpos($role,
'urn:') !== 0)) {
1026 $role =
"http://purl.imsglobal.org/vocab/lis/v2/membership#{$role}";
1028 $newRoles[] = $role;
1030 $parms[
'roles'] = implode(
',', $newRoles);
1033 if (empty($nonce)) {
1034 $nonce = bin2hex(openssl_random_pseudo_bytes(10));
1042 $payLoad[
'iss'] = self::getIliasHttpPath();
1043 $payLoad[
'aud'] = $oAuthConsumerKey;
1044 $payLoad[self::LTI_JWT_CLAIM_PREFIX .
'/claim/deployment_id'] = strval(
$typeId);
1045 if (!empty($endpoint)) {
1046 $payLoad[self::LTI_JWT_CLAIM_PREFIX .
'/claim/target_link_uri'] = $endpoint;
1049 foreach ($parms as
$key => $value) {
1050 $claim = self::LTI_JWT_CLAIM_PREFIX;
1051 if (array_key_exists(
$key, $claimMapping)) {
1052 $mapping = $claimMapping[
$key];
1054 if (isset($mapping[
'isArray']) && $mapping[
'isArray']) {
1055 $value = explode(
',', $value);
1057 } elseif (isset($mapping[
'isBoolean'])) {
1058 $value = $mapping[
'isBoolean'];
1060 if (!empty($mapping[
'suffix'])) {
1061 $claim .=
"-{$mapping['suffix']}";
1063 $claim .=
'/claim/';
1064 if (is_null($mapping[
'group'])) {
1065 $payLoad[$mapping[
'claim']] = $value;
1066 } elseif (empty($mapping[
'group'])) {
1067 $payLoad[
"{$claim}{$mapping['claim']}"] = $value;
1069 $claim .= $mapping[
'group'];
1070 $payLoad[$claim][$mapping[
'claim']] = $value;
1072 } elseif (strpos(
$key,
'custom_') === 0) {
1073 $payLoad[
"{$claim}/claim/custom"][substr(
$key, 7)] = $value;
1074 } elseif (strpos(
$key,
'ext_') === 0) {
1075 $payLoad[
"{$claim}/claim/ext"][substr(
$key, 4)] = $value;
1079 if (!empty(self::verifyPrivateKey())) {
1085 $newParms[
'id_token'] =
$jwt;
1092 $err = self::verifyPrivateKey();
1096 $privatekey = $ilSetting->get(self::LTI_1_3_PRIVATE_KEY);
1097 $kid = $ilSetting->get(self::LTI_1_3_KID);
1099 "key" => $privatekey,
1107 $key = $ilSetting->get(self::LTI_1_3_PRIVATE_KEY);
1110 $kid = bin2hex(openssl_random_pseudo_bytes(10));
1111 $ilSetting->set(self::LTI_1_3_KID,
$kid);
1113 "digest_alg" =>
"sha256",
1114 "private_key_bits" => 2048,
1115 "private_key_type" => self::OPENSSL_KEYTYPE_RSA
1117 $res = openssl_pkey_new($config);
1118 openssl_pkey_export(
$res, $privatekey);
1119 if (!empty($privatekey)) {
1120 $ilSetting->set(self::LTI_1_3_PRIVATE_KEY, $privatekey);
1122 return self::ERROR_OPEN_SSL_CONF;
1133 if (
$res !==
false) {
1142 $jwks = [
'keys' => []];
1144 $privatekey = self::getPrivateKey();
1145 $res = openssl_pkey_get_private($privatekey[
'key']);
1149 $jwk[
'kty'] =
'RSA';
1150 $jwk[
'alg'] =
'RS256';
1151 $jwk[
'kid'] = $privatekey[
'kid'];
1152 $jwk[
'e'] = rtrim(strtr(base64_encode(
$details[
'rsa'][
'e']),
'+/',
'-_'),
'=');
1153 $jwk[
'n'] = rtrim(strtr(base64_encode(
$details[
'rsa'][
'n']),
'+/',
'-_'),
'=');
1154 $jwk[
'use'] =
'sig';
1156 $jwks[
'keys'][] = $jwk;
1164 if ($DIC[
'https']->isDetected()) {
1165 $protocol =
'https://';
1167 $protocol =
'http://';
1171 $rq_uri = strip_tags(
$_SERVER[
'REQUEST_URI']);
1175 if (is_int($pos = strpos($rq_uri,
"?"))) {
1176 $rq_uri = substr($rq_uri, 0, $pos);
1179 $path = pathinfo($rq_uri);
1180 if (isset(
$path[
'extension']) &&
$path[
'extension'] !==
'') {
1181 $uri = dirname($rq_uri);
1185 $uri = str_replace(
"Modules/LTIConsumer",
"", $uri);
1187 $f = new \ILIAS\Data\Factory();
1188 $uri =
$f->uri(rtrim($iliasHttpPath,
"/"));
1189 return $uri->getBaseURI();
1194 return self::getIliasHttpPath();
1199 return self::getIliasHttpPath() .
"/Modules/LTIConsumer/ltiauth.php";
1204 return self::getIliasHttpPath() .
"/Modules/LTIConsumer/ltitoken.php";
1209 return self::getIliasHttpPath() .
"/Modules/LTIConsumer/lticerts.php";
1214 return self::getIliasHttpPath() .
"/Modules/LTIConsumer/ltiregistration.php";
1219 return self::getIliasHttpPath() .
"/Modules/LTIConsumer/ltiregstart.php";
1224 return self::getIliasHttpPath() .
"/Modules/LTIConsumer/ltiregend.php";
1229 return self::getIliasHttpPath() .
"/Modules/LTIConsumer/lticonfig.php";
1234 $scopesSupported = array(
'openid');
1236 $scopesSupported = array_merge($scopesSupported, $gradeservice->getPermittedScopes());
1238 "issuer" => self::getPlattformId(),
1239 "authorization_endpoint" => self::getAuthenticationRequestUrl(),
1240 "token_endpoint" => self::getAccessTokenUrl(),
1241 "token_endpoint_auth_methods_supported" => [
"private_key_jwt"],
1242 "token_endpoint_auth_signing_alg_values_supported" => [
"RS256"],
1243 "jwks_uri" => self::getPublicKeysetUrl(),
1244 "registration_endpoint" => self::getRegistrationUrl(),
1245 "scopes_supported" => $scopesSupported,
1246 "response_types_supported" => [
"id_token"],
1247 "subject_types_supported" => [
"public",
"pairwise"],
1248 "id_token_signing_alg_values_supported" => [
"RS256"],
1249 "claims_supported" => [
"iss",
"aud"],
1250 "https://purl.imsglobal.org/spec/lti-platform-configuration" => [
1251 "product_family_code" =>
"ilias.de",
1253 "messages_supported" => [
1255 "type" =>
"LtiResourceLinkRequest",
1260 "type" =>
"LtiDeepLinkingRequest",
1274 $reponseData =
$data;
1276 $toolConfig = $data[
'https://purl.imsglobal.org/spec/lti-tool-configuration'];
1281 if (isset($data[
'jwks_uri'])) {
1284 foreach ($toolConfig[
'messages'] as
$message) {
1285 if (isset($message[
'type']) && $message[
'type'] ===
'LtiDeepLinkingRequest') {
1301 $reponseData[
'client_id'] = $tokenObj->aud;
1302 $reponseData[
'https://purl.imsglobal.org/spec/lti-tool-configuration'][
'deployment_id'] = $provider->
getId();
1303 return $reponseData;
1316 self::getLogger()->error(
"$code $message");
1318 $DIC->http()->saveResponse(
1319 $DIC->http()->response()
1321 ->withBody(Streams::ofString($message))
1323 $DIC->http()->sendResponse();
1324 $DIC->http()->close();
1326 $DIC->http()->close();
1334 header(
'Content-Type: application/json; charset=utf-8');
1335 header(
'Cache-Control: no-store');
1336 header(
'Pragma: no-cache');
1337 echo json_encode($obj, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
1339 self::sendResponseError(500,
"error in sendResponseJson");
1340 $DIC->http()->close();
1346 return new self($a_id, $a_reference);
1356 return file_get_contents(
'php://input');
1362 $keys = JWK::parseKeySet(self::getJwks());
1363 return JWT::decode($token, $keys);
1372 $auth = $DIC->http()->request()->getHeader(
"Authorization");
1374 if (count($auth) < 1) {
1375 self::sendResponseError(405,
"missing Authorization header");
1377 preg_match(
'/Bearer\s+(.+)$/i', $auth[0], $matches);
1378 if (count($matches) != 2) {
1380 self::sendResponseError(405,
"missing required Authorization Baerer token");
1385 return self::getTokenObject(
$token);
static getIdentAsId(int $userIdentMode, ilObjUser $user)
setUseXapi(bool $use_xapi)
const LAUNCH_METHOD_OWN_WIN
setInitiateLogin(string $initiate_login)
const HIGHSCORE_SHOW_TOP_TABLE
setPublicKeyset(string $public_keyset)
getHighscoreWTime()
Gets if the column with the workingtime should be shown.
setActivationEndingTime(?int $activationEndingTime=null)
static getLogger(string $a_component_id)
Get component logger.
setCustomActivityId(string $custom_activity_id)
__construct(int $a_id=0, bool $a_reference=true)
ilObjLTIConsumer constructor.
setCustomParams(string $customParams)
getActivationEndingTime()
setActivationLimited(bool $activationLimited)
setHighscoreEnabled(bool $a_enabled)
HIGHSCORE.
static getPublicKeysetUrl()
static sendResponseError(int $code, string $message, $log=true)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
getHighscorePercentage()
Gets if the percentage column should be shown.
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
setStatementsReportEnabled(bool $statementsReportEnabled)
setMasteryScorePercent(float $mastery_score_percent)
bool $activationLimited
repository object activation settings (handled by ilObject)
setHighscoreWTime(bool $a_wtime)
Sets if the workingtime of the scores should be shown.
const TIMINGS_DEACTIVATED
const AVAILABILITY_CREATE
setHighscoreAchievedTS(bool $a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
static verifyPrivateKey()
setHighscoreTopTable(bool $a_top_table)
Sets if the top-rankings table should be shown.
setContentItemUrl(string $content_item_url)
setCustomLaunchSecret(string $customLaunchSecret)
saveRepositoryActivationSettings()
static buildContentSelectionParameters(ilLTIConsumeProvider $provider, int $refId, string $returnUrl, string $nonce)
bool $activationVisibility
static getRegistrationUrl()
static modifyHttpPath(string $httpPath)
const PRIVACY_NAME_LASTNAME
static registerClient(array $data, object $tokenObj)
const PRIVACY_IDENT_IL_UUID_RANDOM
static getIdent(int $userIdentMode, ilObjUser $user)
bool $_highscore_top_table
static getInstance(int $a_id=0, bool $a_reference=true)
bool $statementsReportEnabled
getHighscoreTopNum(int $a_retval=10)
Gets the number of entries which are to be shown in the top-rankings table.
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
const LTI_1_3_PRIVATE_KEY
buildLaunchParametersLTI13(ilCmiXapiUser $cmixUser, string $endpoint, string $clientId, int $deploymentId, string $nonce, string $contextType, string $contextId, string $contextTitle, ?string $returnUrl='')
setRedirectionUris(string $redirection_uris)
loadRepositoryActivationSettings()
setLaunchMethod(string $launchMethod)
const REG_TOKEN_OP_NEW_REG
static getIliasHttpPath()
const PRIVACY_NAME_FIRSTNAME
bool $_highscore_percentage
setHighscoreOwnTable(bool $a_own_table)
Sets if the table with the own ranking should be shown.
getActivationVisibility()
static getOpenidConfigUrl()
static getAuthenticationRequestUrl()
static getTokenObject(string $token)
static LTISignJWT(array $parms, string $endpoint, string $oAuthConsumerKey, $typeId=0, string $nonce='')
static getAccessTokenUrl()
setKeyType(string $key_type)
static getRegistrationEndUrl()
ilLTIConsumeProvider $provider
const HIGHSCORE_SHOW_OWN_TABLE
setClientId(string $client_id)
setLtiVersion(string $lti_version)
const PRIVACY_NAME_FULLNAME
getActivationStartingTime()
isStatementsReportEnabled()
const LTI_JWT_CLAIM_PREFIX
static getRegistrationStartUrl()
const OPENSSL_KEYTYPE_RSA
static getByKeys(int $a_obj_id, int $a_usr_id, ?bool $a_create=false)
Get a result by object and user key.
int $activationEndingTime
setHighscorePercentage(bool $a_percentage)
Sets if the percentages of the scores pass should be shown.
setHighscoreMode(int $mode)
setActivationVisibility(bool $activationVisibility)
const LAUNCH_METHOD_NEW_WIN
static getItem(int $ref_id)
const REG_TOKEN_OP_UPDATE_REG
static getProviderCustomParamsArray(ilLTIConsumeProvider $provider)
setActivationStartingTime(?int $activationStartingTime=null)
static encode(array $payload, $key, string $alg, string $keyId=null, array $head=null)
Converts and signs a PHP array into a JWT string.
buildLaunchParameters(ilCmiXapiUser $cmixUser, string $token, string $contextType, string $contextId, string $contextTitle, ?string $returnUrl='')
setCustomLaunchKey(string $customLaunchKey)
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
int $activationStartingTime
getHighscoreAchievedTS()
Returns if date and time of the scores achievement should be displayed.
string $custom_activity_id
setHighscoreTopNum(int $a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
static sendResponseJson(array $obj)
static signOAuth(array $a_params)
sign request data with OAuth
string $customLaunchSecret
setProviderUrl(string $provider_url)
Class ilObjectActivation.
const ERROR_OPEN_SSL_CONF
setAvailability(int $availability)
const LAUNCH_METHOD_EMBEDDED
const HIGHSCORE_SHOW_ALL_TABLES
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
bool $_highscore_achieved_ts
setMasteryScore(float $mastery_score)
setProviderId(int $providerId)
setIsGlobal(bool $is_global)
setProvider(ilLTIConsumeProvider $provider)
bool $_highscore_own_table