statistics_helper

package

Default

Methods

Returns a simple list of values in a particular column, that meet the requirements of the SQL

_listcolumn( $surveyid,  $column,  $sortby = "",  $sortmethod = "",  $sorttype = "") 

Arguments

$surveyid

$column

$sortby

$sortmethod

$sorttype

_showSpeaker

_showSpeaker( $hinttext) 
static

Arguments

$hinttext

Builds an array containing information about this particular question/answer combination

buildOutputList(string $rt, mixed $language, mixed $surveyid, string $outputType,  $sql,  $oLanguage, boolean $browse = true) : array
output

array $output An array containing "alist"=>A list of answers to the question in the form of an array ($alist array contains an array for every field to be displayed - with the Actual Question Code/Title, The text (flattened) of the question, and the fieldname where the data is stored. "qtitle"=>The title of the question, "qquestion"=>The description of the question, "qtype"=>The question type code

Arguments

$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

$oLanguage

$browse

boolean

Response

array

displayResults builds html output to display the actual results from a survey

displayResults(mixed $outputs, INT $results, mixed $rt, string $outputType, mixed $surveyid, mixed $sql, integer $usegraph,  $browse,  $sLanguage) 

Arguments

$outputs

mixed

$results

INT

The number of results being displayed overall

$rt

mixed

$outputType

string

$surveyid

mixed

$sql

mixed

$usegraph

integer

$browse

$sLanguage

displaySimpleResults

displaySimpleResults( $outputs,  $results,  $rt, string $outputType,  $surveyid,  $sql, integer $usegraph, boolean $browse,  $sLanguage) : array

Arguments

$outputs

$results

$rt

$outputType

string

$surveyid

$sql

$usegraph

integer

$browse

boolean

$sLanguage

Response

array

Generates statistics with subviews

generate_html_chartjs_statistics( $surveyid,  $allfields,  $q2show = 'all',  $usegraph,  $outputType = 'pdf',  $pdfOutput = 'I',  $sLanguageCode = null,  $browse = true) 

Arguments

$surveyid

$allfields

$q2show

$usegraph

$outputType

$pdfOutput

$sLanguageCode

$browse

Generate simple statistics

generate_simple_statistics( $surveyid, array<mixed,string> $allfields,  $q2show = 'all',  $usegraph,  $outputType = 'pdf',  $pdfOutput = 'I',  $sLanguageCode = null,  $browse = true) : string

Arguments

$surveyid

$allfields

array<mixed,string>

$q2show

$usegraph

$outputType

$pdfOutput

$sLanguageCode

$browse

Response

string

Generates statistics

generate_statistics(integer $surveyid, mixed $allfields, mixed $q2show = 'all', integer $usegraph, string $outputType = 'pdf',  $outputTarget = 'I',  $sLanguageCode = null, mixed $browse = true) : string

Arguments

$surveyid

integer

The survey id

$allfields

mixed

$q2show

mixed

$usegraph

integer

$outputType

string

Optional - Can be xls, html or pdf - Defaults to pdf

$outputTarget

$sLanguageCode

$browse

mixed

Show browse buttons

Response

string

Get the quartile using minitab method

getQuartile(integer $quartile, string $fieldname, integer $surveyid, string $sql, boolean $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.

staticvar

null $sid

int $recordCount

null $field

null $allRows

Arguments

$quartile

integer

use 0 for return of recordcount, otherwise will return Q1,Q2,Q3

$fieldname

string

$surveyid

integer

$sql

string

$excludezeros

boolean

Response

null|float

Properties

pdf

pdf : \pdf
var

Type(s)

\pdf

The Excel worksheet we are working on

sheet : \Spreadsheet_Excel_Writer_Worksheet
var

Type(s)

\Spreadsheet_Excel_Writer_Worksheet

xlsPercents

xlsPercents : 

Type(s)

formatBold

formatBold : 

Type(s)

The current Excel workbook we are working on

workbook : \Xlswriter
var

Type(s)

\Xlswriter

Keeps track of the current row in Excel sheet

xlsRow : integer
var

Type(s)

integer