Skip to main content
Known Participant
October 12, 2017
Answered

Inserting line breaks in a variable in Captivate 2017

  • October 12, 2017
  • 1 reply
  • 963 views

Hello!

I was wondering if there was a way to insert line breaks into a variable that is then posted in a text field?

I tried everything mentioned here for an older version of Captivate, to no avail: Discussion | eLearning | Page 2346895

What I want to do:

I have a complex activity that I want to give feedback on. It is a conversation simulation, where the user has multiple possible actions he can undertake. Every one of those actions can be successful, failed, and sometimes partially successful. I want the feedback slide to include the feedback per failed and partially successful actions, but not for the successful ones. In this way, the feedback is intelligently built line per line with only the pertinent information.

If I cannot create a variable that will basically concatenate all of those lines of feedback into a variable, I only see 2 solutions

1- Create every possible feedback for all sets of possibilities, and use the Change State action to give the feedback text field appropriate to the learner's set of actions. This would be bery tedious, and somewhat error-prone.

2- Give feedback for all actions, even the successful ones, with one separate variable for every line of feedback, so that I can have the feedback text field look like this:

     $$Var_Feedback_Line_1$$

     $$Var_Feedback_Line_2$$

     $$Var_Feedback_Line_3$$

     $$Var_Feedback_Line_4$$

     $$Var_Feedback_Line_5$$

I'm not sure what I should do from here. What are your suggestions?

This topic has been closed for replies.
Correct answer Gaanf

If you are publishing to HTML5, a simple <br> line break tag in your variable text should do the trick. Doesn't work for Flash output, of course.

1 reply

GaanfCorrect answer
Inspiring
October 12, 2017

If you are publishing to HTML5, a simple <br> line break tag in your variable text should do the trick. Doesn't work for Flash output, of course.

GamashireAuthor
Known Participant
October 12, 2017

Thank you. I can't believe I spent a few hours looking for that. Trying \n and similar methods to no avail...

GamashireAuthor
Known Participant
October 12, 2017

Just one warning, maybe not relevant: the number of characters in a variable is limited. It used to be 256, but in later versions it looks more about 150. 


Oh, thanks!

It definitely is relevant. I'll be able to manage around this, but it could have given me a headache if you hadn't given me that warning.