Add doc for tests
This commit is contained in:
@ -29,6 +29,33 @@ class AnswerController extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Get(path="/answer/get-answers",
|
||||
* summary="Список ответов на вопрос",
|
||||
* description="Получение списка ответов",
|
||||
* security={
|
||||
* {"bearerAuth": {}}
|
||||
* },
|
||||
* tags={"Tests"},
|
||||
* @OA\Parameter(
|
||||
* name="question_id",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* description="id вопроса",
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Возвращает масив вопросов",
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(ref="#/components/schemas/AnswerExampleArr"),
|
||||
* ),
|
||||
*
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionGetAnswers(): array
|
||||
|
@ -29,6 +29,34 @@ class QuestionController extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Get(path="/question/get-questions",
|
||||
* summary="Список вопросов",
|
||||
* description="Получение списка вопросов",
|
||||
* security={
|
||||
* {"bearerAuth": {}}
|
||||
* },
|
||||
* tags={"Tests"},
|
||||
* @OA\Parameter(
|
||||
* name="user",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* description="UUID анкеты назначеной пользователю",
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Возвращает масив вопросов",
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(ref="#/components/schemas/QuestionExampleArr"),
|
||||
* ),
|
||||
*
|
||||
*
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
@ -27,6 +27,34 @@ class UserQuestionnaireController extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Get(path="/user-questionnaire/questionnaires-list",
|
||||
* summary="Список тестов",
|
||||
* description="Получение списка тестов",
|
||||
* security={
|
||||
* {"bearerAuth": {}}
|
||||
* },
|
||||
* tags={"Tests"},
|
||||
* @OA\Parameter(
|
||||
* name="user_id",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* )
|
||||
* ),
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Возвращает массив объектов тест",
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(ref="#/components/schemas/UserQuestionnaireArrExample"),
|
||||
* ),
|
||||
* ),
|
||||
*
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionQuestionnairesList($user_id): array
|
||||
@ -42,6 +70,32 @@ class UserQuestionnaireController extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Get(path="/user-questionnaire/questionnaire-completed",
|
||||
* summary="Проверка теста",
|
||||
* description="Выполнения проверки теста",
|
||||
* security={
|
||||
* {"bearerAuth": {}}
|
||||
* },
|
||||
* tags={"Tests"},
|
||||
* @OA\Parameter(
|
||||
* name="user_questionnaire_uuid",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Возвращает объект Запроса",
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(ref="#/components/schemas/UserQuestionnaireExample"),
|
||||
* ),
|
||||
*
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
* @throws ServerErrorHttpException
|
||||
*/
|
||||
@ -55,6 +109,37 @@ class UserQuestionnaireController extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Get(path="/user-questionnaire/get-points-number",
|
||||
* summary="Количество балов в тесте",
|
||||
* description="Возвращает максимальное количество балов за тест",
|
||||
* security={
|
||||
* {"bearerAuth": {}}
|
||||
* },
|
||||
* tags={"Tests"},
|
||||
* @OA\Parameter(
|
||||
* name="user_questionnaire_uuid",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Возвращает максимально возможное количество балов за тест",
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(
|
||||
* @OA\Property(
|
||||
* property="sum_point",
|
||||
* type="integer",
|
||||
* example="61",
|
||||
* ),
|
||||
* ),
|
||||
* ),
|
||||
*
|
||||
* ),
|
||||
* )
|
||||
* @throws ServerErrorHttpException
|
||||
*/
|
||||
public function actionGetPointsNumber($user_questionnaire_uuid)
|
||||
@ -67,6 +152,37 @@ class UserQuestionnaireController extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Get(path="/user-questionnaire/get-question-number",
|
||||
* summary="Число вопросов в тесте",
|
||||
* description="Возвращает число вопросов в тесте",
|
||||
* security={
|
||||
* {"bearerAuth": {}}
|
||||
* },
|
||||
* tags={"Tests"},
|
||||
* @OA\Parameter(
|
||||
* name="user_questionnaire_uuid",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Возвращает число вопросов в тесте",
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(
|
||||
* @OA\Property(
|
||||
* property="question_number",
|
||||
* type="integer",
|
||||
* example="61",
|
||||
* ),
|
||||
* ),
|
||||
* ),
|
||||
*
|
||||
* ),
|
||||
* )
|
||||
* @throws ServerErrorHttpException
|
||||
*/
|
||||
public function actionGetQuestionNumber($user_questionnaire_uuid)
|
||||
|
@ -20,6 +20,61 @@ class UserResponseController extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Post(path="/user-response/set-response",
|
||||
* summary="Добавить ответ пользователя",
|
||||
* description="Добавление ответа на вопрос от пользователя",
|
||||
* security={
|
||||
* {"bearerAuth": {}}
|
||||
* },
|
||||
* tags={"Tests"},
|
||||
* @OA\Parameter(
|
||||
* name="user_id",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* description="ID пользователя",
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Parameter(
|
||||
* name="question_id",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* description="ID вопроса",
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Parameter(
|
||||
* name="response_body",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* description="Ответ пользователя",
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Parameter(
|
||||
* name="user_questionnaire_uuid",
|
||||
* in="query",
|
||||
* required=true,
|
||||
* description="UUID анкеты назначенной пользователю",
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* )
|
||||
* ),
|
||||
*
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Возвращает ответ",
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(ref="#/components/schemas/UserResponseExample"),
|
||||
* ),
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @throws InvalidConfigException
|
||||
* @throws ServerErrorHttpException|BadRequestHttpException
|
||||
*/
|
||||
@ -33,6 +88,53 @@ class UserResponseController extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Post(path="/user-response/set-responses",
|
||||
* summary="Добавить массив ответов пользователя",
|
||||
* description="Добавление массива ответов на вопросы от пользователя",
|
||||
* security={
|
||||
* {"bearerAuth": {}}
|
||||
* },
|
||||
* tags={"Tests"},
|
||||
* @OA\RequestBody(
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/x-www-form-urlencoded",
|
||||
* @OA\Schema(
|
||||
* required={"request_id"},
|
||||
* @OA\Property(
|
||||
* property="user_id",
|
||||
* type="integer",
|
||||
* description="Идентификатор пользователя",
|
||||
* nullable=false,
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_id",
|
||||
* type="integer",
|
||||
* description="Идентификатор вопроса",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="response_body",
|
||||
* type="string",
|
||||
* description="UUID анкеты назначенной пользователю",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="user_questionnaire_uuid",
|
||||
* type="string",
|
||||
* description="UUID анкеты назначенной пользователю",
|
||||
* ),
|
||||
* ),
|
||||
* ),
|
||||
* ),
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Возвращает объект Запроса",
|
||||
* @OA\MediaType(
|
||||
* mediaType="application/json",
|
||||
* @OA\Schema(ref="#/components/schemas/UserResponseExampleArr"),
|
||||
* ),
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @throws InvalidConfigException
|
||||
* @throws ServerErrorHttpException|BadRequestHttpException
|
||||
*/
|
||||
|
Reference in New Issue
Block a user