| Anonymous | Login | 2013-05-20 03:19 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap | Repositories |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 05181 | Bug reports | [All Projects] Survey taking | public | 2011-05-19 18:12 | 2011-05-25 22:15 | ||||
| Reporter | andrewteg | ||||||||
| Assigned To | tpartner | ||||||||
| Priority | normal | Severity | major | ||||||
| Status | closed | Resolution | fixed | ||||||
| Product Version | 1.91 | ||||||||
| Target Version | Fixed in Version | ||||||||
| Summary | 05181: List With Comment - Comment Required | ||||||||
| Description | I created a survey with a List with Comment question. When I answer it and then come back to it is marked as unanswered (has class missing) even though I answer a radio button item and simply leave the comment blank. I believe that the logic in bCheckQuestionForAnswer requires both the answer and the comment to be filled in. This also effects the Question Index markings. | ||||||||
| Steps To Reproduce | Import Survey: Sample Survey for v1.80 Take survey and answer "List with Comment" Question but do not enter comment. Use Prev/Next to go to another Group. Browse back to that question and it is marked as unanswered (missing class) despite having an answer but simply no comment. | ||||||||
| Additional Information | Bug report recommended by tpartner at http://www.limesurvey.org/en/forum/can-i-do-this-with-limesurvey/61055-confirm-resultsunanswered-questions#61111 [^] which also has this fix for the bCheckQuestionForAnswer function: * Check if a question was (at least partially) answered in the current session. * * @param integer $q - Question id * @param array $aFieldnamesInfoInv - Inverted fieldnamesInfo */ function bCheckQuestionForAnswer($q, $aFieldnamesInfoInv) { //echo "TYPE=".$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type']."|"; if(@$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] != 'M' && @$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] != 'O') { // all answers required $bAnsw = true; foreach($aFieldnamesInfoInv[$q] as $sField) { if(!isset($_SESSION[$sField]) || trim($_SESSION[$sField])=='') { $bAnsw = false; break; } } } elseif (@$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] == 'O') { // list with comment, just list is required //echo " "; print_r($aFieldnamesInfoInv[$q]); echo ""; $bAnsw = false; foreach($aFieldnamesInfoInv[$q] as $sField) { if(!strstr($sField, 'comment') && isset($_SESSION[$sField]) && trim($_SESSION[$sField])!='') { $bAnsw = true; break; } } } else { // multiple choice, just one answer is required $bAnsw = false; foreach($aFieldnamesInfoInv[$q] as $sField) { if(isset($_SESSION[$sField]) && trim($_SESSION[$sField])!='') { $bAnsw = true; break; } } } return $bAnsw; } | ||||||||
| I will donate to the project if issue is resolved within 48 hrs | No | ||||||||
| LimeSurvey build number | 10062 | ||||||||
| Browser | All | ||||||||
| Database & DB-Version | 145 | ||||||||
| Operating System (Server) | Windows | ||||||||
| Webserver software & version | IIS | ||||||||
| PHP Version | 5.2 | ||||||||
| Attached Files | |||||||||
Notes |
|
|
tpartner (developer) 2011-05-25 21:59 |
Fixed in revision 10124. I also fixed the same problem with mutliple-options-with-comments questions. Their comments are also no longer required. Thanks for the report Andrew. |
|
lemeur (administrator) 2011-05-25 22:02 |
Humm, I'm not sure this is the best fix for this issue as some users may want to enforce filling the comment field. A better approach would let the survey designer choos if the comment is mandatory or not with a new question attribute. tpartner, what do you think ? |
|
tpartner (developer) 2011-05-25 22:07 |
Well, I just followed the existing "Mandatory" requirements. If these question types are set to "Mandatory", a respondent can advance in the survey without completing the comments fields. This makes sense to me. |
|
lemeur (administrator) 2011-05-25 22:12 |
Ah Ok, I thought you changed the default behaviour. forget my comment then. |
|
tpartner (developer) 2011-05-25 22:15 |
Nope, the only behaviour change is related to "Show question index / allow jumping". |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2011-05-19 18:12 | andrewteg | New Issue | |
| 2011-05-19 18:12 | andrewteg | File Added: list_with_comment_answer_comment_missing.png | |
| 2011-05-19 20:25 | Mazi | Assigned To | => tpartner |
| 2011-05-19 20:25 | Mazi | Status | new => assigned |
| 2011-05-25 21:59 | tpartner | Note Added: 15117 | |
| 2011-05-25 21:59 | tpartner | Status | assigned => resolved |
| 2011-05-25 21:59 | tpartner | Resolution | open => fixed |
| 2011-05-25 22:02 | lemeur | Note Added: 15118 | |
| 2011-05-25 22:02 | lemeur | Status | resolved => feedback |
| 2011-05-25 22:02 | lemeur | Resolution | fixed => reopened |
| 2011-05-25 22:07 | tpartner | Note Added: 15119 | |
| 2011-05-25 22:12 | lemeur | Note Added: 15120 | |
| 2011-05-25 22:13 | lemeur | Status | feedback => resolved |
| 2011-05-25 22:13 | lemeur | Resolution | reopened => fixed |
| 2011-05-25 22:15 | tpartner | Note Added: 15121 | |
| 2011-05-25 22:15 | tpartner | Status | resolved => closed |
| Copyright © 2000 - 2013 MantisBT Team |