View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 04779 | Bug reports | Import/Export | public | 2010-12-02 18:37 | 2010-12-15 13:43 |
| Reporter | luke | Assigned To | c_schmitz | ||
| Priority | normal | Severity | partial_block | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 1.90+ | ||||
| Fixed in Version | 1.90+ | ||||
| Summary | 04779: Exported labels are incorrect | ||||
| Description | For "Array (Numbers)" type questions, the labels in the exported data are identical for all responses (and they read as the first answer). For instance I added items: beer(s) and the exported file I see: beer(s) The data assigned to the labels is correct, meaning after you fix the lables (and the labels only) everything matches perfectly. | ||||
| Steps To Reproduce |
| ||||
| Additional Information | I would be interested in a fix as I need to apply it to my customized version of LS (can not upgrade!!!!) | ||||
| Tags | No tags attached. | ||||
| Attached Files | array_numbers_test.lss (14,275 bytes)
<?xml version="1.0" encoding="UTF-8"?>
<document>
<LimeSurveyDocType>Survey</LimeSurveyDocType>
<DBVersion>143</DBVersion>
<languages>
<language>en</language>
</languages>
<groups>
<fields>
<fieldname>gid</fieldname>
<fieldname>sid</fieldname>
<fieldname>group_name</fieldname>
<fieldname>group_order</fieldname>
<fieldname>description</fieldname>
<fieldname>language</fieldname>
</fields>
<rows>
<row>
<gid><![CDATA[35]]></gid>
<sid><![CDATA[93518]]></sid>
<group_name><![CDATA[group1]]></group_name>
<group_order><![CDATA[0]]></group_order>
<description><![CDATA[]]></description>
<language><![CDATA[en]]></language>
</row>
</rows>
</groups>
<questions>
<fields>
<fieldname>qid</fieldname>
<fieldname>parent_qid</fieldname>
<fieldname>sid</fieldname>
<fieldname>gid</fieldname>
<fieldname>type</fieldname>
<fieldname>title</fieldname>
<fieldname>question</fieldname>
<fieldname>preg</fieldname>
<fieldname>help</fieldname>
<fieldname>other</fieldname>
<fieldname>mandatory</fieldname>
<fieldname>question_order</fieldname>
<fieldname>language</fieldname>
<fieldname>scale_id</fieldname>
<fieldname>same_default</fieldname>
</fields>
<rows>
<row>
<qid><![CDATA[159]]></qid>
<parent_qid><![CDATA[0]]></parent_qid>
<sid><![CDATA[93518]]></sid>
<gid><![CDATA[35]]></gid>
<type><![CDATA[:]]></type>
<title><![CDATA[q1]]></title>
<question><![CDATA[]]></question>
<preg><![CDATA[]]></preg>
<help><![CDATA[]]></help>
<other><![CDATA[N]]></other>
<mandatory><![CDATA[N]]></mandatory>
<question_order><![CDATA[0]]></question_order>
<language><![CDATA[en]]></language>
<scale_id><![CDATA[0]]></scale_id>
<same_default><![CDATA[0]]></same_default>
</row>
</rows>
</questions>
<subquestions>
<fields>
<fieldname>qid</fieldname>
<fieldname>parent_qid</fieldname>
<fieldname>sid</fieldname>
<fieldname>gid</fieldname>
<fieldname>type</fieldname>
<fieldname>title</fieldname>
<fieldname>question</fieldname>
<fieldname>preg</fieldname>
<fieldname>help</fieldname>
<fieldname>other</fieldname>
<fieldname>mandatory</fieldname>
<fieldname>question_order</fieldname>
<fieldname>language</fieldname>
<fieldname>scale_id</fieldname>
<fieldname>same_default</fieldname>
</fields>
<rows>
<row>
<qid><![CDATA[160]]></qid>
<parent_qid><![CDATA[159]]></parent_qid>
<sid><![CDATA[93518]]></sid>
<gid><![CDATA[35]]></gid>
<type><![CDATA[T]]></type>
<title><![CDATA[SQ001]]></title>
<question><![CDATA[beer(s)]]></question>
<preg><![CDATA[]]></preg>
<help><![CDATA[]]></help>
<other><![CDATA[N]]></other>
<mandatory><![CDATA[]]></mandatory>
<question_order><![CDATA[1]]></question_order>
<language><![CDATA[en]]></language>
<scale_id><![CDATA[0]]></scale_id>
<same_default><![CDATA[0]]></same_default>
</row>
<row>
<qid><![CDATA[161]]></qid>
<parent_qid><![CDATA[159]]></parent_qid>
<sid><![CDATA[93518]]></sid>
<gid><![CDATA[35]]></gid>
<type><![CDATA[T]]></type>
<title><![CDATA[SQ001]]></title>
<question><![CDATA[]]></question>
<preg><![CDATA[]]></preg>
<help><![CDATA[]]></help>
<other><![CDATA[N]]></other>
<mandatory><![CDATA[]]></mandatory>
<question_order><![CDATA[1]]></question_order>
<language><![CDATA[en]]></language>
<scale_id><![CDATA[1]]></scale_id>
<same_default><![CDATA[0]]></same_default>
</row>
<row>
<qid><![CDATA[162]]></qid>
<parent_qid><![CDATA[159]]></parent_qid>
<sid><![CDATA[93518]]></sid>
<gid><![CDATA[35]]></gid>
<type><![CDATA[T]]></type>
<title><![CDATA[SQ002]]></title>
<question><![CDATA[wine(s)]]></question>
<preg><![CDATA[]]></preg>
<help><![CDATA[]]></help>
<other><![CDATA[N]]></other>
<mandatory><![CDATA[]]></mandatory>
<question_order><![CDATA[2]]></question_order>
<language><![CDATA[en]]></language>
<scale_id><![CDATA[0]]></scale_id>
<same_default><![CDATA[0]]></same_default>
</row>
<row>
<qid><![CDATA[163]]></qid>
<parent_qid><![CDATA[159]]></parent_qid>
<sid><![CDATA[93518]]></sid>
<gid><![CDATA[35]]></gid>
<type><![CDATA[T]]></type>
<title><![CDATA[SQ003]]></title>
<question><![CDATA[liquor(s)]]></question>
<preg><![CDATA[]]></preg>
<help><![CDATA[]]></help>
<other><![CDATA[N]]></other>
<mandatory><![CDATA[]]></mandatory>
<question_order><![CDATA[3]]></question_order>
<language><![CDATA[en]]></language>
<scale_id><![CDATA[0]]></scale_id>
<same_default><![CDATA[0]]></same_default>
</row>
</rows>
</subquestions>
<question_attributes>
<fields>
<fieldname>qaid</fieldname>
<fieldname>qid</fieldname>
<fieldname>attribute</fieldname>
<fieldname>value</fieldname>
</fields>
<rows>
<row>
<qaid><![CDATA[1022]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[answer_width]]></attribute>
<value><![CDATA[]]></value>
</row>
<row>
<qaid><![CDATA[1023]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[array_filter]]></attribute>
<value><![CDATA[]]></value>
</row>
<row>
<qaid><![CDATA[1024]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[array_filter_exclude]]></attribute>
<value><![CDATA[]]></value>
</row>
<row>
<qaid><![CDATA[1025]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[hidden]]></attribute>
<value><![CDATA[0]]></value>
</row>
<row>
<qaid><![CDATA[1026]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[multiflexible_max]]></attribute>
<value><![CDATA[]]></value>
</row>
<row>
<qaid><![CDATA[1027]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[multiflexible_min]]></attribute>
<value><![CDATA[]]></value>
</row>
<row>
<qaid><![CDATA[1028]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[multiflexible_step]]></attribute>
<value><![CDATA[]]></value>
</row>
<row>
<qaid><![CDATA[1029]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[multiflexible_checkbox]]></attribute>
<value><![CDATA[0]]></value>
</row>
<row>
<qaid><![CDATA[1030]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[input_boxes]]></attribute>
<value><![CDATA[0]]></value>
</row>
<row>
<qaid><![CDATA[1031]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[page_break]]></attribute>
<value><![CDATA[0]]></value>
</row>
<row>
<qaid><![CDATA[1032]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[public_statistics]]></attribute>
<value><![CDATA[0]]></value>
</row>
<row>
<qaid><![CDATA[1033]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[random_order]]></attribute>
<value><![CDATA[0]]></value>
</row>
<row>
<qaid><![CDATA[1034]]></qaid>
<qid><![CDATA[159]]></qid>
<attribute><![CDATA[scale_export]]></attribute>
<value><![CDATA[0]]></value>
</row>
</rows>
</question_attributes>
<surveys>
<fields>
<fieldname>sid</fieldname>
<fieldname>admin</fieldname>
<fieldname>expires</fieldname>
<fieldname>startdate</fieldname>
<fieldname>adminemail</fieldname>
<fieldname>private</fieldname>
<fieldname>faxto</fieldname>
<fieldname>format</fieldname>
<fieldname>template</fieldname>
<fieldname>language</fieldname>
<fieldname>additional_languages</fieldname>
<fieldname>datestamp</fieldname>
<fieldname>usecookie</fieldname>
<fieldname>notification</fieldname>
<fieldname>allowregister</fieldname>
<fieldname>allowsave</fieldname>
<fieldname>autonumber_start</fieldname>
<fieldname>autoredirect</fieldname>
<fieldname>allowprev</fieldname>
<fieldname>printanswers</fieldname>
<fieldname>ipaddr</fieldname>
<fieldname>refurl</fieldname>
<fieldname>publicstatistics</fieldname>
<fieldname>publicgraphs</fieldname>
<fieldname>listpublic</fieldname>
<fieldname>htmlemail</fieldname>
<fieldname>tokenanswerspersistence</fieldname>
<fieldname>assessments</fieldname>
<fieldname>usecaptcha</fieldname>
<fieldname>usetokens</fieldname>
<fieldname>bounce_email</fieldname>
<fieldname>attributedescriptions</fieldname>
<fieldname>emailresponseto</fieldname>
<fieldname>tokenlength</fieldname>
</fields>
<rows>
<row>
<sid><![CDATA[93518]]></sid>
<admin><![CDATA[Your Name]]></admin>
<expires><![CDATA[]]></expires>
<startdate><![CDATA[]]></startdate>
<adminemail><![CDATA[your@email.org]]></adminemail>
<private><![CDATA[Y]]></private>
<faxto><![CDATA[]]></faxto>
<format><![CDATA[G]]></format>
<template><![CDATA[fuckaround2]]></template>
<language><![CDATA[en]]></language>
<additional_languages><![CDATA[]]></additional_languages>
<datestamp><![CDATA[N]]></datestamp>
<usecookie><![CDATA[N]]></usecookie>
<notification><![CDATA[0]]></notification>
<allowregister><![CDATA[N]]></allowregister>
<allowsave><![CDATA[Y]]></allowsave>
<autonumber_start><![CDATA[0]]></autonumber_start>
<autoredirect><![CDATA[N]]></autoredirect>
<allowprev><![CDATA[Y]]></allowprev>
<printanswers><![CDATA[N]]></printanswers>
<ipaddr><![CDATA[N]]></ipaddr>
<refurl><![CDATA[N]]></refurl>
<publicstatistics><![CDATA[N]]></publicstatistics>
<publicgraphs><![CDATA[N]]></publicgraphs>
<listpublic><![CDATA[N]]></listpublic>
<htmlemail><![CDATA[Y]]></htmlemail>
<tokenanswerspersistence><![CDATA[N]]></tokenanswerspersistence>
<assessments><![CDATA[N]]></assessments>
<usecaptcha><![CDATA[D]]></usecaptcha>
<usetokens><![CDATA[N]]></usetokens>
<bounce_email><![CDATA[your@email.org]]></bounce_email>
<attributedescriptions><![CDATA[]]></attributedescriptions>
<emailresponseto><![CDATA[]]></emailresponseto>
<tokenlength><![CDATA[15]]></tokenlength>
</row>
</rows>
</surveys>
<surveys_languagesettings>
<fields>
<fieldname>surveyls_survey_id</fieldname>
<fieldname>surveyls_language</fieldname>
<fieldname>surveyls_title</fieldname>
<fieldname>surveyls_description</fieldname>
<fieldname>surveyls_welcometext</fieldname>
<fieldname>surveyls_endtext</fieldname>
<fieldname>surveyls_url</fieldname>
<fieldname>surveyls_urldescription</fieldname>
<fieldname>surveyls_email_invite_subj</fieldname>
<fieldname>surveyls_email_invite</fieldname>
<fieldname>surveyls_email_remind_subj</fieldname>
<fieldname>surveyls_email_remind</fieldname>
<fieldname>surveyls_email_register_subj</fieldname>
<fieldname>surveyls_email_register</fieldname>
<fieldname>surveyls_email_confirm_subj</fieldname>
<fieldname>surveyls_email_confirm</fieldname>
<fieldname>surveyls_dateformat</fieldname>
</fields>
<rows>
<row>
<surveyls_survey_id><![CDATA[93518]]></surveyls_survey_id>
<surveyls_language><![CDATA[en]]></surveyls_language>
<surveyls_title><![CDATA[array number test]]></surveyls_title>
<surveyls_description><![CDATA[array number test]]></surveyls_description>
<surveyls_welcometext><![CDATA[]]></surveyls_welcometext>
<surveyls_endtext><![CDATA[]]></surveyls_endtext>
<surveyls_url><![CDATA[]]></surveyls_url>
<surveyls_urldescription><![CDATA[]]></surveyls_urldescription>
<surveyls_email_invite_subj><![CDATA[Invitation to participate in survey]]></surveyls_email_invite_subj>
<surveyls_email_invite><![CDATA[Dear {FIRSTNAME},<br /><br />You have been invited to participate in a survey.<br /><br />The survey is titled:<br />"{SURVEYNAME}"<br /><br />"{SURVEYDESCRIPTION}"<br /><br />To participate, please click on the link below.<br /><br />Sincerely,<br /><br />{ADMINNAME} ({ADMINEMAIL})<br /><br />----------------------------------------------<br />Click here to do the survey:<br />{SURVEYURL}<br /><br />If you do not want to participate in this survey and don't want to receive any more invitations please click the following link:<br />{OPTOUTURL}]]></surveyls_email_invite>
<surveyls_email_remind_subj><![CDATA[Reminder to participate in survey]]></surveyls_email_remind_subj>
<surveyls_email_remind><![CDATA[Dear {FIRSTNAME},<br /><br />Recently we invited you to participate in a survey.<br /><br />We 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.<br /><br />The survey is titled:<br />"{SURVEYNAME}"<br /><br />"{SURVEYDESCRIPTION}"<br /><br />To participate, please click on the link below.<br /><br />Sincerely,<br /><br />{ADMINNAME} ({ADMINEMAIL})<br /><br />----------------------------------------------<br />Click here to do the survey:<br />{SURVEYURL}<br /><br />If you do not want to participate in this survey and don't want to receive any more invitations please click the following link:<br />{OPTOUTURL}]]></surveyls_email_remind>
<surveyls_email_register_subj><![CDATA[Survey registration confirmation]]></surveyls_email_register_subj>
<surveyls_email_register><![CDATA[Dear {FIRSTNAME},<br /><br />You, or someone using your email address, have registered to participate in an online survey titled {SURVEYNAME}.<br /><br />To complete this survey, click on the following URL:<br /><br />{SURVEYURL}<br /><br />If 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}.]]></surveyls_email_register>
<surveyls_email_confirm_subj><![CDATA[Confirmation of completed survey]]></surveyls_email_confirm_subj>
<surveyls_email_confirm><![CDATA[Dear {FIRSTNAME},<br /><br />This email is to confirm that you have completed the survey titled {SURVEYNAME} and your response has been saved. Thank you for participating.<br /><br />If you have any further questions about this email, please contact {ADMINNAME} at {ADMINEMAIL}.<br /><br />Sincerely,<br /><br />{ADMINNAME}]]></surveyls_email_confirm>
<surveyls_dateformat><![CDATA[1]]></surveyls_dateformat>
</row>
</rows>
</surveys_languagesettings>
</document>
4779.patch (3,488 bytes)
Index: exportresults.php
===================================================================
--- exportresults.php (revision 9583)
+++ exportresults.php (working copy)
@@ -608,40 +608,33 @@
case ";":
list($faid, $fcode) = explode("_", $faid);
if ($answers == "short") {
- $fquest .= " [$faid] [$fcode]";
+ $fquest .= " [$fcode] [$faid]";
} else {
- $fquery = "SELECT sq.*, q.other"
- ." FROM ".db_table_name('questions')." sq, ".db_table_name('questions')." q"
- ." WHERE sq.sid=$surveyid AND sq.parent_qid=q.qid "
- . "AND q.language='".GetBaseLanguageFromSurveyID($surveyid)."'"
- ." AND sq.language='".GetBaseLanguageFromSurveyID($surveyid)."'"
- ." AND q.qid={$fqid}
- AND sq.scale_id=0
- ORDER BY sq.question_order";
+ $fquery = "SELECT sq.question"
+ ." FROM ".db_table_name('questions')." sq"
+ ." WHERE sq.sid=$surveyid "
+ . "AND sq.language='".GetBaseLanguageFromSurveyID($surveyid)."'"
+ ." AND sq.language='".GetBaseLanguageFromSurveyID($surveyid)."'
+ AND sq.parent_qid={$fqid} and sq.title=".db_quoteall($faid)."
+ AND sq.scale_id=0";
- $y_axis_db = db_execute_assoc($fquery);
+ $sSubquestionY = $connect->GetOne($fquery);
// Get the X-Axis
- $aquery = "SELECT sq.*
+ $aquery = "SELECT sq.question
FROM ".db_table_name('questions')." q, ".db_table_name('questions')." sq
WHERE q.sid=$surveyid
AND sq.parent_qid=q.qid
AND q.language='".GetBaseLanguageFromSurveyID($surveyid)."'
AND sq.language='".GetBaseLanguageFromSurveyID($surveyid)."'
- AND q.qid={$fqid}
+ AND q.parent_qid={$faid} and q.title=".db_quoteall($fcode)."
AND sq.scale_id=1
ORDER BY sq.question_order";
- $x_axis_db=db_execute_assoc($aquery) or safe_die ("Couldn't get answers to Array questions<br />$aquery<br />".$connect->ErrorMsg());
+ $sSubquestionX = $connect->GetOne($aquery);
- while ($arows = $y_axis_db->FetchRow())
- {
- while ($xrows = $x_axis_db->FetchRow())
- {
- $fquest .= " [".strip_tags_full($arows['question'])."] [".strip_tags_full($xrows['question'])."]";
- }
- }
+ $fquest .= " [".strip_tags_full($sSubquestionY)."] [".strip_tags_full($sSubquestionX)."]";
}
break;
case "1": // multi scale Headline
| ||||
| Bug heat | 4 | ||||
| Complete LimeSurvey version number (& build) | 1234 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | IE 8 | ||||
| Database type & version | your demo server | ||||
| Server OS (if known) | your demo server | ||||
| Webserver software & version (if known) | your demo server | ||||
| PHP Version | your demo server | ||||
| Git branch / Pull Request URL | |||||
|
Attached patch file. |
|
|
Could you please let me know when this patch makes it to your demo server? I just tested it and it was still wrong so I assume it's not there yet. Thanks and thanks for fixing it. |
|
|
Released in 1.90+ version. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2010-12-02 18:37 | luke | New Issue | |
| 2010-12-02 18:37 | luke | File Added: array_numbers_test.lss | |
| 2010-12-04 01:30 | c_schmitz | Assigned To | => c_schmitz |
| 2010-12-04 01:30 | c_schmitz | Status | new => assigned |
| 2010-12-08 23:42 | c_schmitz | File Added: 4779.patch | |
| 2010-12-08 23:43 | c_schmitz | Note Added: 13728 | |
| 2010-12-08 23:43 | c_schmitz | Status | assigned => resolved |
| 2010-12-08 23:43 | c_schmitz | Fixed in Version | => 1.90+ |
| 2010-12-08 23:43 | c_schmitz | Resolution | open => fixed |
| 2010-12-09 00:17 | luke | Note Added: 13730 | |
| 2010-12-15 13:43 | c_schmitz | Note Added: 13798 | |
| 2010-12-15 13:43 | c_schmitz | Status | resolved => closed |