userstatistics_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

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

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

Response

array

Generates statistics

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

Arguments

$surveyid

integer

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

string|null

getLinefeed

getLinefeed(string $outputType): string

Arguments

$outputType

string

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 :\Writer
var

Type(s)

\Writer

Keeps track of the current row in Excel sheet

xlsRow :integer
var

Type(s)

integer