Actions

Difference between revisions of "StatFunctions"

From LimeSurvey Manual

({{FeatureStarting|4.1.0}})
m (you can use <, >, >=, <=, <> operator)
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
* statCount(QuestionCode.sgqa[, submitted = true]) : count the answered question of QuestionCode already submitted. You can count the submitted survey with statCount('sid') for example.
 
* statCount(QuestionCode.sgqa[, submitted = true]) : count the answered question of QuestionCode already submitted. You can count the submitted survey with statCount('sid') for example.
* statCountIf(QuestionCode.sgqa, value[, submitted = true]) : count the response where answer to question QuestionCode are value.
+
* statCountIf(QuestionCode.sgqa, value[, submitted = true]) : count the response where answer to question QuestionCode are value. The comparaison use [https://www.yiiframework.com/doc/api/1.1/CDbCriteria#compare-detail Yii compare], you can use <, >, >=, <=, <> operator at start of your value.
  
 
You can find an usage of this 2 functions in [https://github.com/LimeSurvey/LimeSurvey/blob/master/tests/data/surveys/survey_archive_statCountFunctionsTest.lsa survey_archive_statCountFunctionsTest] inside test directory.
 
You can find an usage of this 2 functions in [https://github.com/LimeSurvey/LimeSurvey/blob/master/tests/data/surveys/survey_archive_statCountFunctionsTest.lsa survey_archive_statCountFunctionsTest] inside test directory.
  
 
[[File:StatFunctionsSample.png]]
 
[[File:StatFunctionsSample.png]]
 +
 +
This plugin use [[ExpressionManagerStart]] plugin and create two functions. This 2 functions don't have javascript part, then the check is done only when move in survey.
 +
 +
{{Alert|Before using these functions : the plugin must be activated in [[Plugin_manager#General|Plugin Manager]].}}
  
 
[[Category:Plugins]][[Category:Core Plugins]]
 
[[Category:Plugins]][[Category:Core Plugins]]

Latest revision as of 14:00, 13 May 2021

Notice.png
 Hint: This features is available starting in version 4.1.0


Functions for expression manager to count some statistics data :

  • statCount(QuestionCode.sgqa[, submitted = true]) : count the answered question of QuestionCode already submitted. You can count the submitted survey with statCount('sid') for example.
  • statCountIf(QuestionCode.sgqa, value[, submitted = true]) : count the response where answer to question QuestionCode are value. The comparaison use Yii compare, you can use <, >, >=, <=, <> operator at start of your value.

You can find an usage of this 2 functions in survey_archive_statCountFunctionsTest inside test directory.

StatFunctionsSample.png

This plugin use ExpressionManagerStart plugin and create two functions. This 2 functions don't have javascript part, then the check is done only when move in survey.

Important.png  Before using these functions : the plugin must be activated in Plugin Manager.