65 public function __construct(
int $a_id = 0,
bool $a_reference =
true)
160 return $this->mastery_score * 100;
168 $this->mastery_score = $mastery_score_percent / 100;
277 if ($this->
getProvider()->isProviderKeyCustomizable()) {
289 if ($this->
getProvider()->isProviderKeyCustomizable()) {
333 if (strlen($this->
getProvider()->getXapiActivityId())) {
365 $params = preg_split(
'/; ?/', $params);
367 foreach ($params as
$param) {
372 $paramsAsArray[
$param[0]] = $value;
376 return $paramsAsArray;
389 $query =
"SELECT * FROM {$this->dbTableName()} WHERE obj_id = %s";
392 while ($row =
$DIC->database()->fetchAssoc(
$res)) {
430 'obj_id' => [
'integer', $this->
getId()]
436 'use_xapi' => [
'integer',$this->
getUseXapi()],
455 include_once
"./Services/Object/classes/class.ilObjectActivation.php";
457 switch ($activation[
"timing_type"]) {
475 include_once
"./Services/Object/classes/class.ilObjectActivation.php";
488 $item->update($this->ref_id);
553 $this->_highscore_enabled = (bool) $a_enabled;
574 $this->_highscore_achieved_ts = (bool) $a_achieved_ts;
594 $this->_highscore_percentage = (bool) $a_percentage;
614 $this->_highscore_wtime = (bool) $a_wtime;
634 $this->_highscore_own_table = (bool) $a_own_table;
654 $this->_highscore_top_table = (bool) $a_top_table;
675 $this->_highscore_top_num = (int) $a_top_num;
689 if ((
int) $this->_highscore_top_num != 0) {
746 $roles =
$DIC->access()->checkAccess(
'write',
'', $this->
getRefId()) ?
"Instructor" :
"Learner";
747 if ($this->
getProvider()->getAlwaysLearner() ==
true) {
751 $resource_link_id = $this->
getRefId();
752 if ($this->
getProvider()->getUseProviderId() ==
true) {
753 $resource_link_id =
'p' . $this->
getProvider()->getId();
757 if ($this->
getProvider()->getIncludeUserPicture()) {
758 $usrImage = ILIAS_HTTP_PATH .
"/" .
$DIC->user()->getPersonalPicturePath(
"small");
761 $documentTarget =
"window";
763 $documentTarget =
"iframe";
771 $nameGiven =
$DIC->user()->getFirstname();
772 $nameFull =
$DIC->user()->getFirstname();
775 $usrName =
$DIC->user()->getUTitle() ?
$DIC->user()->getUTitle() .
' ' :
'';
776 $usrName .=
$DIC->user()->getLastname();
777 $nameFamily = $usrName;
778 $nameFull = $usrName;
781 $nameGiven =
$DIC->user()->getFirstname();
782 $nameFamily =
$DIC->user()->getLastname();
783 $nameFull =
$DIC->user()->getFullname();
796 "lti_message_type" =>
"basic-lti-launch-request",
797 "lti_version" =>
"LTI-1p0",
798 "resource_link_id" => $resource_link_id,
799 "resource_link_title" => $this->
getTitle(),
801 "user_id" => $userIdLTI,
802 "user_image" => $usrImage,
804 "lis_person_name_given" => $nameGiven,
805 "lis_person_name_family" => $nameFamily,
806 "lis_person_name_full" => $nameFull,
807 "lis_person_contact_email_primary" => $emailPrimary,
808 "context_id" => $contextId,
809 "context_type" => $contextType,
810 "context_title" => $contextTitle,
811 "context_label" => $contextType .
" " . $contextId,
812 "launch_presentation_locale" => $this->lng->getLangKey(),
813 "launch_presentation_document_target" => $documentTarget,
814 "launch_presentation_width" =>
"",
815 "launch_presentation_height" =>
"",
816 "launch_presentation_return_url" => $returnUrl,
817 "tool_consumer_instance_guid" => $value =
CLIENT_ID .
"." . implode(
".", array_reverse(explode(
"/", parse_url(ILIAS_HTTP_PATH)[
"path"]))) . parse_url(ILIAS_HTTP_PATH)[
"host"],
818 "tool_consumer_instance_name" =>
$DIC->settings()->get(
"short_inst_name") ?
$DIC->settings()->get(
"short_inst_name") :
CLIENT_ID,
819 "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
821 "tool_consumer_instance_contact_email" =>
$DIC->settings()->get(
"admin_email"),
822 "launch_presentation_css_url" =>
"",
823 "tool_consumer_info_product_family_code" =>
"ilias",
824 "tool_consumer_info_version" =>
$DIC->settings()->get(
"ilias_version"),
825 "lis_result_sourcedid" =>
$token,
826 "lis_outcome_service_url" => ILIAS_HTTP_PATH .
"/Modules/LTIConsumer/result.php?client_id=" .
CLIENT_ID,
827 "role_scope_mentor" =>
""
834 "callback" =>
"about:blank",
835 "http_method" =>
"POST",
836 "sign_method" =>
"HMAC_SHA1",
838 "data" => ($launch_vars + $custom_params)
843 return $launchParameters;
An exception for terminatinating execution or to throw for unit testing.
static getIdentAsId($userIdentMode, ilObjUser $user)
const PRIVACY_NAME_FULLNAME
const PRIVACY_NAME_FIRSTNAME
const PRIVACY_NAME_LASTNAME
static signOAuth($a_params)
sign request data with OAuth
static getByKeys($a_obj_id, $a_usr_id, $a_create=false)
Get a result by object and user key.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
isStatementsReportEnabled()
setActivationLimited($activationLimited)
setCustomLaunchSecret(string $customLaunchSecret)
setHighscorePercentage($a_percentage)
Sets if the percentages of the scores pass should be shown.
const HIGHSCORE_SHOW_TOP_TABLE
setActivationVisibility($activationVisibility)
setHighscoreTopTable($a_top_table)
Sets if the top-rankings table should be shown.
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
buildLaunchParameters(ilCmiXapiUser $cmixUser, $token, $contextType, $contextId, $contextTitle, $returnUrl='')
$activationLimited
repository object activation settings (handled by ilObject)
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
setHighscoreTopNum($a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
setProvider(ilLTIConsumeProvider $provider)
setHighscoreEnabled($a_enabled)
Sets if the highscore feature should be enabled.
setActivationStartingTime($activationStartingTime)
const LAUNCH_METHOD_EMBEDDED
setHighscoreAchievedTS($a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
setActivationEndingTime($activationEndingTime)
getActivationVisibility()
setHighscoreWTime($a_wtime)
Sets if the workingtime of the scores should be shown.
setLaunchMethod(string $launchMethod)
const HIGHSCORE_SHOW_OWN_TABLE
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
getHighscorePercentage()
Gets if the percentage column should be shown.
saveRepositoryActivationSettings()
setStatementsReportEnabled($statementsReportEnabled)
const LAUNCH_METHOD_NEW_WIN
setHighscoreOwnTable($a_own_table)
Sets if the table with the own ranking should be shown.
getActivationEndingTime()
setMasteryScorePercent(float $mastery_score_percent)
getHighscoreTopNum($a_retval=10)
Gets the number of entries which are to be shown in the top-rankings table.
const HIGHSCORE_SHOW_ALL_TABLES
loadRepositoryActivationSettings()
getActivationStartingTime()
setCustomLaunchKey(string $customLaunchKey)
setProviderId(int $providerId)
getHighscoreAchievedTS()
Returns if date and time of the scores achievement should be displayed.
setMasteryScore(float $mastery_score)
getHighscoreWTime()
Gets if the column with the workingtime should be shown.
__construct(int $a_id=0, bool $a_reference=true)
ilObjLTIConsumer constructor.
setCustomActivityId(string $custom_activity_id)
const LAUNCH_METHOD_OWN_WIN
setUseXapi(bool $use_xapi)
Class ilObject2 This is an intermediate progress of ilObject class.
getRefId()
get reference id @access public
getDescription()
get object description
getTitle()
get object title @access public
Class ilObjectActivation.
const TIMINGS_DEACTIVATED
setTimingType($a_type)
Set timing type.
static getItem($a_ref_id)
Get item data.
getId()
get object id @access public
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res