Skip to content

Commit

Permalink
Fixed issue #5323: .missing class added in answered filtered array qu…
Browse files Browse the repository at this point in the history
…estion "Show question index / allow jumping" modality - patch by flocs

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@11198 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Oct 18, 2011
1 parent cd40194 commit 4163f7c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 10 deletions.
56 changes: 54 additions & 2 deletions common_functions.php
Expand Up @@ -7668,12 +7668,14 @@ function aArrayInvert($aArr)
*/
function bCheckQuestionForAnswer($q, $aFieldnamesInfoInv)
{
if (@$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] == 'X')
$qtype = $_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'];

if ($qtype == 'X')
{
// boilerplate have no answers
return true;
}
else if (@$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] == 'M' || @$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] == 'P' || @$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['type'] == 'O')
else if ($qtype == 'M' || $qtype == 'P' || $qtype == 'O')
{
// multiple choice and list with comments question types - just one answer is required and comments are not required
$bAnsw = false;
Expand All @@ -7686,8 +7688,56 @@ function bCheckQuestionForAnswer($q, $aFieldnamesInfoInv)
}
}
}
else if ($qtype == 'F' || $qtype == ':' || $qtype == ';' || $qtype == '1' || $qtype == 'C' || $qtype == 'B' || $qtype == 'A' || $qtype == 'E')
{
// array question types - if filtered only displayed answer are required
$bAnsw = true;

$qid=$_SESSION['fieldmap'][$aFieldnamesInfoInv[$q][0]]['qid'];

$gquery = "SELECT * FROM ".db_table_name('question_attributes')." WHERE qid={$qid} AND attribute ='array_filter'";
$qresult = db_execute_assoc($gquery); //checked
$qrows = $qresult->GetRows();

$filter=$qrows[0]['value'];

//if there is no filter checkall answers
if (trim($filter) == '')
goto checkall;


foreach($_SESSION['fieldarray'] as $field)
{
//look for the multiple choice filter
if ($field[2] == $filter && $field[4] == 'M')
{
//filter SQG
$array_filter = $field[1];
break;
}
}

//if filter not found checkall answers
if ($array_filter == '')
goto checkall;

foreach($aFieldnamesInfoInv[$q] as $sField)
{
//keep only first SQ for multiple scale answer
$aid = explode('_',$_SESSION['fieldmap'][$sField]['aid']);
$aid = explode('#',$aid[0]);

if ($_SESSION[$array_filter.$aid[0]]=='Y' && $_SESSION[$sField]=='')
{
$bAnsw = false;
break;
}
}

}
else
{
checkall:
// all answers required for all other question types
$bAnsw = true;
foreach($aFieldnamesInfoInv[$q] as $sField)
Expand All @@ -7698,7 +7748,9 @@ function bCheckQuestionForAnswer($q, $aFieldnamesInfoInv)
break;
}
}

}

return $bAnsw;
}

Expand Down
15 changes: 7 additions & 8 deletions docs/release_notes.txt
Expand Up @@ -81,19 +81,19 @@ Thank you to everyone who helped with this new release!
Changes from 1.91+ (build 11110) to 1.91+ (build 11136)
#Updated translation: Danish by Andreas Christoffersen (c_schmitz)
#Updated translation: Czech (c_schmitz)
-Fixed issue #05489: Survey Iteration changes value usesleft in user table to 0 instead of 1 (lemeur)
-Fixed issue #5489: Survey Iteration changes value usesleft in user table to 0 instead of 1 (lemeur)
-Fixed issue: Administration user could gain access to database information reserved for Super-administrators (c_schmitz)
-Fixed issue: Integrity check reporting errors with subquestions due to invalid type or group id (c_schmitz)

Changes from 1.91+ (build 11026) to 1.91+ (build 11110)
#Updated translation: Polish (elisa-ls)
-Fixed issue: Re-implemented commit 10985 ("groups of "or"ed conditions were displaying multiple times") (maziminke)
-Fied issue: Some single choice questions were missing answer codes for available answer options. Some questions using "other" text fields were missing correct IDs. (maziminke)
-Fixed issue #05476: File upload questions hidden by condition with min file upload set prevent survey submission (lemeur)
-Fixed issue #05477: Users with all rights unticked still see everyone in the system in the surveylist view (lemeur)
-Fixed issue #05483: Conditions using previous answers as rightoperand do not work when both questions are on the same page (lemeur)
-Fixed issue #05493: Conditions using previous answers (coded as @sgqa@) aren't translated when survey is imported. (lemeur)
-Fixed issue 05488: multi numeric - slider, inital value dont register (tpartner)
-Fixed issue #5476: File upload questions hidden by condition with min file upload set prevent survey submission (lemeur)
-Fixed issue #5477: Users with all rights unticked still see everyone in the system in the surveylist view (lemeur)
-Fixed issue #5483: Conditions using previous answers as rightoperand do not work when both questions are on the same page (lemeur)
-Fixed issue #5493: Conditions using previous answers (coded as @sgqa@) aren't translated when survey is imported. (lemeur)
-Fixed issue #5488: multi numeric - slider, inital value dont register (tpartner)
-Fixed issue: slider layout multinumeric can't be answered without javascript (shnoulle)
-Fixed issue: Path disclosure vulnerabilities (c_schmitz)
-Fixed issue: Templates not editable in Chinese (c_schmitz)
Expand All @@ -106,14 +106,13 @@ Changes from 1.91+ (build 11018) to 1.91+ (build 11026)
Changes from 1.91+ (build 10951) to 1.91+ (build 11018)
#Updated translation : French (b00z00)
#Updated translation: German (c_schmitz)
#Updated translation: German Informal (c_schmitz)
#Updated translation: German informal (c_schmitz)
-Fixed issue: Survey Name not displaying when $showsgqacode is false. (jcleeland)
-Fixed issue: groups of "or"ed conditions were displaying multiple times. Removed additional "group by" entries in initial SQL that was causing the repeated processing of groups. (jcleeland)
-Fixed issue #5426: default <option> tag redundant in language chooser (c_schmitz)
-Fixed issue #5461: Arithmetic mean and deviation are not displayed even if showaggregateddata is set to 1- thanks to jpasquier (c_schmitz)
-Fixed issue #5462: Survey crashes if the referrer URL contains a single quote (c_schmitz)
-Fixed issue 05386: System still delete the user account even I cancel the deletion in confirmation box. (tpartner)
-Fixed issue #5386: System still delete the user account even I cancel the deletion in confirmation box. (tpartner)
-Fixed issue #5459: Conditions are not imported correctly for multiple choice questions (mennodekker)

Changes from 1.91+ (build 10859) to 1.91+ (build 10951)
Expand Down

0 comments on commit 4163f7c

Please sign in to comment.