Skip to main content
Known Participant
May 12, 2015
Question

Using cpQuizInfoStudentName

  • May 12, 2015
  • 13 replies
  • 1914 views

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
June 6, 2018

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

TLCMediaDesign
Inspiring
May 12, 2015

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);

RocwonAuthor
Known Participant
May 13, 2015

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.

TLCMediaDesign
Inspiring
May 13, 2015

What version of Captivate?

Lilybiri
Legend
May 12, 2015

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.

RocwonAuthor
Known Participant
May 13, 2015

Yes.  Its coming from an LMS.