Assessments with Array Questions

More
4 years 11 months ago #84440 by FreedomTrip
FreedomTrip created the topic: Assessments with Array Questions
This seems like a straightforward task, but I can't seem to get assessments working with Array questions.

How do I grab the assessment value from arrays/subquestions?
How would I specify array subquestions in the Expression Manager?

Please Log in to join the conversation.

More
4 years 10 months ago #85260 by FreedomTrip
FreedomTrip replied the topic: Assessments with Array Questions
Can anyone help? I simply need to store the assessment values of an array in the database.

Please Log in to join the conversation.

More
4 years 10 months ago #85265 by TMSWhite
TMSWhite replied the topic: Assessments with Array Questions
I'm assuming you are using assessment mode, so you have a code and an assessment value for each sub-question.

If so, and say your question is "q1", you would store the assessment value for an array by creating a new Equation question (let's call it q1score) with the following value in the question field:
{sum(that.q1.value)}

This will auto-expand when you use Show Logic File to something like:
{sum(q1_A_1.value, q1_A_2.value, ..., q1_B_1.value, ... q1_N_9.value)}

and thus will compute the sum of all of the selected (or entered if using text fields) items within the array.

Please Log in to join the conversation.

More
4 years 10 months ago #85266 by FreedomTrip
FreedomTrip replied the topic: Assessments with Array Questions
Thanks for the prompt reply!

This should definitely be doing the trick, but it's not functioning. It's as if LS isn't recognizing any expressions...it's red-highlighting "that" and "value" saying they're unrecognized.
I'm running 1.92+, so I'd expect expressions to be working fine. Any ideas?
Attachments:

Please Log in to join the conversation.

More
4 years 10 months ago #85267 by TMSWhite
TMSWhite replied the topic: Assessments with Array Questions
The 'self', and 'that' variables were added in late July or early August, so your 1.92+ release may not contain it.

You can either upgrade to the latest 1.92+ release, or manually spell out the equation, including all of the sub-question variable names like this:
{sum(q1_A_1.value, q1_A_2.value, ..., q1_B_1.value, ... q1_N_9.value)}

but without the ellipses.

Please Log in to join the conversation.

More
4 years 10 months ago #85268 by FreedomTrip
FreedomTrip replied the topic: Assessments with Array Questions
Thank you! That worked. Haha I should have just updated earlier...

Please Log in to join the conversation.

More
4 years 8 months ago #87926 by drjohnkenworthy
drjohnkenworthy replied the topic: Assessments with Array Questions
Thanks for this (I think)
I'm trying to get the values from an array choice. Which appears to be working with this. However, how do I show the result?
I've tried so many ways but the result doesn't come up.

In essence, what I am trying to do:
Users choose a radio button from an array per (sub)question
I want to value these (as assessment mode does) but I want to, for example: Q1_3+Q1_7+Q3_9...+Q7_2

At the end I want to show the results of each calculation - for 'instant' results.

How do I:
Get the values from the array?
Store the calculated totals?
Show the totals calculated on a results page?

Any assistance much appreciated before I tear my hair out

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now