View Issue Details

This issue affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
03805Bug reportsTheme editorpublic2009-12-11 12:17
Reporterdynia Assigned Totpartner  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.86 
Summary03805: Assignment of class atributes to <td> tags in dual-scale questions
Description

In dual-scale array questions unlike in other array questions (where class="answer_cell_xxx" are used) no class atributes are assigned to <td> tags containing answers' fields to be chosen. It makes imposible any change in a way such questions are shown (particularly by editing template's .css file).

It may be seen rather as a feature request but I see it as a bug.

Steps To Reproduce

http://ideas.limesurvey.org/ideatorrent/idea/36/

Additional Information

I'm using LimeService.

TagsNo tags attached.
Attached Files
Bug heat10
Complete LimeSurvey version number (& build)1.86
I will donate to the project if issue is resolved
Browser
Database type & version?
Server OS (if known)?
Webserver software & version (if known)?
PHP Version?
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

user372

2009-10-31 00:11

  ~09927

@ dynia: can you provide a patch, which contains this class attributes and is tested on the most used browsers (IE6, IE7, IE8, FF2, FF3, Chrome, Safari)?

dynia

dynia

2009-10-31 10:25

reporter   ~09928

Last edited: 2009-10-31 10:27

Maybe I chose "Templates" as a category may be confusing.

Problem concerns PHP code responsible for preparing HTML code of dual-scale array questions. It doesn't do one thing that code preparing "simple" array questions does - table cells tags in question table of "simple" array questions looks like: <td class="some_class_name"> while in dual-scale array questions like: <td> and that is the problem.

The problem isn't browser-specific because having class attribute (<td class="class_name">) is interpreted in the same way by all browsers (excluding such rare and specific ones, like text browsers) - it simply allows you to change a way the tag content is shown by assigning css styles (in a manner: .class_name {styles_assigned}) but don't make any assumptions what styles would be assigned (what could be browser-specific).

Problem requires adding few (I think) lines of PHP code in a part responsible for preparing HTML code of dual-scale questions (to make its HTML output similar to those of "simple" array questions with concern to assigning class atributes to <td> tags).

I think a person more familiar with Lime's source code would be able to do it much faster and with much less effort than when I would try to do so.

Mazi

Mazi

2009-10-31 11:15

updater   ~09930

dynia, the code to display questions can be found in qanda.php. Each question has a function "do_questiontype()" where you can change this. Just give it a try if possible.

dynia

dynia

2009-10-31 13:05

reporter   ~09931

O.K. I'll try.

dynia

dynia

2009-10-31 15:45

reporter   ~09932

Last edited: 2009-10-31 15:46

Here it is (qanda-build7697-20090930-dual_scale_class_patch.php). I added a little into lines 6017, 6035 and 6043:

6017 '$answer .= "\t\t\t<td>\n"'
into '$answer .= "\t\t\t<td class=\"answer_cell_00$ld\">\n"'

6043 - just like 6017; it's analogous to code in line 4988 (function do_array_flexible() );

6035 '$answer .= "\t\t\t<td> </td>\n";'
into '$answer .= "\t\t\t<td class=\"dual_scale_separator\"> </td>\n";'

I didn't test it, because at that moment I've got no Limesurvey I can change something to (using Limeservice - my home server failed to cooperate with Lime :( ). Though I think it should work properly, because changes are very minor.

user372

2009-11-02 08:23

  ~09946

@ Evan: please review the posted modifications - Thx!

dynia

dynia

2009-11-05 17:59

reporter   ~09978

Any progress?

tpartner

tpartner

2009-11-07 00:11

partner   ~09984

I've added class attributes to the answer <td> elements of all array question types except Array-Flexible-Labels (that type was already done).

The result for non-dual-scale types will be something like:
<td class="answer_cell_001">

For dual scale something like:
<td class="answer_cell_1_001">
OR:
<td class="answer_cell_2_001">

dynia, I think this will give the flexibility you require.

ElMatador69, the fix was checked in at revision: 7843

dynia

dynia

2009-11-07 10:18

reporter   ~09985

Great! That is it.

Only one question to be sure. Will the "separator" cell in dual-scale question have it's own class too? (Asking because You didn't mention about it - but it would be nice to can manage this cell view also)

