• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Get a Student Name from LMS with JS

Engaged ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

Hi there,

I checked a few discussions but could not get it to work..

I want to get the LMS Student name with JS in Captivate 2017. I manage to get the name in a Developer console with this line

API.LMSGetValue('cmi.core.student_name');

But not in a Captivate project.

Thanks in advance for the ideas

Bobby

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 29, 2018 Mar 29, 2018

I use cpAPIInterface.getVariableValue('cpQuizInfoStudentName'). Bookmarked this page:

Learn about the Common JavaScript interface for Adobe Captivate

You can then use JS functions to take out the first and last name, depends on the structure of the variable value.

Votes

Translate

Translate
Community Expert ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

Did you check if the variable cpQuizInfoStudentName is not filled in automatically in the LMS? That user variable is created by default in each project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

Thanks Lieve

The variable that I get in a console with this command

API.LMSGetValue('cmi.core.student_name');

is  my name from the SharePoint LMS that we use, so it has nothing to do with the cpQuizInfoStudentName I believe.

B

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

Did you check? Lot of LMS's do use the student name to fill in that variable. I don't know about your LMS, but worth checking, takes only seconds.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

Yes, the $$cpQuizInfoStudentName$$ variable makes a reference to the 'cmi.core.student_name' in SharePoint LMS. So it is a funky way to get to what I want. However, I would like to understand the JS lines one should use to get to other variables. I know you are not much of a JS person but maybe you have seen what the lines are? Thanks Lieve B

PS. Moreover, it takes the full name. I would like to be able to split First and Last name

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

I use cpAPIInterface.getVariableValue('cpQuizInfoStudentName'). Bookmarked this page:

Learn about the Common JavaScript interface for Adobe Captivate

You can then use JS functions to take out the first and last name, depends on the structure of the variable value.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

But how do you get that value on the screen?

The line gets the value, but which line would display the value in a text caption?

sorry, I am not the JS guy as you can see

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

You'll have to get the result of the manipulated variable in JS back into a user variable with cpAPIIntervade.setVariableValue(...) . Once it is in a Captivate variable you can insert it in a text container. I used this in a simple mathematical example:

Playing with Numbers - part 1 - Captivate blog

There are several JS experts around, I only use JS when advanced/shared actions are failing or becoming too cumbersome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

Thank you, that is great as usual. I managed to do the following

1. Created a custom variable in Captivate - myCustomLearnerName

2. OnEnter of the Slide insert the following

window.cpAPIInterface.setVariableValue("myCustomLearnerName", cpQuizInfoStudentName);

Actually, I tried the TLC's solution here https://forums.adobe.com/message/8451467#8451467 and it worked to return the first name only.

var getName = window.cpAPIInterface.getVariableValue( "cpQuizInfoStudentName" );

var newName = getName.split(",");    

newName .reverse();    

window.cpAPIInterface.setVariableValue("v_FirstName", newName[0]);

Thanks Lieve

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 24, 2019 May 24, 2019

Copy link to clipboard

Copied

Hi!

The customer installed our course to the Workday LMS and can't see the right student name.

I used two methods to get information about the learner:

cpQuizInfoStudentName and SCORM_CallLMSGetValue("cmi.core.student_name");

but the system shows "Workday, Learner".

Maybe somebody has an experience to solve it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2019 May 24, 2019

Copy link to clipboard

Copied

Do you have any idea how the account data are for that LMS? Do they use a 'username' and if yes, does it look like the real name of the student?

Not every LMS will transfer the user name to the Cativate user variable cpQuizInfoStudentName, not to cpQuizInfoStudentID. Both those user variables were originally created to be used for transfer to an interanal server. Some LMS's populate those variables, others do not.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 25, 2019 May 25, 2019

Copy link to clipboard

Copied

There is an unique user name in the Workday. It looks like normal first and last names.

The Workday has an open API to access data with human resources such as Get_Workday_Account.

It would be nice to find some example, how to get Workday credentials using java script.

At the moment the fastest solution is to use the input form inside of the course, but it is not, what we need actually.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 25, 2019 May 25, 2019

Copy link to clipboard

Copied

I'm sorry, but cannot help you with that. Told that not all LMS's do populate the variables.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 25, 2019 May 25, 2019

Copy link to clipboard

Copied

Ok. Thank you.

By the way I found something useful:

var proxy = new Human_ResourcesPortClient(cb, new EndpointAddress("https://wd2-impl-services1.workday.com/ccx/service/{tenantID}/Human_Resources"));
proxy.ClientCredentials.UserName.UserName = "{username@tenantID}";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 25, 2019 May 25, 2019

Copy link to clipboard

Copied

Fine, did you check  it out?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 25, 2019 May 25, 2019

Copy link to clipboard

Copied

At the moment no, will see in the future.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 11, 2020 Apr 11, 2020

Copy link to clipboard

Copied

LATEST

Were you able to access the Workday LMS student name using a web service or API? Having same issue šŸ˜ž

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 27, 2019 May 27, 2019

Copy link to clipboard

Copied

Maybe some of this could help you?

//___

(function(){

var stuName='';

if (typeof window.GetStudentName==='undefined'){

stuName='Name Not Found';

} else {

stuName=GetStudentName();

if(stuName==''){         

    stuName='Name not found on LMS'; 

} else {

       

}   

    var objCp=document.getElementById('Captivate');   

if(objCp && objCp.cpEISetValue){  

objCp.cpEISetValue('m_VarHandle.StoreName', stuName);

})();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 27, 2019 May 27, 2019

Copy link to clipboard

Copied

Now I tested GetStudentName() from the standard Captivate lms. It returns the same username.

Let's see onside.

Thank you for this idea.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources