• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Import LMS Variable (student_id) into Captivate and add it into the web object address.

Community Beginner ,
Mar 07, 2017 Mar 07, 2017

Copy link to clipboard

Copied

Hello. I have a project where I need to import the student_id variable from the LMS and then to add it at the end of the web address of a web object. I have contacted the LMS support to ask and what I got back is: "Make use of the SCORM Javascript function to access the StudentID. We do not support or recommend any approach outside the usage of StudentID. To do this, you can use the following in your course code: API.LMSGetValue( “cmi.core.student_id” ) (Where ‘LMS’ is the SCORM API Javascript variable in your code.". I am not familiar with javascript much, so I wrote:
var student = API.LMSGetValue( “cmi.core.student_id” ); but the student variable in my project was not changed with this code.

After I get the variable, I have to send it to API with web object, and the address should be something like:

https://2nzynnug73.execute-api.us-east-1.amazonaws.com/dev/user_event?apikey=hcpd-5zp2v6yN196iKJCnJN...

where student is the variable taken from the LMS.


Have anyone got similar task? Thank you very much.

Kind regards, Marko

TOPICS
Advanced

Views

583

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 08, 2017 Mar 08, 2017

Copy link to clipboard

Copied

Did you check the automatically creates (user) variables cpQuizInfoStudentID and cpQuizInfoStudentName? It depends on the LMS but they could be populated by the data from the LMS account.

As for having a variable in an URL string, I would use the CpExtra widget (InfoSemantics):

http://www.infosemantics.com.au/adobe-captivate-widgets/cpextra/help/miscellaneous-features

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 Beginner ,
Mar 08, 2017 Mar 08, 2017

Copy link to clipboard

Copied

LATEST

Thanks for the answer. I have tried with both, but unfortunatelly both veriables are problematic.

cpQuizInfoStudentID does not return anything, and cpQuizInfoStudentName returns the name in the format: LASTNAME, FIRSTNAME.

What I have tried is to do with the cpQuizInfoStudentName is:

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

var newName = getName.replace(/\, /g,'');

window.cpAPIInterface.setVariableValue('user2', newName);

I tried to remove the comma and the space between surname and name to receive the variable in format: LASTNAMEFIRSTNAME and send the value to my variable user2 as one word, but the code was not working. Actually, getting student id is more important because we can have two people with the same name, but in case nothing works for the ID, even the student name is satisfactory. For the student id I tried this:

var getName = API.LMSGetValue( “cmi.core.student_id” );

window.cpAPIInterface.setVariableValue('user2', getName);

to take the student_id variable as explained by the LMS support, but also without results.

Thanks about the widget CpExtra. I already purchased it (and the video tutorials how to work with those), so probably I would figure it out, first I need to convert variables.

Thank you very much for your efforts.

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