Welcome, Guest
Username: Password: Remember me

TOPIC: Question type: Array by column

Question type: Array by column 4 years 4 days ago #50925

  • kh1
  • kh1's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hi,
I have a specific question type I need to create, and have tried all of the question types available, but none fit the format I need.

I essentially need the basic 10 point array, but I need to divide the numbers by column (D-A). The number 1 would be in column D (which would have a description), 2,3,and 4 in C, etc.

D C B A
not done better good long text description

1. Goals met? 1 2 3 4 5 6 7 8 9 10


I am replicating a previous survey, so I need the structure to remain the same.

Any suggestions would be greatly appreciated.

Thanks!

File Attachment:

File Name: limesurvey-20101019.doc
File Size: 133120
The administrator has disabled public write access.

Re:Question type: Array by column 4 years 4 days ago #50926

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2851
  • Thank you received: 359
  • Karma: 124
Hi,

This previous survey wasn't done with Limesurvey, correct?

I don't see a chance to do this with the standard features of Limesurvey. Maybe Tpartner finds a solution via Javascript.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Question type: Array by column 4 years 4 days ago #50934

  • Mazi
  • Mazi's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
This can only be done by changing the question styles by using some specific Javascript.
User "tpartner" is our JS expert, he also offers advanced, paid support if this is a must have feature you need.

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.

Re:Question type: Array by column 4 years 2 days ago #51101

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
This isn't too difficult.

Set up your survey to use JavaScript and place the following script in the source of your array-10-point question. Replace "QQ" (line 5) with the ID of the array-10-point and modify the text in line 7 as required.

The script will insert a new row above the headers and apply some classes to elements so we can style them with CSS.
<script type="text/javascript" charset="utf-8">
 
    $(document).ready(function(){
 
        var qID = QQ;
 
        var newRow = '<tr><td>Characteristic</td><td><u>D</u><br /><br />...does not occur</td><td colspan="3"><u>C</u><br /><br />...occurs...</td><td colspan="3"><u>B</u><br /><br />...plan is...</td><td colspan="3"><u>A (= all of B plus these)</u><br /><br />...is documented...</td></tr>';
 
        $('#question'+qID+'').addClass('modifiedArray');
        $('#question'+qID+' table.question thead').prepend(newRow);
 
 
        $('#question'+qID+' table.question thead tr:eq(0)').addClass('arrHeaders');
        $('#question'+qID+' table.question thead tr:eq(1)').addClass('arrSubHeaders');
 
        $('#question'+qID+' table.question tr.arrHeaders td:eq(0)').addClass('firstCell');
        $('#question'+qID+' table.question tr.arrSubHeaders th:eq(0)').addClass('firstCell');
 
    });
 
</script>
Then add the following to the end of template.css and modify as required:
.modifiedArray table.question {
    border-spacing: 0;
    border-collapse: collapse;
}
 
.modifiedArray table.question th,
.modifiedArray table.question td {
    border: 1px solid #999999;
}
 
.arrHeaders th,
.arrHeaders td {
    text-align: center;
    color: #000000;
}
 
.modifiedArray table.question .arrHeaders .firstCell {
    border-bottom: 0 none;
}
 
.modifiedArray table.question .arrSubHeaders .firstCell {
    border-top: 0 none;
}
The result should be:
Untitled_1-20101021.gif
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: 4 years 2 days ago by tpartner.
The administrator has disabled public write access.

Re:Question type: Array by column 4 years 1 day ago #51134

  • kh1
  • kh1's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Many thanks! I'll give that a try
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.224 seconds
Donation Image