Skip to main content
Inspiring
March 26, 2015
Answered

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

  • March 26, 2015
  • 1 reply
  • 3378 views

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'

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:


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

This topic has been closed for replies.
Correct answer Lilybiri

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


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



1 reply

TLCMediaDesign
Inspiring
March 26, 2015

Add another expression... allQuestions = L1_1and2 + question3

avary_sAuthor
Inspiring
March 26, 2015

I tried this but couldn't get it working:

Is that what you mean?

TLCMediaDesign
Inspiring
March 26, 2015

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