Get email id from LMS in SL2

May 18, 2016

I have retrieved student's name from Moodle i nStoryline using Javascript.

How could i pull student's email id in Storyline using the Javascript method ?

5 Replies
Dan Marsden

the SCORM datamodel doesn't give a lot of options for this - but the student_id variable is populated with the Moodle username so if your site uses e-mail addresses as the username you could use that.

Alternatively you could probably modify the Moodle code to store the e-mail address in the student_id field passed in the SCORM datamodel instead of the username - but any changes to code involve a level of risk unless you have someone with software development skills to help.

Abhishek Roy

"Unfortuantely the SCORM datamodel doesn't provide for much flexibility around this - the only 2 variables passed related to the student identity are "student_name" and "student_id" -

 the "student_id" field for SCORM 1.2 packages is currently configured to pass the username:
https://github.com/moodle/moodle/blob/master/mod/scorm/datamodels/scorm_12lib.php#L134

If you are using e-mail in the username field you might be able to just use that. Alternatively you could change $USER->username to $USER->email and see if that works - make sure you backup the files before making any changes though."

is studentid same as studentname ? i can't change the student name. can i set the studentid as email ?

This discussion is closed. You can start a new discussion or contact Articulate Support.