Access to SRS student id via LTI server

11 views
Skip to first unread message

Jim Pettigrew

unread,
Mar 20, 2025, 12:47:04 AMMar 20
to numbas...@googlegroups.com
Hi All,

It appears that user_id is the variable used by the LTI tool to do its mapping against (in my case) unique Moodle identifiers. This is fine as it goes but for some purposes it would be useful to have access to Moodle identifiers that are the genuine student ids as used within the University system (and ultimately, I assume, sourced from the SRS or similar).

In the below exchange between Christian and Tom Salyers in Feb 2021, there is a reference to a variable that might carry what we need: lis_person_sourcedid.

I can see that this appears in the LTI source code in various places but I cannot see how I can access it for use in a Numbas exam for example, where I'd like to be able display the (SRS) student id at the top of the left-hand nav bar. (I've been able to modify the nav-equence.html file in the theme we are using to include student_name but student_id gives the Moodle identifier and not the desired SRS one.)

Thanks, and I hope that all that I've written above makes sense (!),

Jim


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Tom Salyers
Mon, Feb 22, 2021, 11:51 PM
Hi, all . As the subject says--we're putting in an instance of the Numbas LTI provider at our institution, and we've got some security paperwork to run through

Christian Lawson-Perfect <christia...@gmail.com>
Tue, Feb 23, 2021, 12:21 AM
to numbas-users

Ah, I saw the email you sent to num...@ncl.ac.uk before this one!
For everyone else's benefit, here's the reply I just sent Tom:

The information that the LTI tool receives about each user depends on how you configure the LTI link. The LTI consumer must at least send a unique ID for the user, which might or might not correspond to their username on the consumer.
There are a few other optional fields that the consumer can send; there's a good list of these at https://www.edu-apps.org/code.html. The potentially personally identifiying fields are the email address, and the name fields: given, family and full. The lis_person_sourcedid field is a unique identifier that the consumer can understand, and might be readable on its own or might need to be linked to the consumer's database to make sense.
The LTI launch data is saved in the temporary session table; this is deleted when the session expires. The username, email address and full name are stored permanently in the Numbas LTI provider's auth_user table. For each resource launched by a user, an LTIUserData record is created. This stores: the lis_result_sourcedid, a unique identifier generated by the consumer linking the user and resource; the lis_person_sourcedid and user_id described above; and whether the user is an instructor.
Finally, everything the student does inside a Numbas exam, such as submitted answers, is stored in the SCORM data model, in the numbas_lti_scormelement table.

I think that's everything that could be personally-identifying.

Christian Lawson-Perfect

unread,
Apr 1, 2025, 9:43:03 AMApr 1
to numbas...@googlegroups.com
Hi Jim,
Thanks for this suggestion. 
I thought that the lis_person_sourcedid field had been removed in LTI 1.3, but you prompted me to look more closely at the data that Moodle sends.
It looks like `person_sourcedid` is sent under the `lis` claim, and Moodle uses the value of the user's "ID Number" profile field for this.
Moodle also sends the user's Moodle username inside the `ext` claim, but that's a non-standard extension and I'm not sure if we should use it.
I've changed the authentication backend so that this is saved, and used as the identifier when possible. If you update your LTI server from the master branch, you'll get this change.
Hopefully that's useful for you.

Christian


--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/numbas-users/CAJ9nevHvS0Xx-zGCdZrwTSGOBaL8iThOO89iGbjebDH9U07gnw%40mail.gmail.com.

Jim Pettigrew

unread,
Apr 6, 2025, 8:47:44 PMApr 6
to numbas...@googlegroups.com
Thanks Christian.

When we update the server I will test this and let you know how I go.

Kind regards,

Jim

Reply all
Reply to author
Forward
0 new messages