Welcome, Guest
Username: Password: Remember me

TOPIC: How can I set up this type of complicated/combined array question?

How can I set up this type of complicated/combined array question? 3 years 8 months ago #57485

  • chronb
  • chronb's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hi everyone,

LimeSurvey is fantastic and I am building a survey for the medical department. I am stuck at trying to figure out the best way to design one complicated question that looks like in the image attached.

Basically, I have 12 rows (e.g., location #1, #2, ... #12). 12 rows signifies the last 12 weeks. Each column has the following:

- location name
- province
- reason
- # of times in last 3 mo.
- duration (days)
- outside community/city

Now the tricky part is that each column has DIFFERENT drop downs as well as different data values. For example,

- location name = Calgary
- province = Alberta
- reason = Shopping
- # of times = 2
- duration = 3
- outside community/city = Yes

I can use an array type of question for ONE of the columns such as location name. However, how can I combine all of these in one big question without any javascript manipulation? Our medical staff would like to browse/edit the survey data (for qualitative checks) in Data Entry Screen mode and if my survey has javascript manipulation code, this code does NOT get reflected in the data entry screen mode -- only during the actual survey input. Basically, this is why it is preventing me from using any javascript manipulation as mentioned in the LimeSurvey documentation.

I am using the latest Version 1.91RC4 Build 9797.

Any ideas?

Thanks!
Attachments:
The administrator has disabled public write access.

Re: How can I set up this type of complicated/combined array question? 3 years 8 months ago #57489

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
Without any additional Javascript as described in the workarounds there is no way to create such a question type.
In general you can't mix question types at limesurvey because of the way data is stored at the DB. You have to live with the question types we offer at manual ->question types.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
The following user(s) said Thank You: chronb

Re: How can I set up this type of complicated/combined array question? 3 years 8 months ago #57496

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4360
  • Thank you received: 827
  • Karma: 381
How about creating several arrays and use CSS to display them side-by-side?

The following CSS places 4 arrays side-by-side and hides the question and subquestion text in all but the first array. (my question IDs are 500, 505, 510, 515 so you'll need to modify those numbers)

The styles in this example are for the default template in 1.91RC4.
/* Line the questions up side-by-side */
#question500,
#question505,
#question510,
#question515 {
	float: left;
}
#question500 {
	margin-left: 12.5%;
}
 
/* Push the question tables to full width */
#question500 .question-wrapper,
#question505 .question-wrapper,
#question510 .question-wrapper,
#question515 .question-wrapper {
    margin: 0 auto 10px 0;
    width: 100%;
}
 
/* Lose some padding... */
#question500 .question-wrapper td,
#question505 .question-wrapper td ,
#question510 .question-wrapper td,
#question515 .question-wrapper td{
   padding: 0.5em 0;
}
 
/* but we still want some padding on the left and right of the group */
#question500 .question-wrapper td {
   padding-left: 1em ;
}
#question515 .question-wrapper td {
   padding-right: 1em ;
}
 
/* Set the width of the subquestion cells in the first array... */
#question500 table.question tbody th {
	width: auto;
}
 
/* and hide the subquestion cells in subsequent arrays */
#question505 table.question tbody th,
#question510 table.question tbody th,
#question515 table.question tbody th {
	display: none;
}
 
/* Hide the question text in all but the first array */
#question505 td.questiontext,
#question510 td.questiontext,
#question515 td.questiontext {
	color: #EEF6FF;
}


Untitled-2_2011-02-24.png
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 3 years 8 months ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: chronb

Re: How can I set up this type of complicated/combined array question? 3 years 8 months ago #57498

  • chronb
  • chronb's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Excellent suggestion and thanks for the code sample!

I will give this a shot using the CSS method. The only drawback is that, during data entry screen mode, the users will see a lot more arrays than they are used to. As Mazi mentioned earlier, I guess it's something that we all have to live with due to the way the data is stored in the database.

I appreciate your help! Back to the survey design now... :-)
The administrator has disabled public write access.

Re: How can I set up this type of complicated/combined array question? 1 year 11 months ago #89013

  • damien
  • damien's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 1
here is my solution:in this thread

Result:



In short, I use javascript to glue multiple array together
Last Edit: 1 year 11 months ago by damien.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.132 seconds
Donation Image