View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
08512Bug reportsSurvey takingpublic2014-01-30 15:59
Reporterfinnnns Assigned Toc_schmitz  
PrioritynormalSeveritytweak 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary08512: Matrix question in dropdown presentation never shows "Please choose..."
Description

In matrix question with non mandatory and show no answer using the dropdown presentation two of the select tag's option tags get selected="selected" when there's an empty value.
Limesurvey can't differ whether it's a intentional "No answer" or not yet filled out, i.e. a "Please choose..." should be displayed.
In the PHP code the "if" statement are identical for both cases. It would be better to insert a "NANS" value for intentionally chosen "No answer".

Steps To Reproduce

Create a survey allowing Show [<< Prev] button
Insert two question groups
Insert a non mandatory Matrix question with dropdown presentation in the first question group, having subquestions and at least 2 answer options
Insert whatever question in the second question group

Test the survey. There will never be "Please choose..." in the pulldown menu
This is because both, "Please choose..." and "No answer" HTML option tag get selected="selected"

&lt;option value=&quot;&quot;  selected=&quot;selected&quot;>Please choose...&lt;/option>
&lt;option value=&quot;&quot;  selected=&quot;selected&quot;>No answer&lt;/option>
Additional Information

PHP code in application/helpers/qanda_helper.php code is

Libe 4842

        if (!isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] =='')
        {
            $answer .= &quot;\t&lt;option value=\&quot;\&quot; &quot;.SELECTED.'>'.$clang->gT('Please choose').&quot;...&lt;/option>\n&quot;;

Line 4856
// If not mandatory and showanswer, show no ans
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1)
{
$answer .= "\t<option value=\"\" ";
if (!isset($SESSION['survey'.Yii::app()->getConfig('surveyID')][$myfname]) || $SESSION['survey'.Yii::app()->getConfig('surveyID')][$myfname] == '')
{
$answer .= SELECTED;
}
$answer .= '>'.$clang->gT('No answer')."</option>\n";

You'll notice both if (!isset($SESSION['survey'.Yii::app()->getConfig('surveyID')][$myfname]) || $SESSION['survey'.Yii::app()->getConfig('surveyID')][$myfname] =='') statements are identical.

Somehow it would be better to give an explicit "NANS" code for "No answer" which would change the latter code to

        // If not mandatory and showanswer, show no ans
        if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1)
        {
            $answer .= &quot;\t&lt;option value=\&quot;NANS\&quot; &quot;;
            if (isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == 'NANS')
            {
                $answer .= SELECTED;
            }
            $answer .= '>'.$clang->gT('No answer').&quot;&lt;/option>\n&quot;;

I’m not sure about the implications this has on the statistical side of LimeSurvey. The “NANS” case should be handeled correctly there as well obviously.

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)2.05 131219
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmySQL 5.1.66 latest DB-Version
Server OS (if known)Debian GNU/Linux 6.0.7 (squeeze)
Webserver software & version (if known)Apache
PHP Version5.3.3-7+squeeze15

Relationships

related to 08631 closedc_schmitz Array/Matrix question in dropdown presentation does not show "Please choose..." anymore 

Users monitoring this issue

finnnns

Activities

DenisChenu

DenisChenu

2014-01-07 14:55

developer   ~27732

The last no answer are only here if user want to select 'no answer' after choose an answer.

Maybe we can remove it if Please choose is already here.
But a "NO ANSWER" still a no answer

(And all quand_helper have to rewritten for 2.1 version)

c_schmitz

c_schmitz

2014-01-17 14:11

administrator   ~27954

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=13704

c_schmitz

c_schmitz

2014-01-17 14:11

administrator   ~27955

Removed the obsolete 'Please choose' so the presentation matches the 'normal' version.

c_schmitz

c_schmitz

2014-01-25 17:22

administrator   ~28166

2.05+ Build 140125 released

Related Changesets

LimeSurvey: master 39b0f578

2014-01-17 13:11:23

c_schmitz

Details Diff
Fixed issue 08512: Matrix question in dropdown presentation shows obsolete "Please choose..." in dropdown Affected Issues
08512
mod - application/helpers/qanda_helper.php Diff File

Issue History

Date Modified Username Field Change
2014-01-07 09:42 finnnns New Issue
2014-01-07 09:42 finnnns File Added: limesurvey_survey_271923.lss
2014-01-07 14:55 DenisChenu Note Added: 27732
2014-01-07 16:48 finnnns Issue Monitored: finnnns
2014-01-17 14:09 c_schmitz Assigned To => c_schmitz
2014-01-17 14:09 c_schmitz Status new => assigned
2014-01-17 14:11 c_schmitz Changeset attached => LimeSurvey master 39b0f578
2014-01-17 14:11 c_schmitz Note Added: 27954
2014-01-17 14:11 c_schmitz Resolution open => fixed
2014-01-17 14:11 c_schmitz Note Added: 27955
2014-01-17 14:11 c_schmitz Status assigned => resolved
2014-01-17 14:11 c_schmitz Fixed in Version => 2.05+
2014-01-25 17:22 c_schmitz Note Added: 28166
2014-01-25 17:22 c_schmitz Status resolved => closed
2014-01-30 15:59 mfaber Relationship added related to 08631
2021-08-02 20:00 guest Bug heat 4 => 6