diff --git a/backend/modules/questionnaire/controllers/UserQuestionnaireController.php b/backend/modules/questionnaire/controllers/UserQuestionnaireController.php index 6bd9c28..ee451c3 100644 --- a/backend/modules/questionnaire/controllers/UserQuestionnaireController.php +++ b/backend/modules/questionnaire/controllers/UserQuestionnaireController.php @@ -4,7 +4,7 @@ namespace backend\modules\questionnaire\controllers; use backend\modules\questionnaire\models\Questionnaire; use backend\modules\questionnaire\models\QuestionnaireCategory; -use common\helpers\ScoreCalculatorHelper; +use common\services\ScoreCalculatorService; use Yii; use backend\modules\questionnaire\models\UserQuestionnaire; use backend\modules\questionnaire\models\UserQuestionnaireSearch; @@ -169,7 +169,7 @@ class UserQuestionnaireController extends Controller public function actionRateResponses($id) { $user_questionnaire = $this->findModel($id); - ScoreCalculatorHelper::rateResponses($user_questionnaire); + ScoreCalculatorService::rateResponses($user_questionnaire); return $this->actionView($id); } @@ -177,7 +177,7 @@ class UserQuestionnaireController extends Controller public function actionCalculateScore($id) { $user_questionnaire = $this->findModel($id); - ScoreCalculatorHelper::calculateScore($user_questionnaire); + ScoreCalculatorService::calculateScore($user_questionnaire); return $this->actionView($id); } diff --git a/backend/modules/questionnaire/views/user-questionnaire/view.php b/backend/modules/questionnaire/views/user-questionnaire/view.php index 9ae3e09..4342359 100644 --- a/backend/modules/questionnaire/views/user-questionnaire/view.php +++ b/backend/modules/questionnaire/views/user-questionnaire/view.php @@ -1,6 +1,6 @@ params['breadcrumbs'][] = ['label' => 'User Questionnaires', 'url' => ['i $this->params['breadcrumbs'][] = $this->title; YiiAsset::register($this); ?> - -registerJs( -// '$("document").ready(function(){ -// $("#new_note").on("pjax:end", function() { -// $.pjax.reload({container:"#user_responses"}); //Reload GridView -// }); -// });' -//); -?>
= Html::a('Список', ['index'], ['class' => 'btn btn-primary']) ?> = Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> @@ -98,7 +86,7 @@ YiiAsset::register($this); 'class' => 'btn btn-success', ], ]); - if(ScoreCalculatorHelper::checkAnswerFlagsForNull($model)) + if(ScoreCalculatorService::checkAnswerFlagsForNull($model)) { echo 'Ответы проверены. Посчитать баллы?'; echo Html::a('Посчитать баллы', ['calculate-score', 'id' => $model->id], [ @@ -169,5 +157,4 @@ YiiAsset::register($this); ]); ?> -