Welcome, Guest
Username: Password: Remember me

TOPIC: Assessments with Array Questions

Assessments with Array Questions 2 years 11 months ago #84440

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?
The administrator has disabled public write access.

Assessments with Array Questions 2 years 10 months ago #85260

Can anyone help? I simply need to store the assessment values of an array in the database.
The administrator has disabled public write access.

Assessments with Array Questions 2 years 10 months ago #85265

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 83
  • Karma: 37
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.
The administrator has disabled public write access.

Assessments with Array Questions 2 years 10 months ago #85266

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:
The administrator has disabled public write access.

Assessments with Array Questions 2 years 10 months ago #85267

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 83
  • Karma: 37
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.
The administrator has disabled public write access.

Assessments with Array Questions 2 years 10 months ago #85268

Thank you! That worked. Haha I should have just updated earlier...
The administrator has disabled public write access.

Assessments with Array Questions 2 years 8 months ago #87926

  • gapps
  • gapps's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
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
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.312 seconds