19declare(strict_types=1);
29 public const string TABLE_NAME =
'lti_consumer_settings';
143 return $this->use_xapi && $this->
getTool()->getUseXapi();
169 $tool_activity_id = $this->
getTool()->getXapiActivityId();
184 $this->statements_report_enabled = $enabled;
194 $this->highscore_enabled = $enabled;
204 $this->highscore_achieved_ts = $shown;
214 $this->highscore_percentage = $shown;
224 $this->highscore_wtime = $shown;
242 return match (
true) {
257 return $this->highscore_top_num > 0 ? $this->highscore_top_num : 10;
262 $this->highscore_top_num = $top_num;
288 return new self(
$id, $reference);
313 $lom =
$DIC->learningObjectMetadata();
315 ->prepareDelete($lom->paths()->keywords())
318 $keywords = $this->
getTool()->getKeywords();
319 if ($keywords !== []) {
321 ->prepareCreateOrUpdate($lom->paths()->keywords(), ...$keywords)
332 'SELECT * FROM ' . self::TABLE_NAME .
' WHERE obj_id = %s',
340 $this->
setToolId((
int) $row[
'provider_id']);
343 $this->mastery_score = (float) $row[
'mastery_score'];
344 $this->score_maximum = (float) ($row[
'score_maximum'] ?? 0) > 0 ? (float) $row[
'score_maximum'] : 1.0;
345 $this->use_xapi = (bool) $row[
'use_xapi'];
346 $this->custom_activity_id = (string) $row[
'activity_id'];
347 $this->statements_report_enabled = (bool) $row[
'show_statements'];
348 $this->highscore_enabled = (bool) $row[
'highscore_enabled'];
349 $this->highscore_achieved_ts = (bool) $row[
'highscore_achieved_ts'];
350 $this->highscore_percentage = (bool) $row[
'highscore_percentage'];
351 $this->highscore_wtime = (bool) $row[
'highscore_wtime'];
352 $this->highscore_own_table = (bool) $row[
'highscore_own_table'];
353 $this->highscore_top_table = (bool) $row[
'highscore_top_table'];
354 $this->highscore_top_num = (
int) $row[
'highscore_top_num'];
358 protected function doCreate(
bool $clone_mode =
false): void
362 $DIC->database()->insert(
376 $DIC->database()->update(
379 [
'obj_id' => [
'integer', $this->
getId()]]
393 $DIC->database()->update(
396 [
'obj_id' => [
'integer', $new_obj->
getId()]]
409 foreach ([self::TABLE_NAME,
'lti_consumer_results',
'lti_consumer_grades'] as $table) {
411 'DELETE FROM ' . $table .
' WHERE obj_id = %s',
424 'provider_id' => [
'integer', $this->
getToolId()],
429 'use_xapi' => [
'integer', (
int) $this->use_xapi],
430 'activity_id' => [
'text', $this->custom_activity_id],
432 'highscore_enabled' => [
'integer', (
int) $this->highscore_enabled],
434 'highscore_percentage' => [
'integer', (
int) $this->highscore_percentage],
436 'highscore_own_table' => [
'integer', (
int) $this->highscore_own_table],
454 foreach ($params as $name => $value) {
455 if ((
string) $name !==
'' && is_scalar($value)) {
456 $notation[] = $name .
'=' . $value;
460 return implode(
';', $notation);
466 foreach (preg_split(
'/; ?/', $params) as
$param) {
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
OAuth1 key and secret set on a single LTI consumer object, used instead of the provider credentials w...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
cloneMetaData(ilObject $target_obj)
Copy meta data.
manipulateF(string $query, array $types, array $values)
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)