statistics_helper
in package
Table of Contents
Properties
- $formatBold : mixed
- $pdf : pdf
- $sheet : Spreadsheet_Excel_Writer_Worksheet
- The Excel worksheet we are working on
- $workbook : Writer
- The current Excel workbook we are working on
- $xlsPercents : mixed
- $xlsRow : int
- Keeps track of the current row in Excel sheet
Methods
- _listcolumn() : mixed
- Returns a simple list of values in a particular column, that meet the requirements of the SQL
- _showSpeaker() : mixed
- generate_html_chartjs_statistics() : mixed
- Generates statistics with subviews
- generate_simple_statistics() : string
- Generate simple statistics
- generate_statistics() : string
- Generates statistics
- buildOutputList() : array<string|int, mixed>
- Builds an array containing information about this particular question/answer combination
- displayResults() : mixed
- displayResults builds html output to display the actual results from a survey
- displaySimpleResults() : array<string|int, mixed>
- getQuartile() : null|float
- Get the quartile using minitab method
Properties
$formatBold
protected
mixed
$formatBold
protected
pdf
$pdf
$sheet
The Excel worksheet we are working on
protected
Spreadsheet_Excel_Writer_Worksheet
$sheet
$workbook
The current Excel workbook we are working on
protected
Writer
$workbook
$xlsPercents
protected
mixed
$xlsPercents
$xlsRow
Keeps track of the current row in Excel sheet
protected
int
$xlsRow
= 0
Methods
_listcolumn()
Returns a simple list of values in a particular column, that meet the requirements of the SQL
public
_listcolumn(mixed $surveyid, mixed $column[, mixed $sortby = "" ][, mixed $sortmethod = "" ][, mixed $sorttype = "" ]) : mixed
Parameters
- $surveyid : mixed
- $column : mixed
- $sortby : mixed = ""
- $sortmethod : mixed = ""
- $sorttype : mixed = ""
_showSpeaker()
public
static _showSpeaker(mixed $hinttext) : mixed
Parameters
- $hinttext : mixed
generate_html_chartjs_statistics()
Generates statistics with subviews
public
generate_html_chartjs_statistics(mixed $surveyid, mixed $allfields[, mixed $q2show = 'all' ][, mixed $usegraph = 0 ][, mixed $outputType = 'pdf' ][, mixed $pdfOutput = 'I' ][, mixed $sLanguageCode = null ][, mixed $browse = true ]) : mixed
Parameters
- $surveyid : mixed
- $allfields : mixed
- $q2show : mixed = 'all'
- $usegraph : mixed = 0
- $outputType : mixed = 'pdf'
- $pdfOutput : mixed = 'I'
- $sLanguageCode : mixed = null
- $browse : mixed = true
Tags
generate_simple_statistics()
Generate simple statistics
public
generate_simple_statistics(mixed $surveyid, array<string|int, string> $allfields[, mixed $q2show = 'all' ][, mixed $usegraph = 0 ][, mixed $outputType = 'pdf' ][, mixed $pdfOutput = 'I' ][, mixed $sLanguageCode = null ][, mixed $browse = true ]) : string
Parameters
- $surveyid : mixed
- $allfields : array<string|int, string>
- $q2show : mixed = 'all'
- $usegraph : mixed = 0
- $outputType : mixed = 'pdf'
- $pdfOutput : mixed = 'I'
- $sLanguageCode : mixed = null
- $browse : mixed = true
Return values
stringgenerate_statistics()
Generates statistics
public
generate_statistics(int $surveyid, mixed $allfields[, mixed $q2show = 'all' ][, int $usegraph = 0 ][, string $outputType = 'pdf' ][, mixed $outputTarget = 'I' ][, mixed $sLanguageCode = null ][, mixed $browse = true ]) : string
Parameters
- $surveyid : int
-
The survey ID
- $allfields : mixed
- $q2show : mixed = 'all'
- $usegraph : int = 0
- $outputType : string = 'pdf'
-
Optional - Can be xls, html or pdf - Defaults to pdf
- $outputTarget : mixed = 'I'
- $sLanguageCode : mixed = null
- $browse : mixed = true
-
Show browse buttons
Tags
Return values
stringbuildOutputList()
Builds an array containing information about this particular question/answer combination
protected
buildOutputList(string $rt, mixed $language, mixed $surveyid, string $outputType, mixed $sql, mixed $oLanguage[, bool $browse = true ]) : array<string|int, mixed>
Parameters
- $rt : string
-
The code passed from the statistics form listing the field/answer (SGQA) combination to be displayed
- $language : mixed
-
The language to present output in
- $surveyid : mixed
-
The survey ID
- $outputType : string
- $sql : mixed
- $oLanguage : mixed
- $browse : bool = true
Tags
Return values
array<string|int, mixed>displayResults()
displayResults builds html output to display the actual results from a survey
protected
displayResults(mixed $outputs, int $results, mixed $rt, string $outputType, mixed $surveyid, mixed $sql, int $usegraph, mixed $browse, mixed $sLanguage) : mixed
Parameters
- $outputs : mixed
- $results : int
-
The number of results being displayed overall
- $rt : mixed
- $outputType : string
- $surveyid : mixed
- $sql : mixed
- $usegraph : int
- $browse : mixed
- $sLanguage : mixed
Tags
displaySimpleResults()
protected
displaySimpleResults(mixed $outputs, mixed $results, mixed $rt, string $outputType, mixed $surveyid, mixed $sql, int $usegraph, bool $browse, mixed $sLanguage) : array<string|int, mixed>
Parameters
- $outputs : mixed
- $results : mixed
- $rt : mixed
- $outputType : string
- $surveyid : mixed
- $sql : mixed
- $usegraph : int
- $browse : bool
- $sLanguage : mixed
Tags
Return values
array<string|int, mixed>getQuartile()
Get the quartile using minitab method
protected
getQuartile(int $quartile, array<string|int, mixed> $fielddata, string $sql, bool $excludezeros) : null|float
L=(1/4)(n+1), U=(3/4)(n+1) Minitab linear interpolation between the two closest data points. Minitab would let L = 2.5 and find the value half way between the 2nd and 3rd data points. In our example, that would be (4+9)/2 = 6.5. Similarly, the upper quartile value would be half way between the 7th and 8th data points, which would be (49+64)/2 = 56.5. If L were 2.25, Minitab would find the value one fourth of the way between the 2nd and 3rd data points and if L were 2.75, Minitab would find the value three fourths of the way between the 2nd and 3rd data points.
Parameters
- $quartile : int
-
use 0 for return of recordcount, otherwise will return Q1,Q2,Q3
- $fielddata : array<string|int, mixed>
- $sql : string
- $excludezeros : bool