Index: statistics_function.php =================================================================== --- statistics_function.php (revision 9911) +++ statistics_function.php (working copy) @@ -848,15 +848,15 @@ 4) Average size of file per respondent 5) Average no. of files 5) Summary/count of file types (ie: 37 jpg, 65 gif, 12 png) - 6) Total size of all files (useful if you’re about to download them all) - 7) You could also add things like “smallest file size”, “largest file size”, “median file size” + 6) Total size of all files (useful if you�re about to download them all) + 7) You could also add things like �smallest file size�, �largest file size�, �median file size� 8) no. of files corresponding to each extension 9) max file size 10) min file size */ // 1) Total number of files uploaded - // 2) Number of respondents who uploaded at least one file (with the inverse being the number of respondents who didn’t upload any) + // 2) Number of respondents who uploaded at least one file (with the inverse being the number of respondents who didn�t upload any) $fieldname=substr($rt, 1, strlen($rt)); $query = "SELECT SUM(".db_quote_id($fieldname.'_filecount').") as sum, AVG(".db_quote_id($fieldname.'_filecount').") as avg FROM ".db_table_name("survey_$surveyid"); $result=db_execute_assoc($query) or safe_die("Couldn't fetch the records
$query
".$connect->ErrorMsg()); @@ -1519,6 +1519,23 @@ $qparentqid=$nrow[4]; $qother=$nrow[5]; } + + switch($outputType) + { + case 'xls': + $linefeed = "\n"; + break; + case 'pdf': + $linefeed = "\n"; + break; + case 'html': + //Add linebreak after question. To place list IDs and answer codes on a new line. + $linefeed = "
\n"; + break; + default: + + break; + } //check question types switch($qtype) @@ -1544,7 +1561,7 @@ } //list IDs and answer codes in brackets - $qquestion .= "
\n[".$atext."]"; + $qquestion .= $linefeed."[".$atext."]"; $qtitle .= "($qanswer)"; break; @@ -1564,7 +1581,7 @@ $atext=FlattenText($qrow[1]); } - $qquestion .= "
\n[".$atext."]"; + $qquestion .= $linefeed."[".$atext."]"; $qtitle .= "($qanswer)"; break; @@ -1585,7 +1602,7 @@ $atext=FlattenText($qrow[1]); } //output - $qquestion .= "
\n[".$atext."]"; + $qquestion .= $linefeed."[".$atext."]"; $qtitle .= "($qanswer)"; break; @@ -1603,7 +1620,7 @@ $alist[]=array("D", $statlang->gT("Decrease")); $atext=FlattenText($qrow[1]); } - $qquestion .= "
\n[".$atext."]"; + $qquestion .= $linefeed."[".$atext."]"; $qtitle .= "($qanswer)"; break; @@ -1627,7 +1644,7 @@ $atext=FlattenText($qrow[1]); } - $qquestion .= "
\n[".$atext."] [".$ltext."]"; + $qquestion .= $linefeed."[".$atext."] [".$ltext."]"; $qtitle .= "($qanswer)"; break; @@ -1668,7 +1685,7 @@ $alist[]=array($i, $i); } - $qquestion .= "
\n[".$fielddata['subquestion1']."] [".$fielddata['subquestion2']."]"; + $qquestion .= $linefeed."[".$fielddata['subquestion1']."] [".$fielddata['subquestion2']."]"; list($myans, $mylabel)=explode("_", $qanswer); $qtitle .= "[$myans][$mylabel]"; break; @@ -1696,7 +1713,7 @@ } //output - $qquestion .= "
\n[".$atext."]"; + $qquestion .= $linefeed."[".$atext."]"; $qtitle .= "($qanswer)"; break; @@ -1857,6 +1874,7 @@ $sheet->setCellValueByColumnAndRow(0,$xlsRow,$xlsTitle); ++$xlsRow; $sheet->setCellValueByColumnAndRow(0,$xlsRow,$xlsDesc); + $sheet->getStyleByColumnAndRow(0,$xlsRow)->getAlignment()->setWrapText(true); $tableXLS = array(); $footXLS = array();