Explore the community Forums Lectora Lectora Questions & Answers How to reference a variable name in text throughout the course? Reply To: How to reference a variable name in text throughout the course?

#378594 Score: 0
Profile photo of Jason Dalrymple
Jason Dalrymple
Member
beginner
intermediate
profile
wise owl
curious george
contributor
friend finder
advanced
picture perfect
54 pts
@JasonADal

The first question is: How is the variable with the name set? Is it a text entry box or is it trying to pull it from the LMS using AICC_Student_Name? If you’re grabbing it using this method, testing won’t work unless it’s published to an LMS.

Depending on how and when it’s established, you may have to “trigger” it before it can be used elsewhere.

One trick might be to have a Change Contents in the place where the variable is first set using a button to submit the name. The button would then modify the variable, then use Change Contents – Text Block – “Thanks, VAR(your_var).”

Once it’s set and referenced the first time, it should carry through the rest of the course. I had this happen with a variable I used that calculated a specific date referenced through out the course and had to use the Change Content to “trigger” it before it carried through the course.

If I have some time on Monday, I can try and whip something up. Otherwise, if you post a sample, at least one of us can take a look!