Can LTI pass over time-zone information?

Can LTI pass over time-zone information?

by Tim Hunt -
Number of replies: 3
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

As we know, Moodle lets students set thier time zone in their user profile.

And, for a number of other learning tools, which you might want to link to using LTI, it would be helpful for the tool to know the users time-zone?

Is there a way for LTI to pass this information over? I have not been able to find one. Thanks.

Average of ratings: -
In reply to Tim Hunt

Re: Can LTI pass over time-zone information?

by Brett Dalton -
Picture of Moodle HQ Picture of Particularly helpful Moodlers
Tim

LTI has "Custom Paramater Subsitiutions" as an optional extension in LTI 1.1 and 1.3, one of which is $Person.address.timezonewhich I believe is UTC + offset. These variables are entirely optional are not all supported on either side of the equation. I dont think Moodle current supports this one at this time.  A similar mechanisim can be used to pass due dates to and from tools (resourse link variables for start date, release date etc), and this is something I want to look at in future so dates can be managed in one place for LTI tools, opposed to having disconnected dates between Moodle and the toos, we could look at some other variables then.
Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Can LTI pass over time-zone information?

by Jake Dallimore -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Tim,

Yep, we support this. See https://github.com/moodle/moodle/blob/777d00ef37e8588a2ba74cea302e9553c2f0e85d/mod/lti/locallib.php#L3899.

If you configure the tool with a custom param, like so:
usertimezone=$Person.address.timezone

you'll see this come through in the 'https://purl.imsglobal.org/spec/lti/claim/custom' claim, under 'usertimezone'. This will be of the form "Australia/Perth". Of course you can name it whatever you like. I just used 'usertimezone' as an example.

One important thing I've just noticed, and which will need fixing: Currently, if your user profile is set to "User server default", it'll be sent over to the tool as "99" (the select option value we use for "server default"), instead of first being resolved to the proper string (like "Australia/Perth"). If you've set a specific timezone, it'll come over as that, however. I'll create a ticket to fix this, since 99 is meaningless. I've found MDL-76400 which deals with this exact issue.

Cheers,

Average of ratings: Useful (2)
In reply to Jake Dallimore

Re: Can LTI pass over time-zone information?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Awesome. Thanks Jake and Brett for the info.