View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
03830Bug reportsStatisticspublic2009-11-11 22:57
ReporterJeP Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.86 
Fixed in Version1.87RC1 
Summary03830: Browse detailed answer, question Type 1 -> wrong values in screen
Description

(don't know if Category is Statistics or Survey in runtime, sorry...)
(I'm french, sorry for my english :) )

How to reproduce :

  • create a survey with one question "Type 1" with 2 labels, 2 items each, and 2 answers :
    label 1 = "label1, item 1" and "label1, item 2"
    label 2 = "label2, item 1" and "label2, item 2"
    and
    "answer 1" and "answer 2"

  • Test with values : see "Survey Test and values.png"

->> Result in browse in detail (subaction=id) : see "Survey Results wrong.png"

Additional Information

See in common.php/getextendedanswer() :
...
case "1":
$query = "SELECT title FROM ".db_table_name('labels')." WHERE ((lid=$this_lid) OR (lid=$this_lid1)) AND code='".$connect->escape($value)."' AND language='".$s_lang."'";
$result = db_execute_assoc($query) or safe_die ("Couldn't get answer type F/H - getextendedanswer() in common.php"); //Checked
while($row=$result->FetchRow())
{
$this_answer=$row['title'];
} // while
if ($value == "-oth-")
{
$this_answer=$clang->gT("Other");
}
break;
...

the "$this_answer=$row['title'];" line gives always the last value, and the # part of $fieldcode is never used.

I change this function : see "common-New.php"
My contribution.

TagsNo tags attached.
Attached Files
Survey Test and values.png (4,563 bytes)   
Survey Test and values.png (4,563 bytes)   
Survey Results wrong.png (3,895 bytes)   
Survey Results wrong.png (3,895 bytes)   
common-NEW.php (247,962 bytes)
Survey.png (4,602 bytes)   
Survey.png (4,602 bytes)   
Response.png (11,758 bytes)   
Response.png (11,758 bytes)   
limesurvey_survey_46284.csv (4,619 bytes)   
# LimeSurvey Survey Dump
# DBVersion 141
# This is a dumped survey from the LimeSurvey Script
# http://www.limesurvey.org/
# Do not change this header!

#
# SURVEYS TABLE
#
"sid","owner_id","admin","active","expires","startdate","adminemail","private","faxto","format","template","language","additional_languages","datestamp","usecookie","notification","allowregister","allowsave","autonumber_start","autoredirect","allowprev","printanswers","ipaddr","refurl","datecreated","publicstatistics","publicgraphs","listpublic","htmlemail","tokenanswerspersistence","assessments","usecaptcha","usetokens","bounce_email","attributedescriptions","emailresponseto","tokenlength"
"46284","1","Mag. Josef Prandstetter","Y","","","josef.prandstetter@limesurvey.org","Y","","G","bluengrey","en","","N","N","0","N","Y","0","N","Y","N","N","N","2009-11-11","N","N","N","Y","N","N","D","N","josef.prandstetter@limesurvey.org","","","0"

#
# GROUPS TABLE
#
"gid","sid","group_name","group_order","description","language"
"549","46284","Group1","0","","en"

#
# QUESTIONS TABLE
#
"qid","sid","gid","type","title","question","preg","help","other","mandatory","lid","lid1","question_order","language"
"3205","46284","549","1","Q1","Please choose something and remember your choice!<br />","","","N","Y","295","296","0","en"

#
# ANSWERS TABLE
#
"qid","code","answer","default_value","assessment_value","sortorder","language"
"3205","A1","Answer 1","N","0","1","en"
"3205","A2","Answer 2","N","0","2","en"

#
# CONDITIONS TABLE
#

#
# LABELSETS TABLE
#
"lid","label_name","languages"
"295","Labelset 1","en"
"296","Labelset 2","en"

#
# LABELS TABLE
#
"lid","code","title","sortorder","language","assessment_value"
"295","L1I1","Labelset 1 - Item 1","0","en","0"
"295","L1I2","Labelset 1 - Item 2","1","en","0"
"296","L2I1","Labelset 2 - Item 1","0","en","0"
"296","L2I2","Labelset 2 - Item 2","1","en","0"

#
# QUESTION_ATTRIBUTES TABLE
#
"qaid","qid","attribute","value"
"2378","3205","dualscale_headerA",""
"2377","3205","dropdown_separators",""
"2376","3205","dropdown_prepostfix",""
"2375","3205","array_filter",""
"2374","3205","answer_width",""
"2385","3205","scale_export","0"
"2384","3205","use_dropdown","0"
"2383","3205","random_order","0"
"2382","3205","public_statistics","0"
"2381","3205","page_break","0"
"2380","3205","hidden","0"
"2379","3205","dualscale_headerB",""

#
# ASSESSMENTS TABLE
#

#
# SURVEYS_LANGUAGESETTINGS TABLE
#
"surveyls_survey_id","surveyls_language","surveyls_title","surveyls_description","surveyls_welcometext","surveyls_endtext","surveyls_url","surveyls_urldescription","surveyls_email_invite_subj","surveyls_email_invite","surveyls_email_remind_subj","surveyls_email_remind","surveyls_email_register_subj","surveyls_email_register","surveyls_email_confirm_subj","surveyls_email_confirm","surveyls_dateformat"
"46284","en","http://bugs.limesurvey.org/view.php?id=3830","","","<br />","","","Invitation to participate in survey","Dear {FIRSTNAME},\n\nYou have been invited to participate in a survey.\n\nThe survey is titled:\n""{SURVEYNAME}""\n\n""{SURVEYDESCRIPTION}""\n\nTo participate, please click on the link below.\n\nSincerely,\n\n{ADMINNAME} ({ADMINEMAIL})\n\n----------------------------------------------\nClick here to do the survey:\n{SURVEYURL}","Reminder to participate in survey","Dear {FIRSTNAME},\n\nRecently we invited you to participate in a survey.\n\nWe note that you have not yet completed the survey, and wish to remind you that the survey is still available should you wish to take part.\n\nThe survey is titled:\n""{SURVEYNAME}""\n\n""{SURVEYDESCRIPTION}""\n\nTo participate, please click on the link below.\n\nSincerely,\n\n{ADMINNAME} ({ADMINEMAIL})\n\n----------------------------------------------\nClick here to do the survey:\n{SURVEYURL}","Survey registration confirmation","Dear {FIRSTNAME},\n\nYou, or someone using your email address, have registered to participate in an online survey titled {SURVEYNAME}.\n\nTo complete this survey, click on the following URL:\n\n{SURVEYURL}\n\nIf you have any questions about this survey, or if you did not register to participate and believe this email is in error, please contact {ADMINNAME} at {ADMINEMAIL}.","Confirmation of completed survey","Dear {FIRSTNAME},\n\nThis email is to confirm that you have completed the survey titled {SURVEYNAME} and your response has been saved. Thank you for participating.\n\nIf you have any further questions about this email, please contact {ADMINNAME} at {ADMINEMAIL}.\n\nSincerely,\n\n{ADMINNAME}","1"

#
# QUOTA TABLE
#

#
# QUOTA_MEMBERS TABLE
#

#
# QUOTA_LANGUAGESETTINGS TABLE
#

limesurvey_survey_46284.csv (4,619 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)7697
I will donate to the project if issue is resolved
BrowserFF
Database type & versionmysql 5.1.36
Server OS (if known)Win XP SP3
Webserver software & version (if known)Apache 2.2.11
PHP Version5.3.0

Users monitoring this issue

There are no users monitoring this issue.

Activities

JeP

JeP

2009-11-11 02:09

reporter   ~10059

Hmmm, assigned to ElMatador69 ?
Is it automatic or my mistake ?
:(

user372

2009-11-11 08:05

  ~10060

Last edited: 2009-11-11 08:12

@ JeP: Thats correct - all bugreports get assigned to me.

I tested on the v1.87RC1 branch and it looks like the issue has already been corrected/fixed ==> see my attach screenshot or reproduce it on my sample survey.
@ JeP: please attach your sample survey (survey structure as .csv-file) - Thx!

@c_schmitz: may you have a look inside the code, if everything is correct?

JeP

JeP

2009-11-11 12:21

reporter   ~10061

Here it is : limesurvey_survey_29631.csv

c_schmitz

c_schmitz

2009-11-11 22:57

administrator   ~10069

I can see it is already fixed. Closing issue.

Issue History

Date Modified Username Field Change
2009-11-11 01:44 JeP New Issue
2009-11-11 01:44 JeP Status new => assigned
2009-11-11 01:44 JeP Assigned To => user372
2009-11-11 01:44 JeP File Added: Survey Test and values.png
2009-11-11 01:44 JeP LimeSurvey build number => 7697
2009-11-11 01:44 JeP Browser => FF
2009-11-11 01:44 JeP Database & DB-Version => mysql 5.1.36
2009-11-11 01:44 JeP Operating System (Server) => Win XP SP3
2009-11-11 01:44 JeP Webserver => Apache 2.2.11
2009-11-11 01:44 JeP PHP Version => 5.3.0
2009-11-11 01:44 JeP File Added: Survey Results wrong.png
2009-11-11 01:45 JeP File Added: common-NEW.php
2009-11-11 02:09 JeP Note Added: 10059
2009-11-11 08:05 user372 Note Added: 10060
2009-11-11 08:06 user372 File Added: Survey.png
2009-11-11 08:06 user372 File Added: Response.png
2009-11-11 08:07 user372 File Added: limesurvey_survey_46284.csv
2009-11-11 08:12 user372 Note Edited: 10060
2009-11-11 08:12 user372 Assigned To user372 => c_schmitz
2009-11-11 12:20 JeP File Added: limesurvey_survey_29631.csv
2009-11-11 12:21 JeP Note Added: 10061
2009-11-11 22:57 c_schmitz Status assigned => resolved
2009-11-11 22:57 c_schmitz Fixed in Version => 1.87RC1
2009-11-11 22:57 c_schmitz Resolution open => fixed
2009-11-11 22:57 c_schmitz Note Added: 10069
2009-11-11 22:57 c_schmitz Status resolved => closed