Picture of Chris Gillison
learner first name not showing in Moodle 3.8.1
by Chris Gillison - Monday, 23 March 2020, 5:32 AM
 

Hi all,

I'm trying to inject the learner's first name into my menu body using the following code:

{{_globals._learnerInfo.firstname}}

This works locally (in that I get the default first name "Sam"), but when I upload the course to my Moodle 3.8.1 site, the course runs but there's a blank where the name should appear. Any idea what I can do to fix this?

I'm using Framework 4.3.0 & Spoor 3.3.0

Best regards

PS. I'm also using adapt-certificate in the course, and this is displaying all info correctly, including first & last names.

Picture of Chris Gillison
Re: learner first name not showing in Moodle 3.8.1
by Chris Gillison - Monday, 23 March 2020, 6:11 AM
 

I've attached a console image. The LMS seems to know the student name, but it's also saying "LMS learner_name not in 'lastname, firstname' format".

Is the format different in Moodle to most LMSs (my client is using Workday)?


Picture of Matt Leathes
Re: learner first name not showing in Moodle 3.8.1
by Matt Leathes - Monday, 23 March 2020, 12:15 PM
 

Hi Chris

As you can see from the SCORM 1.2 spec, the requirement for the student_name field is that it must be in Lastname, Firstname format:

You should probably log this as a bug with whichever LMS that is you're running from - sorry I'm not exactly clear if it's Moodle or Workday.

The only real problem this will cause is that it means this bit of code will be unable to extract the learner's firstname and lastname from the data.

 

Picture of Matt Leathes
Re: learner first name not showing in Moodle 3.8.1
by Matt Leathes - Monday, 23 March 2020, 12:23 PM
 

If you are using Moodle then my reading of this issue makes me think that Moodle may have decided to deviate from the SCORM spec - but have included a setting to allow you to revert back to enforcing it if you need...

Picture of Chris Gillison
Re: learner first name not showing in Moodle 3.8.1
by Chris Gillison - Monday, 23 March 2020, 3:44 PM
 

Many thanks for such a thorough response Matt! Very much appreciated.

I'd found the getLearnerInfo() console.log, in adapt-offlineStorage-scorm.js, but I rooted around for ages searching for Moodle's handling of student name, only to draw a complete blank.

For clarity, I test my SCORM courses on a Moodle site I set up, but the client is using Workday. I think it's 'suck it and see' time - it may work fine on Workday. If not, as you say, best to contact them and see how to get it working.

Best regards.