userstatistics_helper

Methods

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) 
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

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, boolean $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

boolean

$sLanguage

Generates statistics

generate_statistics(int $surveyid, mixed $allfields, mixed $q2show = 'all', integer $usegraph, string $outputType = 'pdf', string $pdfOutput = 'I', $sLanguageCode = null, boolean $browse = true) : \buffer

Arguments

$surveyid

int

The survey id

$allfields

mixed

$q2show

mixed

$usegraph

integer

$outputType

string

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

$pdfOutput

string

Sets the target for the PDF output: DD=File download , F=Save file to local disk

$sLanguageCode

$browse

boolean

Show browse buttons

Response

\buffer

Get the quartile using minitab method

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

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

int

$sql

string

$excludezeros

bool

Response

null|float

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

getLinefeed

getLinefeed(string $outputType) : string

Arguments

$outputType

string

Response

string

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 : 

formatBold

formatBold : 

The current Excel workbook we are working on

workbook : \Xlswriter
var

Type(s)

\Xlswriter

Keeps track of the current row in Excel sheet

xlsRow : int
var

Type(s)

int