Add doc for tests
This commit is contained in:
59
frontend/modules/api/models/Answer.php
Normal file
59
frontend/modules/api/models/Answer.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="Answer",
|
||||
* @OA\Property(
|
||||
* property="id",
|
||||
* type="int",
|
||||
* example=1,
|
||||
* description="Идентификатор ответа"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_id",
|
||||
* type="int",
|
||||
* example="7",
|
||||
* description="Идентификатор вопроса"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_body",
|
||||
* type="string",
|
||||
* example="Вопрос №1",
|
||||
* description="Тело вопроса"
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="AnswerExampleArr",
|
||||
* type="array",
|
||||
* example={
|
||||
* {"id": "1", "question_id": 2, "question_body": "Ответ 1",},
|
||||
* {"id": "4", "question_id": 3, "question_body": "Ответ 22",},
|
||||
* },
|
||||
* @OA\Items(
|
||||
* type="object",
|
||||
* @OA\Property(
|
||||
* property="id",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_id",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_body",
|
||||
* type="string",
|
||||
* ),
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
*/
|
||||
class Answer extends \common\models\Answer
|
||||
{
|
||||
|
||||
}
|
89
frontend/modules/api/models/Question.php
Normal file
89
frontend/modules/api/models/Question.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="Question",
|
||||
* @OA\Property(
|
||||
* property="id",
|
||||
* type="int",
|
||||
* example=1,
|
||||
* description="Идентификатор вопроса"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_type_id",
|
||||
* type="int",
|
||||
* example="2",
|
||||
* description="Тип вопроса: 1 - Открытый вопрос; 2 - Один правильный ответ; 3 - Несколько вариантов ответа; 4 - 'Истина - ложь'"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_body",
|
||||
* type="string",
|
||||
* example="Вопрос №1",
|
||||
* description="Тело вопроса"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_priority",
|
||||
* type="int",
|
||||
* example="2",
|
||||
* description="Приоритет вопроса"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="next_question",
|
||||
* type="int",
|
||||
* example="5",
|
||||
* description="Следующий вопрос"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="time_limit",
|
||||
* type="string",
|
||||
* example="00:22:00",
|
||||
* description="Лимит времени на ответ"
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="QuestionExampleArr",
|
||||
* type="array",
|
||||
* example={
|
||||
* {"id": "1", "question_type_id": 2, "question_body": "Вопрос 1", "question_priority": 1, "next_question": 2, "time_limit": "00:10:00",},
|
||||
* {"id": "4", "question_type_id": 3, "question_body": "Вопрос 22", "question_priority": 4, "next_question": 5, "time_limit": "00:10:00",},
|
||||
* },
|
||||
* @OA\Items(
|
||||
* type="object",
|
||||
* @OA\Property(
|
||||
* property="id",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_type_id",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_body",
|
||||
* type="string",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_priority",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="next_question",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="time_limit",
|
||||
* type="string",
|
||||
* ),
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
*/
|
||||
class Question extends \common\models\Question
|
||||
{
|
||||
|
||||
}
|
103
frontend/modules/api/models/UserQuestionnaire.php
Normal file
103
frontend/modules/api/models/UserQuestionnaire.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="UserQuestionnaire",
|
||||
* @OA\Property(
|
||||
* property="user_id",
|
||||
* type="int",
|
||||
* example=1,
|
||||
* description="Идентификатор пользователя"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="uuid",
|
||||
* type="string",
|
||||
* example="d222f858-60fd-47fb-8731-dc9d5fc384c5",
|
||||
* description="uuid"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="score",
|
||||
* type="int",
|
||||
* example="11",
|
||||
* description="Количество балов за тест"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="status",
|
||||
* type="int",
|
||||
* example="2",
|
||||
* description="статус файла"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="percent_correct_answers",
|
||||
* type="float",
|
||||
* example="0.25",
|
||||
* description="Процент правильных ответов"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="testing_date",
|
||||
* type="string",
|
||||
* example="2022-03-17 11:14:22",
|
||||
* description="Дата тестирования"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="questionnaire_title",
|
||||
* type="string",
|
||||
* example="Анкета 1",
|
||||
* description="Название анкеты"
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="UserQuestionnaireExample",
|
||||
* type="array",
|
||||
* @OA\Items(
|
||||
* type="object",
|
||||
* ref="#/components/schemas/UserQuestionnaire",
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="UserQuestionnaireArrExample",
|
||||
* type="array",
|
||||
* example={
|
||||
* {"uuid": "d222f858-60fd-47fb-8731-dc9d5fc384c5", "score": 11, "status": 2, "percent_correct_answers": 0.25, "testing_date": "2022-04-03 09:23:45", "questionnaire_title": "Тест 2"},
|
||||
* {"uuid": "gcjs77d9-vtyd-02jh-9467-dc8fbb6s6jdb", "score": 20, "status": 2, "percent_correct_answers": 0.85, "testing_date": "2022-03-17 11:14:22", "questionnaire_title": "Тест 1"},
|
||||
* },
|
||||
* @OA\Items(
|
||||
* type="object",
|
||||
* @OA\Property(
|
||||
* property="uuid",
|
||||
* type="string",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="score",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="status",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="percent_correct_answers",
|
||||
* type="float",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="testing_date",
|
||||
* type="string",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="questionnaire_title",
|
||||
* type="string",
|
||||
* ),
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
*/
|
||||
class UserQuestionnaire extends \common\models\UserQuestionnaire
|
||||
{
|
||||
|
||||
}
|
102
frontend/modules/api/models/UserResponse.php
Normal file
102
frontend/modules/api/models/UserResponse.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="UserResponse",
|
||||
* @OA\Property(
|
||||
* property="user_id",
|
||||
* type="int",
|
||||
* example=1,
|
||||
* description="Идентификатор пользователя"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_id",
|
||||
* type="int",
|
||||
* example="7",
|
||||
* description="Идентификатор вопроса"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="response_body",
|
||||
* type="string",
|
||||
* example="Ответ",
|
||||
* description="Ответ пользователя"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="user_questionnaire_uuid",
|
||||
* type="string",
|
||||
* example="d222f858-60fd-47fb-8731-dc9d5fc384c5",
|
||||
* description="UUID анкеты назначенной пользователю"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="created_at",
|
||||
* type="string",
|
||||
* example="2021-10-20 13:06:12",
|
||||
* description="Дата создания"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="updated_at",
|
||||
* type="string",
|
||||
* example="2022-11-20 10:35:12",
|
||||
* description="Дата обновления"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="id",
|
||||
* type="integer",
|
||||
* example="5",
|
||||
* description="ID ответа"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="answer_flag",
|
||||
* type="bool",
|
||||
* example="0",
|
||||
* description="Флаг ответа"
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="UserResponseExample",
|
||||
* type="array",
|
||||
* @OA\Items(
|
||||
* type="object",
|
||||
* ref="#/components/schemas/UserResponse",
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="UserResponseExampleArr",
|
||||
* type="array",
|
||||
* example={
|
||||
* {"user_id": 23, "question_id": 22, "response_body": "Ответ 1", "user_questionnaire_uuid": "d222f858-60fd-47fb-8731-dc9d5fc384c5",},
|
||||
* {"user_id": 16, "question_id": 3, "response_body": "Ответ 22", "user_questionnaire_uuid": "d222f858-60fd-47fb-8731-dc9d5fc384c5",},
|
||||
* },
|
||||
* @OA\Items(
|
||||
* type="object",
|
||||
* @OA\Property(
|
||||
* property="user_id",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="question_id",
|
||||
* type="integer",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="response_body",
|
||||
* type="string",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="user_questionnaire_uuid",
|
||||
* type="string",
|
||||
* ),
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
*/
|
||||
class UserResponse extends \common\models\UserResponse
|
||||
{
|
||||
|
||||
}
|
Reference in New Issue
Block a user