Concatenation to build (populate) history text box

New Here ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

I am using Captivate 11.0 and trying to capture user selections and then populate a feedback history in a text box.  This is for a healthcare class in which the students select from a list of options to gather information and ultimatley make a decision.  For example, if they click on "Medications" I have a text box with medication data display.  I want to capture only the data for those items the user selects and save it to a variable so it can be reviewed later ("History" button) if the user needs to recall data from a previous slide. 

Anyway, I am not having issues with any one variable, I simply haven't found a way or method to concatenate dynamic user selected variables and populate a text box.  Maybe I'm just using the wrong tool for the job.

Can anyone help with a tip, example or provide simple direction?  I'm lost.

Views

336

Likes

translate

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

correct answers 1 Correct Answer

Advocate , Jul 11, 2019 Jul 11, 2019
My extended write up on this is now available here...Response History With A Sorted Display - eLearning Hopefully it is helpful.

Likes

translate

Translate

Translate
Most Valuable Participant ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

You can insert multiple variables in one text container. Not really necessary to concatenate them.

Likes

translate

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
New Here ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

Thanks for your reply. The problem is, I can't predict what items the user may select.  Unless you are implying that I don't assign the variable until the user selects the specific item?

Likes

translate

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
Most Valuable Participant ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

How do you present them? If you use a dopdown interaction, you can link it to a variables and te chose item will be stored in that variable.

Have a look at:

Dropdown Interaction - tips - Captivate blog

Or you can use the radiobutton interaction, also can be associated with one variable.

Likes

translate

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
New Here ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

I am using buttons (10 Items).  I am able to get the data to display, I just can't find a way to carry the data forward to another slide and use if the student wants to review prior history of their selections and the data that was revealed.

I'm currently updating to version 11.5 or I would include a screenshot.

Thanks for your help.

Likes

translate

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
Most Valuable Participant ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

You need to store the choice in a variable. That is why I pointed to those interactions, much easier to store the chocieS. You could also use checkboxes interaction.

How to insert an display the value of a variable:

Discover/Use Captivate's System variables - Part 1 - Captivate blog

Likes

translate

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
New Here ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

I appreciate your help and will try to provide a visual and more detail.  I have always had the choices stored in a variable and I can get them to display (below is a screenshot of the specific slide).  I am trying to carry forward (in one variable) the choices the student made on this screen so it can be referenced as they progress.  Similar slides and options will follow as the student works through the simulation where they will continue to discover/gather other relevant information and make decisions based on the gathered info. Most students will likely select several of the items, not all. Only the options as they feel is relevant to the case scenario.

Likes

translate

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
Most Valuable Participant ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

Concatenation (do not believe that will result in what you want) is simple done with the Expression command and the operator +.

Example: suppose having 4 variables:

v_name = has a name

v_surname = has a surname

v_space = just a space

v_fullname empty

These commands will concatenate the values of 3 variables and sore them in the last

Expression v_result = v_name + v_space

Expression v_result = v_result + V_surname

I am pretty sure not to understand what you really want.

Likes

translate

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
New Here ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

That is exactly what I want to do (and I have tried).  Unfortunately, I think I've reached the maximum string length of the variable.  I'm not 100% sure but I found that a Captivate user variable has a maximum length of 250 characters. Am I correct?  That may mean I will simply need to supply paper for the students so they can write down the data they feel is important and forget about storing historical data.  Everything else is working as intended.

Likes

translate

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
Most Valuable Participant ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

Indeed, the number of characters in a variable is limited. That was the reason I mentioned in one of my first answers that you can insert several variables in one text container.

Likes

translate

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
New Here ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

I think I will have 40 distinct (information gathering) variables throughout this one scenario.  So if I populate the text container with the variables (in the order they could possibly be selected), they will appear on subsequent slides when the user clicks a "Review History" butn?  I think I'm following you. I did try that early on a few weeks ago, but when I clicked on Item #1, the variable text appeared at the top of the container and the next item clicked (#10) appeared at the bottom.  I was hoping to list the items sequentially.  Otherwise, I need to add a veritcal scroll bar to my container and I've never done that in Captivate. 

