diff --git a/application/helpers/qanda_helper.php b/application/helpers/qanda_helper.php index 2a50e69f077..4dddb570c4e 100644 --- a/application/helpers/qanda_helper.php +++ b/application/helpers/qanda_helper.php @@ -4462,7 +4462,7 @@ function do_array_5point($ia) } $answer .= "\n"; - $answer_t_content = ''; + $answer_t_content = ''; $trbc = ''; $n=0; //return array($answer, $inputnames); @@ -4483,11 +4483,9 @@ function do_array_5point($ia) $trbc = alternation($trbc , 'row'); // Get array_filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname,"tr","$trbc answers-list radio-list"); - $answer_t_content .= $htmltbody2; - - $answer_t_content .= "\n" + $answer_t_content .= $htmltbody2 . "\t\n$answertext\n" . $hiddenfield . "\n"; + $answer .= $answer_t_content . "\n\t\n"; return array($answer, $inputnames); } @@ -4616,7 +4614,7 @@ function do_array_10point($ia) $answer .= "\t".$clang->gT('No answer')."\n"; } $answer .= "\n"; - $answer_t_content = ''; + $answer_t_content = 'readAll() as $ansrow) { @@ -4631,11 +4629,9 @@ function do_array_10point($ia) $trbc = alternation($trbc , 'row'); //Get array filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); - - $answer_t_content .= $htmltbody2; + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname,"tr","$trbc answers-list radio-list"); - $answer_t_content .= "\n" + $answer_t_content .= $htmltbody2 . "\t\n$answertext\n" . $hiddenfield . "\n\n\t\n"; } - $answer_t_content .= "\n"; + $answer_t_content .= "\n"; $inputnames[]=$myfname; $fn++; } - $answer .= $answer_t_content . "\t\n\n"; + $answer .= $answer_t_content . "\t\n\n\n"; return array($answer, $inputnames); } @@ -4741,7 +4737,7 @@ function do_array_yesnouncertain($ia) $answer .= "\t".$clang->gT('No answer')."\n"; } $answer .= "\n\t"; - $answer_t_content = ''; + $answer_t_content = ''; if ($anscount==0) { $inputnames=array(); @@ -4763,12 +4759,11 @@ function do_array_yesnouncertain($ia) $trbc = alternation($trbc , 'row'); // Get array_filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname,"tr","$trbc answers-list radio-list"); $answer_t_content .= $htmltbody2; - $answer_t_content .= "\n" - . "\t\n" + $answer_t_content .= "\t\n" . $hiddenfield . "\t\t\t\t$answertext\n" . "\t\n\n\t\n"; // --> END NEW FEATURE - SAVE } - $answer_t_content .= "\n"; + $answer_t_content .= ""; $inputnames[]=$myfname; $fn++; } } - $answer .= $answer_t_content . "\t\n\n"; + $answer .= $answer_t_content . "\t\\n\n"; return array($answer, $inputnames); } @@ -4900,7 +4895,7 @@ function do_array_increasesamedecrease($ia) } $answer .= "\n" ."\t\n"; - $answer_body = ''; + $answer_body = ''; $trbc = ''; foreach($ansresult->readAll() as $ansrow) { @@ -4917,12 +4912,11 @@ function do_array_increasesamedecrease($ia) $trbc = alternation($trbc , 'row'); // Get array_filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname,'tr',"$trbc answers-list radio-list"); $answer_body .= $htmltbody2; - $answer_body .= "\n" - . "\t\n" + $answer_body .= "\t\n" . "$answertext\n" . $hiddenfield . "\n" . "\t\n"; } - $answer_body .= "\n\t"; + $answer_body .= "\n"; $inputnames[]=$myfname; $fn++; } - $answer .= $answer_body . "\t\n\n"; + $answer .= $answer_body . "\t\n\n"; return array($answer, $inputnames); } @@ -4997,9 +4991,9 @@ function do_array_increasesamedecrease($ia) function do_array($ia) { global $thissurvey; - global $repeatheadings; global $notanswered; - global $minrepeatheadings; + $repeatheadings = Yii::app()->getConfig("repeatheadings"); + $minrepeatheadings = Yii::app()->getConfig("minrepeatheadings"); $extraclass =""; $clang = Yii::app()->lang; @@ -5082,7 +5076,7 @@ function do_array($ia) } $answer_head .= "\n\t\n\n\t\n"; - $answer = ''; + $answer = ''; $trbc = ''; $inputnames=array(); @@ -5092,6 +5086,7 @@ function do_array($ia) { if ( ($anscount - $fn + 1) >= $minrepeatheadings ) { + $answer .= "\n";// Close actual body and open another one $answer .= "\n" . "\t \n"; foreach ($labelans as $ld) @@ -5124,17 +5119,12 @@ function do_array($ia) // Get array_filter stuff // // TMSW - is this correct? - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); - // $row_selected = return_array_filter_selected($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); - // if($row_selected) - // { $trbc = alternation($trbc , 'row'); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname,"tr","$trbc answers-list radio-list"); $fn++; - // } $answer .= $htmltbody2; - $answer .= "\n" - . "\t\n$answertext" + $answer .= "\t\n$answertext" . $hiddenfield . "getConfig('surveyID')][$myfname])) @@ -5189,7 +5179,7 @@ function do_array($ia) $inputnames[]=$myfname; //IF a MULTIPLE of flexi-redisplay figure, repeat the headings } - + $answer .= "\n"; $answer_cols = "\t\n" ."\t\n" ; @@ -5211,7 +5201,7 @@ function do_array($ia) } $answer_cols .= "\t\n"; - $answer = $answer_start . $answer_cols . $answer_head .$answer . "\t\n\n"; + $answer = $answer_start . $answer_cols . $answer_head .$answer ."\n"; } elseif ($useDropdownLayout === true && $lresult->count() > 0) { @@ -5270,11 +5260,10 @@ function do_array($ia) $answertext = ''.$answertext.''; } // Get array_filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname,"tr","$trbc question-item answer-item dropdown-item"); $answer .= $htmltbody2; - $answer .= "\n" - . "\t\n$answertext" + $answer .= "\t\n$answertext" . $hiddenfield . "getConfig('surveyID')][$myfname])) @@ -5322,13 +5311,13 @@ function do_array($ia) $answer .= "\t \n"; } - $answer .= "\n"; + $answer .= "\n"; $inputnames[]=$myfname; //IF a MULTIPLE of flexi-redisplay figure, repeat the headings $fn++; } - - $answer = $answer_start . $answer . "\t\n\n"; + $answer .= "\t"; + $answer = $answer_start . $answer . "\n\n"; } else { @@ -5346,9 +5335,9 @@ function do_array($ia) function do_array_multitext($ia) { global $thissurvey; - global $repeatheadings; global $notanswered; - global $minrepeatheadings; + $repeatheadings = Yii::app()->getConfig("repeatheadings"); + $minrepeatheadings = Yii::app()->getConfig("minrepeatheadings"); $extraclass =""; $clang = Yii::app()->lang; @@ -5584,7 +5573,7 @@ function do_array_multitext($ia) . "\t\n"; $answer = "\n\n" . $answer_cols . $answer_head; - + $answer .= ""; $trbc = ''; foreach ($ansresult->readAll() as $ansrow) { @@ -5592,14 +5581,14 @@ function do_array_multitext($ia) { if ( ($anscount - $fn + 1) >= $minrepeatheadings ) { - $trbc = alternation($trbc , 'row'); - $answer .= "\n\n" + $answer .= "\n";// Close actual body and open another one + $answer .= "\n" . "\t \n"; foreach ($labelans as $ld) { $answer .= "\t".$ld."\n"; } - $answer .= "\n\n"; + $answer .= "\n"; } } $myfname = $ia[1].$ansrow['title']; @@ -5627,14 +5616,13 @@ function do_array_multitext($ia) } // Get array_filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); + $trbc = alternation($trbc , 'row'); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname,"tr","$trbc subquestion-list questions-list"); $answer .= $htmltbody2; if (strpos($answertext,'|')) {$answertext=substr($answertext,0, strpos($answertext,'|'));} - $trbc = alternation($trbc , 'row'); - $answer .= "\t\t\n" - . "\t\t\t\n" + $answer .= "\t\t\t\n" . "\t\t\t\t".$hiddenfield . "$answertext\n" . "\t\t\t\t$row_head"; for( $a = 0; $a < count($labelcode) ; ++$a ) @@ -5727,9 +5714,9 @@ function do_array_multitext($ia) function do_array_multiflexi($ia) { global $thissurvey; - global $repeatheadings; global $notanswered; - global $minrepeatheadings; + $repeatheadings = Yii::app()->getConfig("repeatheadings"); + $minrepeatheadings = Yii::app()->getConfig("minrepeatheadings"); $extraclass =""; $answertypeclass = ""; $clang = Yii::app()->lang; @@ -5912,21 +5899,21 @@ function do_array_multiflexi($ia) $trbc = ''; $answer = "\n\n" . $mycols . $myheader . "\n"; - + $answer .= ""; foreach ($ansresult as $ansrow) { if (isset($repeatheadings) && $repeatheadings > 0 && ($fn-1) > 0 && ($fn-1) % $repeatheadings == 0) { if ( ($anscount - $fn + 1) >= $minrepeatheadings ) { - $trbc = alternation($trbc , 'row'); - $answer .= "\n\n" + $answer .= "\n";// Close actual body and open another one + $answer .= "\n" . "\t\n"; foreach ($labelans as $ld) { $answer .= "\t\n"; } - $answer .= "\n\n"; + $answer .= "\n\n"; } } $myfname = $ia[1].$ansrow['title']; @@ -5954,16 +5941,13 @@ function do_array_multiflexi($ia) } // Get array_filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname); + $trbc = alternation($trbc , 'row'); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname,"tr","$trbc subquestions-list questions-list {$answertypeclass}-list"); $answer .= $htmltbody2; if (strpos($answertext,'|')) {$answertext=substr($answertext,0, strpos($answertext,'|'));} - - $trbc = alternation($trbc , 'row'); - - $answer .= "\n" - . "\t\n\t"; + $answer .= "\n"; //IF a MULTIPLE of flexi-redisplay figure, repeat the headings $fn++; } - $answer .= "\n
 ".$ld."
