Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: 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 Jahre 6 Monate her #57485

  • chronb
  • chronbs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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!
Anhang:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: How can I set up this type of complicated/combined array question? 3 Jahre 6 Monate her #57489

  • Mazi
  • Mazis Avatar
  • ONLINE
  • LimeSurvey Team
  • Beiträge: 5324
  • Dank erhalten: 294
  • Karma: 249
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'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: chronb

Re: How can I set up this type of complicated/combined array question? 3 Jahre 6 Monate her #57496

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4141
  • Dank erhalten: 768
  • Karma: 349
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.
Letzte Änderung: 3 Jahre 6 Monate her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: chronb

Re: How can I set up this type of complicated/combined array question? 3 Jahre 6 Monate her #57498

  • chronb
  • chronbs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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... :-)
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: How can I set up this type of complicated/combined array question? 1 Jahr 9 Monate her #89013

  • damien
  • damiens Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 7
  • Karma: 1
here is my solution:in this thread

Result:



In short, I use javascript to glue multiple array together
Letzte Änderung: 1 Jahr 9 Monate her von damien.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.159 Sekunden
Donation Image