• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Can I combine three variables using the Expression action in Advanced Actions?

Explorer ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

I have an assessment (contains 9 questions) in my project that contains 3 lessons. Each question relates to a specific lesson. On my Quiz results slide, instead of displaying the total score for the entire assessment, I want to break the score out into lessons so that the learner knows which lessons require additional study. I have created a variable to hold the points scored on each question, and assigning the points to that variable using 'QuizInfoLastPointsScored'

Screen Shot 2015-03-26 at 11.53.18 AM.png

I know which questions relate to which lesson:

Lesson 1: questions 1-3

Lesson 2: questions 4-6

Lesson 3: questions 7-9


However, I do not know how to add 3 variables together to get the combined total for that lesson. The 'Expression' action only allows me to combine 2 variables:

Screen Shot 2015-03-26 at 11.58.09 AM.png

How do I add a third variable into the 'Expression' action?

Views

1.9K

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

Community Expert , Mar 31, 2015 Mar 31, 2015

I thought you did need three totals: one global and two partial totals. This last one will not calculate the partial totals. There is no need whatsoever to put first the score in a separate variable at all. I only used variables for the three totals. You will only calculate the global total, and that could be with one statement, no need for two at all:

 

Expression v_total = v_total + cpQuizInfoLastSlidePointScored



Votes

Translate

Translate
People's Champ ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

Add another expression... allQuestions = L1_1and2 + question3

Votes

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
Explorer ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

I tried this but couldn't get it working:

Screen Shot 2015-03-26 at 1.08.45 PM.png

Is that what you mean?

Votes

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
People's Champ ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

Yes, what is the result? How are you populating the question# variables?

Votes

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
Explorer ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

Screen Shot 2015-03-26 at 1.35.07 PM.png

Votes

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
People's Champ ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

What is the result that is showing?

Votes

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
Explorer ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

Nothing just blank

Screen Shot 2015-03-26 at 2.47.03 PM.png

Votes

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
People's Champ ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

How are you triggering the advanced actions?

Votes

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
Community Expert ,
Mar 27, 2015 Mar 27, 2015

Copy link to clipboard

Copied

Each advanced/shared action needs an event to trigger. In this case I would use the On Enter event of the Score slide.

However: since Accuracy is showing 0%, which is a quizzing system variable, cpInfoPercentage, that is calculated from the system variable cpQuizInfoPointsscored and the maximum possible score cpQuizInfoTotalQuizPoints, it looks like you never answered any question correctly? That means that after each question the var cpQuizInfoLastSlidePointScored was zero, and there is nothing added to the user variables that "LessonXTotal". Zero is interpreted by CP as empty...hence nothing can show up in those user variables. Or did you change the field after Accuracy?

Have a look at:

Intermediate Score Slides - Captivate blog

System variables in Captivate 8 - Captivate blog

Events and (advanced) Actions - Captivate blog

Votes

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
Explorer ,
Mar 27, 2015 Mar 27, 2015

Copy link to clipboard

Copied

Unfortunately when I do get answers correct the total still shows as blank:

Screen Shot 2015-03-27 at 2.26.40 PM.png

It appears that my question points variable is being tracked correctly; however, the expression is not adding the two variables together.

Votes

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
People's Champ ,
Mar 27, 2015 Mar 27, 2015

Copy link to clipboard

Copied

I think your issue is that the variable gets reset very quickly and you can't capture it. I know in CP7 and swf it was all but impossile to use the cpQuizInfoLastSlidePointScored.

Are you using SWF or HTML5 or both?

I think it's possible to set up variable change listeners to write the responses to an array and get the info you need.

Votes

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
Explorer ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

SWF only

On Fri, Mar 27, 2015 at 9:02 PM, TLCMediaDesign <forums_noreply@adobe.com>

Votes

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
People's Champ ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

Like Lieve asked can you tell us how you are triggering the action to put the cpQuizInfoLastSlidePointScored into your custom variable?

Votes

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
Community Expert ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

David,  used to be ignored totally for some reason. He never answered my questions.

Votes

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
Explorer ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

Sorry about that! I've been out of town for the weekend...I have a deadline on another project this morning but after that I will take more screenshots and explain my workflow. Sorry again not trying to ignore you!

Votes

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
Explorer ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

Hi there, sorry again for the delayed response, I appreciate both of your help on this issue!

After each of the question slides in my assessment, I have a blank slide with a short duration that saves the points scored on the previous question to a variable:

Screen Shot 2015-03-30 at 1.21.39 PM.png

I set the 'On Enter' action of my Quiz Results slide to combine the variables for question 1 & 2, and then a second variable for question 3 & 4. In the third expression, I add these two variables together to get a 'Lesson Total' score:

Screen Shot 2015-03-30 at 1.22.00 PM.png

On my Quiz Results slide I display all the variables to see if my actions are set up correctly:

Screen Shot 2015-03-30 at 1.25.21 PM.png

What I found is that my 'points scored per question' variables are working correctly; however, the other variables are not. Please let me know if I can provide any additional information that would be helpful!

Votes

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
People's Champ ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

I don't see what is wrong. I set one up and it works for me.

Votes

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
Explorer ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

darn.... ok thanks, I guess I can try creating a new project and starting again to see if it's something wrong with the project.

Votes

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
People's Champ ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

I'd try a simple project with just the quiz slide and keep adding to it for testing before you bail on your current project.

Votes

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
Explorer ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

Good idea. Thanks again, it helps to know that the actions are set

correctly!

On Mon, Mar 30, 2015 at 2:23 PM, TLCMediaDesign <forums_noreply@adobe.com>

Votes

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
Community Expert ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

You do create much more variables then needed IMO and that will increment the risk of having the same label used for something else. Captivate doesn't like when a label has been used twice, even for totally different object/decisions/variables/actions.

I would have used one variable v_first for the first total score, a second one v_second for the second total score and a last one for the great total v_total

No need for those extra short slides, just fire the advanced (or better shared action) On Enter of the next question slide:

     Expression v_first = v_first + cpQuizInfoLastSlidePointScored

     Expression v_total = v_total + cpQuizInfoLastSlidePointScored

     Continue

If you use a shared action, create only a parameter for v_first, you can replace it by v_second for the two other questions.

You probably will need to run this action a last time on Enter of the Score slide, no need to total here, since the 3 variables will have the correct score.

By using an identifying character at the beginning of a name, the bad chance to have a duplicate name will be a lot less.

Votes

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
Explorer ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

Thanks! I'm having a hard time implementing this... did you say you have a blog post I can reference that does something similar?

Votes

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
Community Expert ,
Mar 30, 2015 Mar 30, 2015

Copy link to clipboard

Copied

Not for CP8, pointed you already to Intermediate Score Slides - Captivate blog

Now in CP8 I would definitely choose for shared actions. Parameters in Shared Actions - Captivate 7 vs. 8 - Captivate blog

Votes

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
Explorer ,
Mar 31, 2015 Mar 31, 2015

Copy link to clipboard

Copied

Ok thanks, after reviewing this I got another idea ... wouldn't something simple like this do the job?

Screen Shot 2015-03-31 at 8.37.16 AM.png

Votes

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
Community Expert ,
Mar 31, 2015 Mar 31, 2015

Copy link to clipboard

Copied

I thought you did need three totals: one global and two partial totals. This last one will not calculate the partial totals. There is no need whatsoever to put first the score in a separate variable at all. I only used variables for the three totals. You will only calculate the global total, and that could be with one statement, no need for two at all:

 

Expression v_total = v_total + cpQuizInfoLastSlidePointScored



Votes

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
Resources
Help resources