function () { return $this->questionnaire->title; }, 'description' => function () { return $this->questionnaire->description; }, 'points_number' => function () { return Question::find() ->where(['questionnaire_id' => $this->questionnaire_id]) ->andWhere(['status' => 1]) ->sum('score'); }, 'number_questions' => function () { return Question::find() ->where(['questionnaire_id' => $this->questionnaire_id]) ->andWhere(['status' => 1]) ->count(); }, 'count_correct_answers' => function () { return $this->countCorrectAnswers($this->questionnaire_id); }, 'time_limit' => function () { return $this->questionnaire->time_limit; } ]; } /** * @return string[] */ public function extraFields(): array { return []; } }