\n" + $answer .= "\t\n" . "$answertext\n" . $hiddenfield . " \n"; } - $answer .= "
\n"; + $answer .= "\t\n\n"; } else { @@ -6237,9 +6221,9 @@ function do_arraycolumns($ia) function do_array_dual($ia) { global $thissurvey; - global $repeatheadings; global $notanswered; - global $minrepeatheadings; + $repeatheadings = Yii::app()->getConfig("repeatheadings"); + $minrepeatheadings = Yii::app()->getConfig("minrepeatheadings"); $extraclass =""; $answertypeclass = ""; // Maybe not $clang = Yii::app()->lang; @@ -6442,7 +6426,8 @@ function do_array_dual($ia) . "\n\t\n" . $myheader1 . $myheader2 - . "\n\t\n"; + . "\n\t\n" + . "\n"; $trbc = ''; foreach ($ansresult->readAll() as $ansrow) @@ -6452,7 +6437,8 @@ function do_array_dual($ia) { if ( ($anscount - $fn + 1) >= $minrepeatheadings ) { - $answer .= "\n\n" + $answer .= "\n";// Close actual body and open another one + $answer .= "\n\n" . "\t \n"; foreach ($labelans as $ld) { @@ -6475,7 +6461,7 @@ function do_array_dual($ia) $answer .= "\t \n"; // Separator $answer .= "\t".$clang->gT('No answer')."\n"; } - $answer .= "\n\n"; + $answer .= "\n"; } } @@ -6496,15 +6482,14 @@ function do_array_dual($ia) } // Get array_filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname0, $trbc, $myfname); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname0, $trbc, $myfname,"tr","$trbc answers-list radio-list"); $answer .= $htmltbody2; if (strpos($answertext,'|')) {$answertext=substr($answertext,0, strpos($answertext,'|'));} array_push($inputnames,$myfname); - $answer .= "\n" // Note real : answers-list radios-list ? or answers-list radio-list dualanswers-list dualradio-list - . "\t\n" + $answer .= "\t\n" . $hiddenfield . "$answertext\n" . "count() > 0) @@ -6714,7 +6699,7 @@ function do_array_dual($ia) . "\t$rightheader\n" . $suffix_cell."\n" . "\t\n\n"; - + $answer .= "\n\n"; $trbc = ''; foreach ($ansresult->readAll() as $ansrow) { @@ -6736,12 +6721,11 @@ function do_array_dual($ia) $trbc = alternation($trbc , 'row'); // Get array_filter stuff - list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $rowname, $trbc, $myfname); + list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $rowname, $trbc, $myfname,"tr","$trbc subquestion-list questions-list dropdown-list"); $answer .= $htmltbody2; - $answer .= "\n" - . "\t\n" + $answer .= "\t\n" . "