Commit 19656a8e by Denis Chenu

[dev] Fix name, and add some phpdoc

parent c3155e78
# adminStats
# quickStatAdminParticipationAndStat
A plugin for limesurvey to show some quick statistics about participation and satisfaction.
## Installation
See [Install and activate a plugin for LimeSurvey](https://extensions.sondages.pro/install-and-activate-a-plugin-for-limesurvey) for details.
### Via GIT
- Go to your LimeSurvey Directory
- Clone in plugins/adminStats directory : `git clone https://git.framasoft.org/SondagePro-LimeSurvey-plugin/adminStats.git adminStats`
- Clone in plugins/adminStats directory : `git clone https://framagit.org/SondagePro-LimeSurvey-plugin/quickStatAdminParticipationAndStat.git quickStatAdminParticipationAndStat`
### Via ZIP dowload
- Download <http://extensions.sondages.pro/IMG/auto/quickStatAdminParticipationAndStat.zip>
- Extract : `unzip quickStatAdminParticipationAndStat.zip`
- Move the directory to plugins/ directory inside LimeSUrvey
## Usage
Global settings offer what survey admin can choose for particpation.
In Survey settings you can choose the question to show for participation and question for satisfaction.
- Particpation question are single choice questions or token attribute (if exist)
- Satisfaction question can be single choice, numeric or array question type. For non-numerical questions the mean is calculated with numerical code of answers only.
If the an user have only access to statistics : after login it was redirected to a survey list. Only survey with statictics Permission are shown.
- Satisfaction question can be single choice, numeric or array question type. The mean is calculated with numerical code of answers only, tyhis allow to use Not Applicable option for example.
If the an user don't have global permission except login : it was redirected to a survey list. Only survey with statictics Permission are shown.
## Home page & Copyright
- HomePage <http://extensions.sondages.pro/>
......
......@@ -457,12 +457,10 @@ class quickStatAdminParticipationAndStat extends \ls\pluginmanager\PluginBase
}
elseif($this->iSurveyId)
{
if(!Permission::model()->hasSurveyPermission($this->iSurveyId,'statistics'))
{
if(!Permission::model()->hasSurveyPermission($this->iSurveyId,'statistics')) {
throw new CHttpException(401,gT("You do not have sufficient rights to access this page."));
}
if(tableExists("{{survey_{$oSurvey->sid}}}"))
{
if(tableExists("{{survey_{$oSurvey->sid}}}")) {
$oSurvey=Survey::model()->with('languagesettings')->find("sid=:sid",array(":sid"=>$this->iSurveyId));
if(in_array(App()->language,$oSurvey->getAllLanguages())){
$this->surveyLanguage=App()->language;
......@@ -475,9 +473,7 @@ class quickStatAdminParticipationAndStat extends \ls\pluginmanager\PluginBase
}
$this->aRenderData['oSurvey']=$oSurvey;
$sAction=in_array($sAction,array('participation','satisfaction','export')) ? $sAction : 'participation';
}
else
{
} else {
$sAction="list";
}
}
......@@ -751,7 +747,7 @@ class quickStatAdminParticipationAndStat extends \ls\pluginmanager\PluginBase
'max'=>max($maxByQuestion,$this->getMax($sColumnName)),
'datas'=>array(
array(
'title'=>$this->translate->gT("Total Population"),
'title'=>$this->_translate("Total Population"),
'count'=>$iCount,
'average'=>$this->getAverage($sColumnName),
),
......@@ -913,6 +909,9 @@ class quickStatAdminParticipationAndStat extends \ls\pluginmanager\PluginBase
$this->render('satisfaction');
}
/**
* Export in CSV the fayly response rate
*/
public function actionExportData()
{
if(empty($this->aRenderData['oSurvey']))
......@@ -991,14 +990,17 @@ class quickStatAdminParticipationAndStat extends \ls\pluginmanager\PluginBase
$this->render('list_surveys');
}
/**
* Test if have only statistics access
* @todo : use a global settings ?
* @return boolean
*/
private function onlyStatAccess()
{
if(Yii::app() instanceof CConsoleApplication)
{
if(Yii::app() instanceof CConsoleApplication) {
return;
}
if(!Yii::app()->session['loginID'])
{
if(!Yii::app()->session['loginID']) {
return;
}
//~ $oCriteria=new CdbCriteria();
......@@ -1011,6 +1013,8 @@ class quickStatAdminParticipationAndStat extends \ls\pluginmanager\PluginBase
}
/**
* rendering a file in plugin view
* @param $fileRender the file to render (in views/subviews)
* @return void
*/
private function render($fileRender)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment