LimeSurvey
Copyright (C) 2007-2011 The LimeSurvey Project Team / Carsten Schmitz
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.
Methods
Check if the move is clearcancel or confirmquota
checkClearCancel()
checkForDataSecurityAccepted
checkForDataSecurityAccepted()
Test if the the moveresult is finished, to decide to set the new $this->sMove value
checkIfFinished()
It checks if user used the browser navigation (prev, next, reload page etc)
and feed te backpopup variable if needed
checkIfUseBrowserNav()
Define prev step if not set in session.
checkPrevStep()
Check quotas
checkQuotas()
Display the first page if needed
displayFirstPageIfNeeded()
Apply the plugin even beforeQuestionRender to
question data.
doBeforeQuestionRenderEvent(array $data): array
see
|
https://manual.limesurvey.org/BeforeQuestionRender |
Arguments
Response
array
Question data modified by plugin
Retrieve the question classes for a given question id
getCurrentQuestionClasses(integer $iQid): string
Arguments
$iQid
integer
the question id
Response
string
the classes
Html error message if needed/available in the page
getErrorHtmlMessage(): string
todo
|
: move to coreReplacements ? Can be good. |
|
|
Response
string
(html)
Retrieve the radix
getRadix(): string
getShowNumAndCode
getShowNumAndCode(): \array<string,
If a step is requested, but the survey id in the session is different from the requested one
It reload the needed infos for the requested survey and jump to the requested step.
initDirtyStep()
If it's the first time the survey is loaded:
- Init session, randomization and filed array
- Check surveyid coherence
- Init $LEM states.
initFirstStep()
- Decide if Welcome page should be shown
Init session/params values depending of user moves
initMove()
- It init the needed variables for navigation: initFirstStep, initTotalAndMaxSteps, setMoveResult
- Then perform all the needed checks before moving:
- did the participant used browser navigation?
- did he pressed clear cancel, is he a confirmed quota?
- Is the previous step set?
- Is the survey finished?
- Are all the answer validated? (like: participant didn't answered to a mandatory question)
initTemplate
initTemplate()
Seems to be a quick fix to avoid the total and max steps to be null.
initTotalAndMaxSteps()
Set alanguageChanger.show to true if we need to show
the language changer.
makeLanguageChanger(): void
clear all system (no js or broken js)
manageClearAll(): void
Perform submit if asked by user
moveSubmitIfNeeded()
Check in a string if it uses expressions to replace them
processString(string $sString, $iRecursionLevel = 1,boolean $static = false): string
todo
|
: find/get current qid for processing string |
Arguments
$sString
string
the string to evaluate
Response
string
Main function
run(integer $surveyid,array $args): void
Perform save all if user asked for it
saveAllIfNeeded()
perform save submit if asked by user
called from save survey
saveSubmitIfNeeded()
setJavascriptVar
setJavascriptVar(mixed $iSurveyId = ''): void
Arguments
$iSurveyId
mixed
: the survey id for the script
Set the moveResult variable, depending on the user move request
setMoveResult()
check mandatory questions if necessary
CHECK IF ALL CONDITIONAL MANDATORY QUESTIONS THAT APPLY HAVE BEEN ANSWERED
setNotAnsweredAndNotValidated()
Set prev step in session depending on move type
If not in a specific page, prevstep stock the value of step just before it get updated
setPrevStep()
Increase step in session
setStep()
Retrieve the survey format (mode?)
TODO: move to survey model
setSurveyMode(): string
Retreives dew options comming from thissurvey, App->getConfig, LEM.
setSurveyOptions()
TODO: move to survey model
This method will set survey values in public property of the class
So, any value here set as $this->xxx will be available as $xxx after :
eg: $this->LEMsessid
setSurveySettings( $surveyid, $args)
The run method fed $redata with using get_defined_var(). So it was very hard to move a piece of code from the run method to a new one.
setVarFromArgs(array $args)
To make it easier, private variables has been added to this class:
So when a piece of code changes a variable (a variable that originally was finally added to redata get_defined_var()), now, it also changes its private variable version.
Then, before performing the get_defined_var, the private variables are used to recreate those variables. So we can move piece of codes to sub methods.
setVarFromArgs($args) will set the original state of those private variables using the parameter $args passed to the run() method
Arguments
Properties
previewquestion
previewquestion :boolean
previewgrp
previewgrp :boolean
Template configuration object (set in model TemplateConfiguration)
oTemplate :\Template|null
Path of the layout files in template
sTemplateViewPath :string|null
LEMsessid
LEMsessid :integer|null
customizable debugging for Lime ExpressionScript Engine ; LEM_DEBUG_TIMING;
(LEM_DEBUG_TIMING + LEM_DEBUG_VALIDATION_SUMMARY + LEM_DEBUG_VALIDATION_DETAIL);
LEMdebugLevel :integer
true if used GetLastMoveResult to avoid generation of unneeded extra JavaScript
LEMskipReprocessing :boolean
Survey settings:
TODO: To respect object oriented design, all those "states" should be
move to SurveyDynamic model, or its related models via relations.
aSurveyInfo :array|null
The only private variable here should be $oSurvey.
Array returned by common_helper::getSurveyInfo(); (survey row + language settings );
Type(s)
array|null
The survey id
iSurveyid :integer|null
True only when $_SESSION[$this->LEMsessid]['step'] == 0 ; Just a
variable for a logic step ==> should not be a Class variable (for
now, only here for the redata== get_defined_vars mess)
bShowEmptyGroup :boolean
Group By Group, All in one, Question by question
sSurveyMode :string|null
Few options comming from thissurvey, App->getConfig, LEM. Could be
replaced by $oSurvey + relations ; the one coming from LEM and
getConfig should be public variable on the surveyModel, set via
public methods (active, allowsave, anonymized, assessments,
datestamp, deletenonvalues, ipaddr, radix, refurl, savetimings,
surveyls_dateformat, startlanguage, target, tempdir,timeadjust)
aSurveyOptions :array|null
sLangCode
sLangCode :string|null
Contains the result of LimeExpressionManager::JumpTo() OR
LimeExpressionManager::NavigateBackwards() OR
NavigateForwards::LimeExpressionManager(). TODO: create a function
LimeExpressionManager::MoveTo that call the right method
aMoveResult :array|boolean
The move requested by user. Set by frontend_helper::getMove() from
the POST request.
sMove :integer|null
Just a variable used to check if user submitted a survey while it's
not finished. Just a variable for a logic step ==> should not be a Class
variable (for now, only here for the redata== get_defined_vars mess)
bInvalidLastPage :boolean
aStepInfo
aStepInfo :array|null
notvalidated
notvalidated :
notanswered
notanswered :
filenotvalidated
filenotvalidated :
okToShowErrors
okToShowErrors :
groupdescription
groupdescription :