Skip to content

Commit

Permalink
Dev: remove javascript error in home page
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Jun 19, 2018
1 parent 0ace024 commit 518be77
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions application/helpers/expressions/em_manager_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ class LimeExpressionManager {
*
* @var array
*/
private $groupRelevanceInfo;
private $groupRelevanceInfo = array();
/**
* The survey ID
* @var integer
*/
private $sid;
private $sid = 0;
/**
* sum of LEM_DEBUG constants - use bitwise AND comparisons to identify which parts to use
* @var int
*/
private $debugLevel=0;
private $debugLevel = 0;
/**
* sPreviewMode used for relevance equation force to 1 in preview mode
* Maybe we can set it public
* @var string|boolean
*/
private $sPreviewMode=false;
private $sPreviewMode = false;
/**
* Collection of variable attributes, indexed by SGQA code
*
Expand Down Expand Up @@ -103,15 +103,15 @@ class LimeExpressionManager {
*
* @var array
*/
private $knownVars;
private $knownVars = array();

/**
* maps qcode varname to SGQA code
*
* @example ['gender'] = '38612X10X145'
* @var array
*/
private $qcode2sgqa;
private $qcode2sgqa = array();

/**
* variables temporarily set for substitution purposes
Expand All @@ -126,7 +126,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $tempVars;
private $tempVars = array();

/**
* Array of relevance information for each page (gseq), indexed by gseq.
Expand All @@ -145,23 +145,23 @@ class LimeExpressionManager {
* 'hasErrors' => // 1 if there were parsing errors processing that relevance equation
* @var array
*/
private $pageRelevanceInfo;
private $pageRelevanceInfo = array();

/**
*
* @var array
*/
private $pageTailorInfo;
private $pageTailorInfo = array();
/**
* internally set to true (1) for survey.php so get group-specific logging but keep javascript variable namings consistent on the page.
* @var boolean
*/
private $allOnOnePage=false;
private $allOnOnePage = false;
/**
* survey mode. One of 'survey', 'group', or 'question'
* @var string
*/
private $surveyMode='group';
private $surveyMode = 'group';
/**
* a set of global survey options passed from LimeSurvey
*
Expand All @@ -186,29 +186,29 @@ class LimeExpressionManager {
*
* @var array
*/
private $surveyOptions=array();
private $surveyOptions = array();
/**
* array of mappings of Question # (qid) to pipe-delimited list of SGQA codes used within it
*
* @example [150] = "38612X11X150|38612X11X150other"
* @var array
*/
private $qid2code;
private $qid2code = array();
/**
* array of mappings of JavaScript Variable names to Question number (qid)
*
* @example ['java38612X13X161other'] = '161'
* @var array
*/
private $jsVar2qid;
private $jsVar2qid = array();
/**
* maps name of the variable to the SGQ name (without the A suffix)
*
* @example ['p1_sex'] = "38612X10X147"
* @example ['afDS_sq1_1'] = "26626X37X705sq1#1"
* @var array
*/
private $qcode2sgq;
private $qcode2sgq = array();
/**
* array of mappings of knownVar aliases to the JavaScript variable names.
* This maps both the SGQA and qcode alias names to the same 2 dimensional array
Expand All @@ -223,7 +223,7 @@ class LimeExpressionManager {
* );
* @var array
*/
private $alias2varName;
private $alias2varName = array();
/**
* JavaScript array of mappings of canonical JavaScript variable name to key attributes.
* These fragments are used to create the JavaScript varNameAttr array.
Expand All @@ -233,7 +233,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $varNameAttr;
private $varNameAttr = array();

/**
* array of enumerated answer lists indexed by qid
Expand All @@ -245,31 +245,31 @@ class LimeExpressionManager {
*
* @var array
*/
private $qans;
private $qans = array();
/**
* map of gid to 0-based sequence number of groups
*
* @example [10] = 0 // means that the first group (gseq=0) has gid=10
*
* @var array
*/
private $groupId2groupSeq;
private $groupId2groupSeq = array();
/**
* map question # to an incremental count of question order across the whole survey
*
* @example [157] = 13 // means that that 14th question in the survey has qid=157
*
* @var array
*/
private $questionId2questionSeq;
private $questionId2questionSeq = array();
/**
* map question # to the group it is within, using an incremental count of group order
*
* @example [157] = 2 // means that qid 157 is in the 3rd page of questions (gseq = 2)
*
* @var array
*/
private $questionId2groupSeq;
private $questionId2groupSeq = array();
/**
* array of info about each Group, indexed by GroupSeq
*
Expand All @@ -280,7 +280,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $groupSeqInfo;
private $groupSeqInfo = array();

/**
* tracks which groups have at least one relevant, non-hidden question
Expand All @@ -289,7 +289,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $gseq2relevanceStatus;
private $gseq2relevanceStatus = array();
/**
* maps question # to the validation equation(s) for that question.
* These are grouped by qid then validation type, such as 'value_range', and 'num_answers'
Expand All @@ -312,7 +312,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $qid2validationEqn;
private $qid2validationEqn = array();

/**
* keeps relevance in proper sequence so can minimize relevance processing to see what should be see on page and in indexes
Expand Down Expand Up @@ -342,24 +342,24 @@ class LimeExpressionManager {
*
* @var array
*/
private $questionSeq2relevance;
private $questionSeq2relevance = array();
/**
* current Group sequence (0-based index)
* @example 1
* @var integer
*/
private $currentGroupSeq;
private $currentGroupSeq=-1;
/**
* for Question-by-Question mode, the 0-based index
* @example 3
* @var integer
*/
private $currentQuestionSeq;
private $currentQuestionSeq=-1;
/**
* used in Question-by-Question mode
* @var integer
*/
private $currentQID;
private $currentQID = 0;
/**
* set of the current set of questions to be displayed, indexed by QID - at least one must be relevant
*
Expand Down Expand Up @@ -392,7 +392,7 @@ class LimeExpressionManager {
*
* @var array|null
*/
private $currentQset=NULL;
private $currentQset = null;
/**
* last result of NavigateForwards, NavigateBackwards, or JumpTo
* Array of status information about last movement, whether at question, group, or survey level
Expand All @@ -409,7 +409,7 @@ class LimeExpressionManager {
*
* @var array|null
*/
private $lastMoveResult=NULL;
private $lastMoveResult = null;
/**
* array of information needed to generate navigation index in question-by-question mode
* One entry for each question, indexed by qseq
Expand All @@ -432,7 +432,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $indexQseq;
private $indexQseq = array();
/**
* array of information needed to generate navigation index in group-by-group mode
* One entry for each group, indexed by gseq
Expand All @@ -450,7 +450,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $indexGseq;
private $indexGseq = array();
/**
* array of group sequence number to static info
* One entry per group, indexed on gseq
Expand All @@ -465,13 +465,13 @@ class LimeExpressionManager {
*
* @var array
*/
private $gseq2info;
private $gseq2info = array();

/**
* the maximum groupSeq reached - this is needed for Index
* @var int
*/
private $maxGroupSeq;
private $maxGroupSeq = -1;
/**
* the maximum Question reached sequencly ordered, used to show error to the user if we stop before this step with indexed survey.
* In question by question mode : $maxQuestionSeq==$_SESSION['survey_'.surveyid]['maxstep'], use it ?
Expand Down Expand Up @@ -504,7 +504,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $q2subqInfo;
private $q2subqInfo = array();
/**
* array of advanced question attributes for each question
* Indexed by qid; available for all quetions
Expand All @@ -519,7 +519,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $qattr;
private $qattr = array();
/**
* list of needed sub-question relevance (e.g. array_filter)
* Indexed by qid then sgqa; only generated for current group of questions
Expand All @@ -541,7 +541,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $subQrelInfo=array();
private $subQrelInfo = array();
/**
* array of Group-level relevance status
* Indexed by gseq; only shows groups that have been visited
Expand All @@ -558,7 +558,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $gRelInfo=array();
private $gRelInfo = array();

/**
* Array of timing information to debug how long it takes for portions of LEM to run.
Expand All @@ -571,24 +571,24 @@ class LimeExpressionManager {
*
* @var array
*/
private $runtimeTimings=array();
private $runtimeTimings = array();
/**
* True (1) if calling LimeExpressionManager functions between StartSurvey and FinishProcessingPage
* Used (mostly deprecated) to detect calls to LEM which happen outside of the normal processing scope
* @var boolean
*/
private $initialized=false;
private $initialized = false;
/**
* True (1) if have already processed the relevance equations (so don't need to do it again)
*
* @var boolean
*/
private $processedRelevance=false;
private $processedRelevance = false;
/**
* Message generated to show debug timing values, if debugLevel includes LEM_DEBUG_TIMING
* @var string
*/
private $debugTimingMsg='';
private $debugTimingMsg = '';
/**
* temporary variable to reduce need to parse same equation multiple times. Used for relevance and validation
* Array, indexed on equation, providing the following information:
Expand All @@ -601,7 +601,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $ParseResultCache;
private $ParseResultCache = array();
/**
* array of 2nd scale answer lists for types ':' and ';' -- needed for convenient print of logic file
* Indexed on qid; available for all questions
Expand All @@ -614,7 +614,7 @@ class LimeExpressionManager {
*
* @var array
*/
private $multiflexiAnswers;
private $multiflexiAnswers = array();

/**
* used to specify whether to generate equations using SGQA codes or qcodes
Expand All @@ -628,17 +628,17 @@ class LimeExpressionManager {
* Number of groups in survey (number of possible pages to display)
* @var integer
*/
private $numGroups=0;
private $numGroups = 0;
/**
* Numer of questions in survey (counting display-only ones?)
* @var integer
*/
private $numQuestions=0;
private $numQuestions = 0;
/**
* String identifier for the active session
* @var string
* @var string|null
*/
private $sessid;
private $sessid = null;
/**
* Linked list of array filters
* @var array
Expand Down

0 comments on commit 518be77

Please sign in to comment.