Skip to content

Commit

Permalink
05701: Exclusive option with more than one subquestion in multiple ch…
Browse files Browse the repository at this point in the history
…oice question doesn't work anymore

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@12234 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
TMSWhite committed Jan 27, 2012
1 parent e39f3b0 commit 0d680c6
Showing 1 changed file with 40 additions and 33 deletions.
73 changes: 40 additions & 33 deletions classes/eval/LimeExpressionManager.php
Expand Up @@ -565,41 +565,48 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
// exclude_all_others
if (isset($qattr['exclude_all_others']) && trim($qattr['exclude_all_others']) != '')
{
$exclusive_option = $qattr['exclude_all_others'];
$exclusive_options = explode(';',$qattr['exclude_all_others']);
if ($hasSubqs) {
$subqs = $qinfo['subqs'];
$sq_names = array();
foreach ($subqs as $sq) {
$sq_name = NULL;
if ($sq['csuffix'] == $exclusive_option)
{
continue; // so don't make the excluded option irrelevant
}
switch ($type)
{
case 'M': //Multiple choice checkbox
case 'P': //Multiple choice with comments checkbox + text
if ($this->sgqaNaming)
{
$sq_name = $qinfo['sgqa'] . trim($exclusive_option) . '.NAOK';
}
else
{
$sq_name = $qinfo['sgqa'] . trim($exclusive_option) . '.NAOK';
}
break;
default:
break;
foreach ($exclusive_options as $exclusive_option)
{
$exclusive_option = trim($exclusive_option);
if ($exclusive_option == '') {
continue;
}
if (!is_null($sq_name)) {
$subQrels[] = array(
'qtype' => $type,
'type' => 'exclude_all_others',
'rowdivid' => $sq['rowdivid'],
'eqn' => '(' . $sq_name . ' == "")',
'qid' => $questionNum,
'sgqa' => $qinfo['sgqa'],
);
$subqs = $qinfo['subqs'];
$sq_names = array();
foreach ($subqs as $sq) {
$sq_name = NULL;
if ($sq['csuffix'] == $exclusive_option)
{
continue; // so don't make the excluded option irrelevant
}
switch ($type)
{
case 'M': //Multiple choice checkbox
case 'P': //Multiple choice with comments checkbox + text
if ($this->sgqaNaming)
{
$sq_name = $qinfo['sgqa'] . trim($exclusive_option) . '.NAOK';
}
else
{
$sq_name = $qinfo['sgqa'] . trim($exclusive_option) . '.NAOK';
}
break;
default:
break;
}
if (!is_null($sq_name)) {
$subQrels[] = array(
'qtype' => $type,
'type' => 'exclude_all_others',
'rowdivid' => $sq['rowdivid'],
'eqn' => '(' . $sq_name . ' == "")',
'qid' => $questionNum,
'sgqa' => $qinfo['sgqa'],
);
}
}
}
}
Expand Down

0 comments on commit 0d680c6

Please sign in to comment.