View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
05932 | Bug reports | Survey editing | public | 2012-03-20 15:20 | 2012-03-23 13:03 |
Reporter | MPIDR | Assigned To | TMSWhite | ||
Priority | normal | Severity | partial_block | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.92+ | ||||
Fixed in Version | 1.92+ | ||||
Summary | 05932: default answers to hidden questions are not saved to database | ||||
Description | In order to set pre-defined values that also need to be saved in the database, I have some hidden questions with default answers. The questions have been hidden by setting the advanced option "Always hide this question" to Yes. The question itself is a dropdown list with one answer option. This single option has been set as default answer. It was working in v1.91 but isn't anymore in 1.92 build 120314 and 120319. | ||||
Steps To Reproduce | 1) Create a question. | ||||
Tags | No tags attached. | ||||
Attached Files | 5932.lss (19,435 bytes)
<?xml version="1.0" encoding="UTF-8"?> <document> <LimeSurveyDocType>Survey</LimeSurveyDocType> <DBVersion>155</DBVersion> <languages> <language>en</language> </languages> <answers> <fields> <fieldname>qid</fieldname> <fieldname>code</fieldname> <fieldname>answer</fieldname> <fieldname>sortorder</fieldname> <fieldname>assessment_value</fieldname> <fieldname>language</fieldname> <fieldname>scale_id</fieldname> </fields> <rows> <row> <qid><![CDATA[177]]></qid> <code><![CDATA[50]]></code> <answer><![CDATA[50]]></answer> <sortorder><![CDATA[1]]></sortorder> <assessment_value><![CDATA[0]]></assessment_value> <language><![CDATA[en]]></language> <scale_id><![CDATA[0]]></scale_id> </row> </rows> </answers> <defaultvalues> <fields> <fieldname>qid</fieldname> <fieldname>scale_id</fieldname> <fieldname>sqid</fieldname> <fieldname>language</fieldname> <fieldname>specialtype</fieldname> <fieldname>defaultvalue</fieldname> </fields> <rows> <row> <qid><![CDATA[177]]></qid> <scale_id><![CDATA[0]]></scale_id> <sqid><![CDATA[0]]></sqid> <language><![CDATA[en]]></language> <specialtype><![CDATA[]]></specialtype> <defaultvalue><![CDATA[50]]></defaultvalue> </row> </rows> </defaultvalues> <groups> <fields> <fieldname>gid</fieldname> <fieldname>sid</fieldname> <fieldname>group_name</fieldname> <fieldname>group_order</fieldname> <fieldname>description</fieldname> <fieldname>language</fieldname> <fieldname>randomization_group</fieldname> <fieldname>grelevance</fieldname> </fields> <rows> <row> <gid><![CDATA[16]]></gid> <sid><![CDATA[28152]]></sid> <group_name><![CDATA[group 1]]></group_name> <group_order><![CDATA[0]]></group_order> <description><![CDATA[]]></description> <language><![CDATA[en]]></language> <randomization_group><![CDATA[]]></randomization_group> <grelevance><![CDATA[]]></grelevance> </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> <fieldname>relevance</fieldname> </fields> <rows> <row> <qid><![CDATA[176]]></qid> <parent_qid><![CDATA[0]]></parent_qid> <sid><![CDATA[28152]]></sid> <gid><![CDATA[16]]></gid> <type><![CDATA[Y]]></type> <title><![CDATA[question 1]]></title> <question><![CDATA[<p> Can you see this question?</p> ]]></question> <preg><![CDATA[]]></preg> <help><![CDATA[]]></help> <other><![CDATA[N]]></other> <mandatory><![CDATA[Y]]></mandatory> <question_order><![CDATA[0]]></question_order> <language><![CDATA[en]]></language> <scale_id><![CDATA[0]]></scale_id> <same_default><![CDATA[0]]></same_default> <relevance><![CDATA[1]]></relevance> </row> <row> <qid><![CDATA[177]]></qid> <parent_qid><![CDATA[0]]></parent_qid> <sid><![CDATA[28152]]></sid> <gid><![CDATA[16]]></gid> <type><![CDATA[!]]></type> <title><![CDATA[question 2]]></title> <question><![CDATA[]]></question> <preg><![CDATA[]]></preg> <help><![CDATA[]]></help> <other><![CDATA[N]]></other> <mandatory><![CDATA[Y]]></mandatory> <question_order><![CDATA[1]]></question_order> <language><![CDATA[en]]></language> <scale_id><![CDATA[0]]></scale_id> <same_default><![CDATA[0]]></same_default> <relevance><![CDATA[1]]></relevance> </row> </rows> </questions> <question_attributes> <fields> <fieldname>qid</fieldname> <fieldname>attribute</fieldname> <fieldname>value</fieldname> </fields> <rows> <row> <qid><![CDATA[176]]></qid> <attribute><![CDATA[hidden]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[176]]></qid> <attribute><![CDATA[hide_tip]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[176]]></qid> <attribute><![CDATA[page_break]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[176]]></qid> <attribute><![CDATA[public_statistics]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[176]]></qid> <attribute><![CDATA[random_group]]></attribute> <value><![CDATA[]]></value> </row> <row> <qid><![CDATA[176]]></qid> <attribute><![CDATA[scale_export]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[alphasort]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[category_separator]]></attribute> <value><![CDATA[]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[dropdown_prefix]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[dropdown_size]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[hidden]]></attribute> <value><![CDATA[1]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[hide_tip]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[other_comment_mandatory]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[other_replace_text]]></attribute> <value><![CDATA[]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[page_break]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[public_statistics]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[random_group]]></attribute> <value><![CDATA[]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[random_order]]></attribute> <value><![CDATA[0]]></value> </row> <row> <qid><![CDATA[177]]></qid> <attribute><![CDATA[scale_export]]></attribute> <value><![CDATA[0]]></value> </row> </rows> </question_attributes> <surveys> <fields> <fieldname>sid</fieldname> <fieldname>admin</fieldname> <fieldname>startdate</fieldname> <fieldname>expires</fieldname> <fieldname>adminemail</fieldname> <fieldname>anonymized</fieldname> <fieldname>faxto</fieldname> <fieldname>format</fieldname> <fieldname>savetimings</fieldname> <fieldname>template</fieldname> <fieldname>language</fieldname> <fieldname>additional_languages</fieldname> <fieldname>datestamp</fieldname> <fieldname>usecookie</fieldname> <fieldname>allowregister</fieldname> <fieldname>allowsave</fieldname> <fieldname>autonumber_start</fieldname> <fieldname>autoredirect</fieldname> <fieldname>showxquestions</fieldname> <fieldname>showgroupinfo</fieldname> <fieldname>shownoanswer</fieldname> <fieldname>showqnumcode</fieldname> <fieldname>showwelcome</fieldname> <fieldname>allowprev</fieldname> <fieldname>printanswers</fieldname> <fieldname>ipaddr</fieldname> <fieldname>refurl</fieldname> <fieldname>listpublic</fieldname> <fieldname>publicstatistics</fieldname> <fieldname>publicgraphs</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>emailnotificationto</fieldname> <fieldname>tokenlength</fieldname> <fieldname>bouncetime</fieldname> <fieldname>bounceprocessing</fieldname> <fieldname>bounceaccounttype</fieldname> <fieldname>bounceaccounthost</fieldname> <fieldname>bounceaccountuser</fieldname> <fieldname>bounceaccountpass</fieldname> <fieldname>bounceaccountencryption</fieldname> <fieldname>showprogress</fieldname> <fieldname>allowjumps</fieldname> <fieldname>navigationdelay</fieldname> <fieldname>nokeyboard</fieldname> <fieldname>alloweditaftercompletion</fieldname> <fieldname>googleanalyticsstyle</fieldname> <fieldname>googleanalyticsapikey</fieldname> </fields> <rows> <row> <sid><![CDATA[28152]]></sid> <admin><![CDATA[Dirk Vieregg]]></admin> <startdate><![CDATA[]]></startdate> <expires><![CDATA[]]></expires> <adminemail><![CDATA[vieregg@demogr.mpg.de]]></adminemail> <anonymized><![CDATA[N]]></anonymized> <faxto><![CDATA[]]></faxto> <format><![CDATA[G]]></format> <savetimings><![CDATA[N]]></savetimings> <template><![CDATA[MPIDR]]></template> <language><![CDATA[en]]></language> <additional_languages><![CDATA[]]></additional_languages> <datestamp><![CDATA[N]]></datestamp> <usecookie><![CDATA[N]]></usecookie> <allowregister><![CDATA[N]]></allowregister> <allowsave><![CDATA[Y]]></allowsave> <autonumber_start><![CDATA[0]]></autonumber_start> <autoredirect><![CDATA[N]]></autoredirect> <showxquestions><![CDATA[Y]]></showxquestions> <showgroupinfo><![CDATA[B]]></showgroupinfo> <shownoanswer><![CDATA[Y]]></shownoanswer> <showqnumcode><![CDATA[X]]></showqnumcode> <showwelcome><![CDATA[Y]]></showwelcome> <allowprev><![CDATA[N]]></allowprev> <printanswers><![CDATA[N]]></printanswers> <ipaddr><![CDATA[N]]></ipaddr> <refurl><![CDATA[N]]></refurl> <listpublic><![CDATA[N]]></listpublic> <publicstatistics><![CDATA[N]]></publicstatistics> <publicgraphs><![CDATA[N]]></publicgraphs> <htmlemail><![CDATA[Y]]></htmlemail> <tokenanswerspersistence><![CDATA[N]]></tokenanswerspersistence> <assessments><![CDATA[N]]></assessments> <usecaptcha><![CDATA[D]]></usecaptcha> <usetokens><![CDATA[N]]></usetokens> <bounce_email><![CDATA[vieregg@demogr.mpg.de]]></bounce_email> <attributedescriptions><![CDATA[]]></attributedescriptions> <emailresponseto><![CDATA[]]></emailresponseto> <emailnotificationto><![CDATA[]]></emailnotificationto> <tokenlength><![CDATA[15]]></tokenlength> <bouncetime><![CDATA[]]></bouncetime> <bounceprocessing><![CDATA[N]]></bounceprocessing> <bounceaccounttype><![CDATA[]]></bounceaccounttype> <bounceaccounthost><![CDATA[]]></bounceaccounthost> <bounceaccountuser><![CDATA[]]></bounceaccountuser> <bounceaccountpass><![CDATA[]]></bounceaccountpass> <bounceaccountencryption><![CDATA[]]></bounceaccountencryption> <showprogress><![CDATA[Y]]></showprogress> <allowjumps><![CDATA[N]]></allowjumps> <navigationdelay><![CDATA[0]]></navigationdelay> <nokeyboard><![CDATA[N]]></nokeyboard> <alloweditaftercompletion><![CDATA[N]]></alloweditaftercompletion> <googleanalyticsstyle><![CDATA[]]></googleanalyticsstyle> <googleanalyticsapikey><![CDATA[]]></googleanalyticsapikey> </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> <fieldname>email_admin_notification_subj</fieldname> <fieldname>email_admin_notification</fieldname> <fieldname>email_admin_responses_subj</fieldname> <fieldname>email_admin_responses</fieldname> <fieldname>surveyls_numberformat</fieldname> </fields> <rows> <row> <surveyls_survey_id><![CDATA[28152]]></surveyls_survey_id> <surveyls_language><![CDATA[en]]></surveyls_language> <surveyls_title><![CDATA[test for bug 5932]]></surveyls_title> <surveyls_description><![CDATA[]]></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 a 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 a 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 your participation in our 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} on {ADMINEMAIL}.<br /><br />Sincerely,<br /><br />{ADMINNAME}]]></surveyls_email_confirm> <surveyls_dateformat><![CDATA[1]]></surveyls_dateformat> <email_admin_notification_subj><![CDATA[Response submission for survey {SURVEYNAME}]]></email_admin_notification_subj> <email_admin_notification><![CDATA[Hello,<br /><br />A new response was submitted for your survey '{SURVEYNAME}'.<br /><br />Click the following link to reload the survey:<br />{RELOADURL}<br /><br />Click the following link to see the individual response:<br />{VIEWRESPONSEURL}<br /><br />Click the following link to edit the individual response:<br />{EDITRESPONSEURL}<br /><br />View statistics by clicking here:<br />{STATISTICSURL}]]></email_admin_notification> <email_admin_responses_subj><![CDATA[Response submission for survey {SURVEYNAME} with results]]></email_admin_responses_subj> <email_admin_responses><![CDATA[<style type="text/css"> .printouttable { margin:1em auto; } .printouttable th { text-align: center; } .printouttable td { border-color: #ddf #ddf #ddf #ddf; border-style: solid; border-width: 1px; padding:0.1em 1em 0.1em 0.5em; } .printouttable td:first-child { font-weight: 700; text-align: right; padding-right: 5px; padding-left: 5px; } .printouttable .printanswersquestion td{ background-color:#F7F8FF; } .printouttable .printanswersquestionhead td{ text-align: left; background-color:#ddf; } .printouttable .printanswersgroup td{ text-align: center; font-weight:bold; padding-top:1em; } </style>Hello,<br /><br />A new response was submitted for your survey '{SURVEYNAME}'.<br /><br />Click the following link to reload the survey:<br />{RELOADURL}<br /><br />Click the following link to see the individual response:<br />{VIEWRESPONSEURL}<br /><br />Click the following link to edit the individual response:<br />{EDITRESPONSEURL}<br /><br />View statistics by clicking here:<br />{STATISTICSURL}<br /><br /><br />The following answers were given by the participant:<br />{ANSWERTABLE}]]></email_admin_responses> <surveyls_numberformat><![CDATA[0]]></surveyls_numberformat> </row> </rows> </surveys_languagesettings> </document> | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 120314 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Internet Explorer, Firefox | ||||
Database type & version | MS SQL 2005 | ||||
Server OS (if known) | MS Windows 2008 R2 | ||||
Webserver software & version (if known) | IIS 7.5 | ||||
PHP Version | 5.3.8 | ||||
Just uploaded a survey with two questions. Question 2 is hidden and has a default answer of 50. |
|
Fixed with GitHub patch https://github.com/TMSWhite/LimeSurvey/commit/80390733e5aaeb7328de100565af2cb163033df7 |
|
Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=7994 |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=7995 |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=7996 |
|
1.92+ update released. |
|
LimeSurvey: Yii 20a95654 2012-03-20 10:17 Details Diff |
Fixed issue 05932: Default answers to hidden questions are not saved to database |
Affected Issues 05932 |
|
mod - application/helpers/expressions/em_manager_helper.php | Diff File | ||
LimeSurvey: master 1245a563 2012-03-20 10:17 Details Diff |
Fixed issue 05932: Default answers to hidden questions are not saved to database - patch by TMSWhite |
Affected Issues 05932 |
|
mod - classes/expressions/LimeExpressionManager.php | Diff File | ||
LimeSurvey: master 849aad6d 2012-03-20 10:31 Details Diff |
Fixed issue 05932: Default answers to hidden questions are not saved to database - patch by TMSWhite Dev Fixed line endings |
Affected Issues 05932 |
|
mod - classes/expressions/LimeExpressionManager.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-03-20 15:20 | MPIDR | New Issue | |
2012-03-20 15:27 | MPIDR | File Added: 5932.lss | |
2012-03-20 15:28 | MPIDR | Note Added: 18007 | |
2012-03-20 16:31 | TMSWhite | Assigned To | => TMSWhite |
2012-03-20 16:31 | TMSWhite | Status | new => assigned |
2012-03-20 16:39 | TMSWhite | Note Added: 18008 | |
2012-03-20 16:39 | TMSWhite | Status | assigned => resolved |
2012-03-20 16:39 | TMSWhite | Fixed in Version | => 1.92+ |
2012-03-20 16:39 | TMSWhite | Resolution | open => fixed |
2012-03-20 17:17 | c_schmitz | Changeset attached | => LimeSurvey Yii 20a95654 |
2012-03-20 17:17 | c_schmitz | Note Added: 18009 | |
2012-03-20 17:17 | c_schmitz | Changeset attached | => LimeSurvey master 1245a563 |
2012-03-20 17:17 | c_schmitz | Note Added: 18010 | |
2012-03-20 17:31 | c_schmitz | Changeset attached | => LimeSurvey master 849aad6d |
2012-03-20 17:31 | c_schmitz | Note Added: 18011 | |
2012-03-23 13:03 | c_schmitz | Note Added: 18062 | |
2012-03-23 13:03 | c_schmitz | Status | resolved => closed |
2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |