Skip to main content
Known Participant
May 12, 2015 4:03 PM UTC
Question

Using cpQuizInfoStudentName

I need to the students name to appear on the completion  page using the cpQuizInfoStudentName variable. I have inserted the variable and specified the length. Does anyone know how to get it to display in the First Name, Last Name order?

This topic is closed to new replies. Start a new post to keep the conversation going.

13 replies

Participating Frequently
Jun 6, 2018 5:41 PM UTC

Hello everyone,

It didn't work for me. I'm using Sumtotal as my LMS. I'm using Captivate 2017.

I've added your script on the slide enter executing javascript, and I've added your code to the index.html file. Didn't work.

1. On Enter in Captivate

2. In Index.html file

Any help will be great. Thanks all

Translate
TLCMediaDesign
Inspiring
May 12, 2015 5:27 PM UTC

Execute this JavaScript:

var cp = document.Captivate;

var getName = cp.cpEIGetValue('m_VarHandle.cpQuizInfoStudentName');

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

getName.reverse();

var newName = getName[0]+" "+getName[1];

cp.cpEISetValue('m_VarHandle.cpQuizInfoStudentName', newName);

Translate
RocwonAuthor
Known Participant
May 13, 2015 2:27 PM UTC

Thanks for the code. Where do I execute it?  I tried on the slide's On Enter action and placed  $$cpQuizInfoStudentName$$ in a text box.  The output is the same.

Translate
TLCMediaDesign
Inspiring
May 13, 2015 2:57 PM UTC

What version of Captivate?

Translate
Lilybiri
Legend
May 12, 2015 5:22 PM UTC

It depends on how that value was captured into the variable, is it from the LMS? You'll need to use JS if you want to change its formatting.

Translate
RocwonAuthor
Known Participant
May 13, 2015 2:24 PM UTC

Yes.  Its coming from an LMS. 

Translate