In SCORM cmi.learner_name is not formatted correctly.

In SCORM cmi.learner_name is not formatted correctly.

by Eric Lowry -
Number of replies: 2

Hello everyone,

I'm trying to separate the user's first name and last name in a SCORM package loaded into moodle.

My issue is that while I am expecting either Lastname, Firstname or only one of the two values if they are not filled in, what I am receiving is formatted in the following way: Lastname Firstname, without the separating comma.

And as a result, I have no means of separating the two values through code, which causes multiple issues in the workflow of the SCORM package that is being deployed.


Is this an issue specific to moodle? Is there a way to fix this?

Average of ratings: -
In reply to Eric Lowry

Re: In SCORM cmi.learner_name is not formatted correctly.

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
The SCORM 1.2 standard does specify the format of that value, I'm pretty sure there are also tests in the ADL compliance test packages that verify the LMS reports in the correct format too.

Scorm 1.2 states this for cmi.core.student_name
Format: Last name, first name and middle initial. Last name and first name are separated by a comma. Spaces in the name must by honored.
Example Return values:
"Student, Joseph A."
"Student, Mike A. Jr."

But... If you have SCORM standards mode disabled (admin > plugins > scorm) then Moodle will use the standard "fullname()" API function for deciding how to format the users name - which uses the site fullnamedisplay and other language related settings on name display formats.

I don't remember if SCORM 2004 specifies a different format, but Moodle uses the same code for dealing with the 2004 learner_name as the 1.2 student_name (using standards mode etc.)
Average of ratings: Useful (1)
In reply to Dan Marsden

Re: In SCORM cmi.learner_name is not formatted correctly.

by Eric Lowry -
Thanks!
The "SCORM standards mode" option did the trick!