['get'], ]; } /** * @throws NotFoundHttpException * @throws \Exception */ public function actionGetQuestions(): array { $uuid = Yii::$app->request->get('uuid'); if(empty($uuid) or !UUIDHelper::is_valid($uuid)) { throw new NotFoundHttpException('Incorrect questionnaire UUID'); } $questionnaire_id = UserQuestionnaire::getQuestionnaireId($uuid); $questions = Question::activeQuestions($questionnaire_id); if(empty($questions)) { throw new NotFoundHttpException('Questions not found'); } array_walk( $questions, function(&$arr){ unset( $arr['score'], $arr['created_at'], $arr['updated_at'], $arr['status'], $arr['questionnaire_id'] ); }); return $questions; } }