I initially tried:

when item 1 was selected =>   v_History = v_History + v_item_1

when item 7 was selected =>   v_History = v_History + v_item_7

My goal was to build the list out, but I think I reached the variable string lenght limit.  Needless to say, I will keep working on it and may try to use Actionscript 3 and Adobe Animate on my next project.

Thanks for your help Lilybiri and the response from Stagprime . Feel free to continue providing insight. I can always use the help and tips.

Likes

translate

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
Advocate ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

Perhaps it is not exactly what you are looking for but perhaps this is a fair compromise to get the desired look.

It will require some javascript and an array and perhaps a few more user variables in Captivate.

The idea is this - You can take your SmartShape that displays all the choices and list your variables inside.

$$item1$$
$$item2$$
$$item3$$

etc.

with the javascript - when you make a selection - you add that selection to the array and the history box will display them in the order that you select them so that you don't have really weird gaps.

Suppose my array is called histArray -LOL- and the student makes their first pick from the list.
That button will use the code   histArray.push(pick1);
Then we make sure that our variables in the SmartShape are setup as such.

item1=histArray[0];
item2=histArray[1];
item3=histArray[2];

As many as you need.

I think you will still be limited to a character length but at least they will show up in order.

I think I will do an extended example of this and post it in the eLearning Community for you to check out and see if this will work for you.

Likes

translate

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
New Here ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

Thanks. I look forward to reviewing your example. I've never used javascript within Captivate.  It sounds like that would do the trick as long as I can code it correctly. 🙂

Likes

translate

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
Advocate ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

My extended write up on this is now available here...

Response History With A Sorted Display - eLearning

Hopefully it is helpful.

Likes

translate

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
New Here ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

I think this is exactly what I am looking for... Thanks so much.  It may be next week before I can resume work on this project, but I will certainly follow up and let you know how it worked out (or if I have further questions). 

Thanks again to both Lilybiri and Stagprime .  You are both awesome!

Likes

translate

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
New Here ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

I have attempted to replicate what you have done but I'm unsuccessful. It may be that I don't know how to place the javascript in the appropriate window. Should I use current or parent?  Also, does formatting matter within the script window (indenting,etc.)?

Likes

translate

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
Advocate ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

Current is fine.

Indenting should not matter.

You would select the button on which to place the code.

Then for the onSuccess action choose Execute JavaScript.

just place the code in that little box.

If you tried to copy and paste - sometimes just the quotes need to be deleted and retyped in the box.

You will need to create the Captivate user variables to match.

Likes

translate

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
New Here ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

It was the quotes that were messing with me.  I appreciate your help. I will take what you've taught me and apply it to my project (manually typing and not copying & pasting).

Thanks again.

Likes

translate

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
Advocate ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

I have done something - I think is similar - in two different ways.

  1. I replicate my text box selection from "Slide A" where the user makes a choice to "Slide B" where they see the results. If the flag is tripped for the selection I reveal it on the results slide.
  2. I create a graphical representation of the choices that have been made and all of them are visible on the results page but the ones that were selected have full opacity while those that were not selected are made mostly transparent - again - based on whether or not the flag was tripped on the selection slide.

In my scenarios - it is correct to say that the variable is not set until it is selected. Default values are at 0 for unselected and when the choice is made - the variable is set to a value of 1.

Likes

translate

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
Advocate ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

Here is link to a post I made a while ago that demonstrates this to some extent.

It is a chat training where you make choices with people avatars - your choices are given to you in the form of the avatar chosen on the results slide.

You can then click on each avatar for additional feedback about the choice.

Maybe it will spark some ideas for you.

Training Supplement - eLearning

Likes

translate

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