dynia

dynia

2009-11-07 10:21

reporter   ~09986

Is it possible this fix be contained in 1.87 release?

tpartner

tpartner

2009-11-07 12:21

partner   ~09987

Yup, the separator cell will be:
<td class="dual_scale_separator"> </td>

I would imagine the fix will be in 1.87 but ElMatador69 would have to answer that for sure.

In the meantime, this workaround may be of use:
http://docs.limesurvey.org/tiki-index.php?page=Workarounds&structure=English+Instructions+for+LimeSurvey#Variable_column_widths_in_array

c_schmitz

c_schmitz

2009-11-15 22:15

administrator   ~10112

Hi Tony,
I checked the CSS and found that the header of the 2nd scale table still has the class 'array1'. Can you take another look at it, please?
Great work, anyway.

Thank you!

tpartner

tpartner

2009-11-16 03:10

partner   ~10114

Hi Carsten,

My understanding is that the classes .array1 and .array2 are applied to the rows to give them alternating backgrounds, not columns.

This fix applies different classes to the columns in the <tbody> to facilitate styling.

So, unless I'm missing something, the <thead> row should have the class .array1.

tpartner

tpartner

2009-12-03 14:24

partner   ~10420

Fixed in version 7843.

Issue History

Date Modified Username Field Change
2009-10-31 00:07 dynia New Issue
2009-10-31 00:07 dynia Status new => assigned
2009-10-31 00:07 dynia Assigned To => user372
2009-10-31 00:07 dynia LimeSurvey build number => 1.86
2009-10-31 00:07 dynia Database & DB-Version => ?
2009-10-31 00:07 dynia Operating System (Server) => ?
2009-10-31 00:07 dynia Webserver => ?
2009-10-31 00:07 dynia PHP Version => ?
2009-10-31 00:11 user372 Note Added: 09927
2009-10-31 00:13 user372 Status assigned => feedback
2009-10-31 10:25 dynia Note Added: 09928
2009-10-31 10:26 dynia Note Edited: 09928
2009-10-31 10:27 dynia Note Edited: 09928
2009-10-31 11:15 Mazi Note Added: 09930
2009-10-31 13:05 dynia Note Added: 09931
2009-10-31 15:31 dynia File Added: qanda-build7697-20090930-dual_scale_class_patch.php
2009-10-31 15:45 dynia Note Added: 09932
2009-10-31 15:46 dynia Note Edited: 09932
2009-11-02 08:23 user372 Note Added: 09946
2009-11-02 08:23 user372 Status feedback => assigned
2009-11-02 08:23 user372 Assigned To user372 => Evan
2009-11-05 17:59 dynia Note Added: 09978
2009-11-05 20:00 user372 Assigned To Evan => tpartner
2009-11-07 00:11 tpartner Note Added: 09984
2009-11-07 10:18 dynia Note Added: 09985
2009-11-07 10:21 dynia Note Added: 09986
2009-11-07 12:21 tpartner Note Added: 09987
2009-11-15 22:14 user372 Summary Assignment of class atributes to <td> tags in dual-scale questions => Assignment of class atributes to <td> tags in dual-scale questions
2009-11-15 22:14 user372 Description Updated
2009-11-15 22:14 user372 Steps to Reproduce Updated
2009-11-15 22:15 c_schmitz Note Added: 10112
2009-11-16 03:10 tpartner Note Added: 10114
2009-12-03 14:24 tpartner Note Added: 10420
2009-12-03 14:24 tpartner Status assigned => resolved
2009-12-03 14:24 tpartner Resolution open => fixed
2009-12-11 12:17 c_schmitz Status resolved => closed
2015-12-11 14:40 c_schmitz Category Templates => Theme editor