Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How to simplify data entry in a question that is an array of numbers

  • hafmili
  • hafmili's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 weeks 1 day ago #270680 by hafmili
I am an educator. I am using Limesurvey Cloud Version 6.14.2, to survey students about a new course that we offered in the last semester. I go over each major topic, and for each topic, I ask the students about the subtopics that were supposed to be covered: 1) what was their competency level at the start of the course (from 0 to 5), 2) competency level at end of course (from 0 to 5), 3) how much class time the instructor spent covering the topic (0 for NONE, 5 for too much time), and 4) level of complexity of material presented (from too basic (0) to too advanced (5)).

Naturally, I am using an Array of numbers. The Y axis corresponds to the various subtopics, and the X axis corresponds to the four aspects mentioned above (competency level at beginning of course, competency level at end of course, class time spent on the topic, and level of complexity).

What I want to do: if the instructor did NOT cover the subtopic, they can just enter 0 for the corresponding X-question (third one), and not bother with the other.

I tried the following "Question validation equation", and it did not do the trick

(!is_empty(G02Q01_YQ001_XQ003.NAOK) and (intval(G02Q01_YQ001_XQ003.NAOK)==0) and is_empty(G02Q01_YQ001_XQ001.NAOK) and is_empty(G02Q01_YQ001_XQ002.NAOK) and is_empty(G02Q01_YQ001_XQ004.NAOK)) or ((intval(G02Q01_YQ001_XQ003) > 0) and !is_empty(G02Q01_YQ001_XQ001.NAOK) and !is_empty(G02Q01_YQ001_XQ002.NAOK) and !is_empty(G02Q01_YQ001_XQ004.NAOK))

In the following screen shot, I want to the first and second row to pass, and the third one to fail.

Ideally, I would like this to work. Alternatively, I could set all the initial array values to 0, that way students can skip a topic if it has not been covered. The posts of this forum provided an equation to enter in the "equation question". Where is that specified? I browsed the various question facets (general settings, logic, display, etc.) and I could not find it.
 

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 weeks 20 hours ago #270681 by tpartner
Joffm will probably be more clever, but maybe something like this (line-breaks inserted for clarity)

Code:
(G02Q01_YQ001_XQ003.NAOK == 0 
AND 
count(that.G02Q01_YQ001.NAOK) == 1)
 
OR
 
(G02Q01_YQ001_XQ003.NAOK > 0 
AND 
count(that.G02Q01_YQ001.NAOK) == 4)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 weeks 15 hours ago #270682 by Joffm
Hi,

Joffm will probably be more clever

Oh, no, I'm not.

But some remarks.
In your screenshot the question is mandatory.
You know, this way you can't set it to "mandatory"; some cells are not answered.
But the validation Tony showed forces that each row id answered.

Two more proposals to make it a bit less confusing for the respondent.

1. First ask which sub themes were covered, then ask only about these. Use array filter.
Now the question can be mandatory, because column 3 can not be NONE.


2. And a second way:
Use an array(text) with inserted drop-downs.
This way you can display better scales than to have to explain them in the header.
 
Make columns 1, 2 and 4 depended on column 3.
If column 3 is NONE the other columns are set to empty and disabled.
But again this question can't be mandatory. But you know that column 3 has to be answered.
So it is suficient to validate that column3 is answered for all sub themes, like count(self.sq_X003)==3 (number of sub themes)
 


By the way

The posts of this forum provided an equation to enter in the "equation question". Where is that specified? I browsed the various question facets (general settings, logic, display, etc.) and I could not find it.

An "equation question" is a question of type "equation".
But in this case I am sure that there was the mention of a "question validation equation".
This you find in the settings "Logic"

Now it's up to you to decide what to do.

If there are further questions, please provide a lss export of this aprt of the survey.

And I wonder why you ignored and removed the questions that appeared when you started this thread.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: hafmili

Please Log in to join the conversation.

  • hafmili
  • hafmili's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 6 days ago #270700 by hafmili
Friends,

Thank you both, specially joffm for all the effort put in the answer.

I am adopting the first approach

I looked up array filters, and imported the sample question group called limesurvey_group_32.lsg, and tried to "reproduce the structure" (modulo the difference in question types) in my own question.

My "problem" is that it does not seem to work as expected:
1) before I select any subtopic, the array for the second question is displayed, but with empty labels
2) I had to "program" the labels for the array with ugly expressions like : {if (G02Q00_SQ002, "Classes, héritage et polymorphisme","")} (couldn't find a way to refer to the labels of multiple choice questions)
3) an empty row is still flagged as an error.

I exported and attached the question group,

Thanks a million for your help, which is priceless ;-)

Hafedh



 

Please Log in to join the conversation.

  • hafmili
  • hafmili's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 6 days ago #270701 by hafmili
I did find the solution to this ugliness:

{if (G02Q00_SQ002, "Classes, héritage et polymorphisme","")} (couldn't find a way to refer to the labels of multiple choice questions)

replacing it by

{if (G02Q00_SQ002, G02Q00_SQ002.question,"")}

instead

The other problems still stand (making only the rows corresponding to the selected subtopics appear)

Please Log in to join the conversation.

  • hafmili
  • hafmili's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 6 days ago #270702 by hafmili
Friends,

I did solve the remaining problems by using "Relevance Equations" for the Y-axis sub equations (subtopics). Now it behaves correctly: either a subtopic appears, in which case all cells of the row need to be filled, or it does not appear. And I made the question mandatory.

If you can think of better/more elegant ways, I am "all ears", but the urgency has passed: I can complete the survey, and start harassing the students :-)

Thank you for putting me on the right track.

Hafedh

Please Log in to join the conversation.

  • hafmili
  • hafmili's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 6 days ago #270703 by hafmili
forgot to attach the screenshot that shows the relevance equations

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 6 days ago #270705 by Joffm
Obviously you did not fully understand the "array filter".
As I see in your screenshot you did not follow the instructions in the manual.  
In the first (multiple) questions the subquestions are coded "SQ001", "SQ002", ...
But in the array the codes are "YQ001", "YQ002", ...
Please read this (and study the included sample survey)
[url] www.limesurvey.org/manual/Question_type_...ilter_(array_filter) [/url]

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • hafmili
  • hafmili's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 5 days ago #270726 by hafmili
Hello Joffm,

Thanks for the feedback. I figured that the array filter was not working, but wasn't sure how to fix.

The difference between the sample provided by the documentation and my situation is that the first question, in the sample, uses text answers, and the second question (array question) uses those answers.

In my situation, the subtopics are question labels and not answers (the answer is a boolean).

Here is my latest for a different question group, and it is working without relevance equation, but I still need to specify the label of the Y-question from the answers to the first (multiple selection) question (G04Q00).

Am I still getting it wrong?

Hafedh

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 5 days ago #270727 by Joffm

but I still need to specify the label of the Y-question from the answers to the first (multiple selection) question (G04Q00).

Of course, what did you expect?
By this you are very flexible - you can use them, but you may use quite different options (that depend on the previous question).
But instead of using the property ".question" you'd better copy the verbatims.
See what you get when you export your data.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose