mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
Merge branch 'master' of gitlab.prodcontest.ru:team-15/project
This commit is contained in:
@@ -5,21 +5,21 @@
|
|||||||
|
|
||||||
## Запуск
|
## Запуск
|
||||||
|
|
||||||
Склонируйте репозиторий и пропишите
|
Склонируйте репозиторий и пропишите.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
## Основные ручки
|
## Важные эндпоинты
|
||||||
|
|
||||||
* `/` - основное приложение
|
* `/` - интерфейс
|
||||||
* `/api/v1/docs` - swagger-ui документация
|
* `/api/v1/docs` - swagger-ui документация
|
||||||
* `/admin` - админка
|
* `/admin/` - админка
|
||||||
* `/admin/grafana` - графана
|
* `/admin/grafana` - графана
|
||||||
* `/docs` - гайд по анализу данных
|
* `/docs` - обучающие материалы по анализу данных
|
||||||
|
|
||||||
После запуска по методу выше создается пользователь в админке (`/admin`) с данными ниже:`admin`
|
После запуска по методу выше создается пользователь в админке (`/admin/`) с данными ниже:`admin`
|
||||||
- `admin` - логин
|
- `admin` - логин
|
||||||
- `proooooood` - пароль
|
- `proooooood` - пароль
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,768 @@
|
|||||||
|
{
|
||||||
|
"info": {
|
||||||
|
"_postman_id": "fd33ed4f-84b5-4045-b926-22d989876fb0",
|
||||||
|
"name": "Datarush tests",
|
||||||
|
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
|
||||||
|
"_exporter_id": "29887339"
|
||||||
|
},
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "User",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "Correct registration",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"// Генерация случайных данных\r",
|
||||||
|
"const randomNamePrefix = `company_${Math.random().toString(36).substring(2, 8)}`;\r",
|
||||||
|
"const randomUsername = `${Math.random().toString(36).substring(3, 9)}`\r",
|
||||||
|
"const randomEmail = `${Math.random().toString(36).substring(2, 8)}@timka.test`;\r",
|
||||||
|
"const randomPassword = `${Math.random().toString(36).substring(2, 12)}!A1`;\r",
|
||||||
|
"\r",
|
||||||
|
"// Формирование тела запроса\r",
|
||||||
|
"const requestData = {\r",
|
||||||
|
" username: randomUsername,\r",
|
||||||
|
" email: randomEmail,\r",
|
||||||
|
" password: randomPassword\r",
|
||||||
|
"};\r",
|
||||||
|
"\r",
|
||||||
|
"// Сохранение данных в переменные окружения\r",
|
||||||
|
"pm.environment.set(\"randomNamePrefix\", randomNamePrefix);\r",
|
||||||
|
"pm.environment.set(\"randomEmail\", randomEmail);\r",
|
||||||
|
"pm.environment.set(\"randomPassword\", randomPassword);\r",
|
||||||
|
"pm.environment.set(\"randomUsername\", randomUsername)\r",
|
||||||
|
"\r",
|
||||||
|
"// Сохранение JSON-объекта в переменную для дальнейшего использования\r",
|
||||||
|
"pm.environment.set(\"requestData\", JSON.stringify(requestData));\r",
|
||||||
|
"pm.environment.set(\"requestNameREGISTRATION\", JSON.stringify(randomNamePrefix));\r",
|
||||||
|
"pm.environment.set(\"requestEmailREGISTRATION\", JSON.stringify(randomEmail));\r",
|
||||||
|
"pm.environment.set(\"requestusernameREGISTRATION\", JSON.stringify(randomUsername))\r",
|
||||||
|
"pm.environment.set(\"requestPasswordREGISTRATION\", JSON.stringify(randomPassword));"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 201', function () {\r",
|
||||||
|
" pm.response.to.have.status(201);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has token', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData.token).to.be.a('string');\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{{requestData}}",
|
||||||
|
"options": {
|
||||||
|
"raw": {
|
||||||
|
"language": "json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": "{{BASE_HOST}}/v1/sign-up"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Correct sign in",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"const email = pm.environment.get(\"randomEmail\")\r",
|
||||||
|
"const password = pm.environment.get(\"randomPassword\")\r",
|
||||||
|
"\r",
|
||||||
|
"const requestData = {\r",
|
||||||
|
" email: email,\r",
|
||||||
|
" password: password\r",
|
||||||
|
"}\r",
|
||||||
|
"pm.environment.set(\"requestData\", JSON.stringify(requestData));\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has token', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData.token).to.be.a('string');\r",
|
||||||
|
" pm.environment.set(\"token\", jsonData.token)\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{{requestData}}",
|
||||||
|
"options": {
|
||||||
|
"raw": {
|
||||||
|
"language": "json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": "{{BASE_HOST}}/v1/sign-in"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Duplicated reg data",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"const email = pm.environment.get(\"randomEmail\")\r",
|
||||||
|
"const password = pm.environment.get(\"randomPassword\")\r",
|
||||||
|
"const username = pm.environment.get(\"randomUsername\")\r",
|
||||||
|
"\r",
|
||||||
|
"const requestData = {\r",
|
||||||
|
" email: email,\r",
|
||||||
|
" password: password,\r",
|
||||||
|
" username: username\r",
|
||||||
|
"}\r",
|
||||||
|
"pm.environment.set(\"requestData\", JSON.stringify(requestData));\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 409', function () {\r",
|
||||||
|
" pm.response.to.have.status(409);\r",
|
||||||
|
"});\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{{requestData}}",
|
||||||
|
"options": {
|
||||||
|
"raw": {
|
||||||
|
"language": "json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": "{{BASE_HOST}}/v1/sign-up"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Reg without username",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"const email = pm.environment.get(\"randomEmail\")\r",
|
||||||
|
"const password = pm.environment.get(\"randomPassword\")\r",
|
||||||
|
"\r",
|
||||||
|
"const requestData = {\r",
|
||||||
|
" email: email,\r",
|
||||||
|
" password: password\r",
|
||||||
|
"}\r",
|
||||||
|
"pm.environment.set(\"requestData\", JSON.stringify(requestData));\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 400', function () {\r",
|
||||||
|
" pm.response.to.have.status(400);\r",
|
||||||
|
"});\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{{requestData}}",
|
||||||
|
"options": {
|
||||||
|
"raw": {
|
||||||
|
"language": "json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": "{{BASE_HOST}}/v1/sign-up"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Competitions",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "Get competition with no partipication",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has only 2 elements', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData).to.has.length(2,\"Response has non-2 length, try to reset to only test data state\");\r",
|
||||||
|
" pm.environment.set(\"competition_id\", jsonData[0].id)\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "{{BASE_HOST}}/v1/competitions?is_participating=false",
|
||||||
|
"host": [
|
||||||
|
"{{BASE_HOST}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"v1",
|
||||||
|
"competitions"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "is_participating",
|
||||||
|
"value": "false"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Get competition with partipication",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has only 2 elements', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData).to.has.length(0,\"Response has non-0 length, try to reset to only test data state\");\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "{{BASE_HOST}}/v1/competitions?is_participating=true",
|
||||||
|
"host": [
|
||||||
|
"{{BASE_HOST}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"v1",
|
||||||
|
"competitions"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "is_participating",
|
||||||
|
"value": "true"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Get tasks without partipicating in test",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 403', function () {\r",
|
||||||
|
" pm.response.to.have.status(403);\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": "{{BASE_HOST}}/v1/competitions/{{competition_id}}/tasks"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Submit task sol without partipicaating",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 403', function () {\r",
|
||||||
|
" pm.response.to.have.status(403);\r",
|
||||||
|
"});\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "formdata",
|
||||||
|
"formdata": [
|
||||||
|
{
|
||||||
|
"key": "file",
|
||||||
|
"type": "file",
|
||||||
|
"src": "/C:/Users/timka/AppData/Local/Postman/app-11.33.4/libGLESv2.dll"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"url": "{{BASE_HOST}}/v1/competitions/{{competition_id}}/tasks/{{task_id}}/submit"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Partipicate in competition",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"url": "{{BASE_HOST}}/v1/competitions/{{competition_id}}/start"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Get competition tasks",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has tasks', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.environment.set(\"task_id\", jsonData[0].id)\r",
|
||||||
|
" pm.expect(jsonData).to.has.length(9)\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": "{{BASE_HOST}}/v1/competitions/{{competition_id}}/tasks"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Get task history",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has token', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData).to.has.length(0);\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": "{{BASE_HOST}}/v1/competitions/{{competition_id}}/tasks/{{task_id}}/history"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Submit task sol",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has submission id', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData.submission_id).to.be.a('string');\r",
|
||||||
|
" pm.environment.set(\"sub_id\", jsonData.submission_id)\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "formdata",
|
||||||
|
"formdata": [
|
||||||
|
{
|
||||||
|
"key": "file",
|
||||||
|
"type": "file",
|
||||||
|
"src": "/C:/Users/timka/AppData/Local/Postman/app-11.33.4/libGLESv2.dll"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"url": "{{BASE_HOST}}/v1/competitions/{{competition_id}}/tasks/{{task_id}}/submit"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Get task attachments",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has empty array', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData).to.has.length(0);\r",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": {
|
||||||
|
"token": "{{token}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": "{{BASE_HOST}}/v1/competitions/{{competition_id}}/tasks/{{task_id}}/attachments"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Revieews",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "Get reviewer profile",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has correct data', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData.name).to.eq(pm.environment.get(\"reviewer_name\"));\r",
|
||||||
|
" pm.expect(jsonData.surname).to.eq(pm.environment.get(\"reviewer_surname\"))\r",
|
||||||
|
"});\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": "{{BASE_HOST}}/v1/review/{{reviewer_key}}"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Get submissions",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
"pm.test('Response has correct data', function () {\r",
|
||||||
|
" const jsonData = pm.response.json();\r",
|
||||||
|
" pm.expect(jsonData).to.has.length(0)\r",
|
||||||
|
"});\r",
|
||||||
|
"\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": "{{BASE_HOST}}/v1/review/{{reviewer_key}}/submissions/{{sub_id}}"
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Healthcheck",
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"exec": [
|
||||||
|
"pm.test('Status code is 200', function () {\r",
|
||||||
|
" pm.response.to.have.status(200);\r",
|
||||||
|
"});\r",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "{{BASE_HOST}}/health?format=json",
|
||||||
|
"host": [
|
||||||
|
"{{BASE_HOST}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"health"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "format",
|
||||||
|
"value": "json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {},
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"type": "text/javascript",
|
||||||
|
"packages": {},
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"variable": [
|
||||||
|
{
|
||||||
|
"key": "BASE_HOST",
|
||||||
|
"value": "https://prod-team-15-2pc0i3lc.final.prodcontest.ru/api",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "requestData",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "token",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "competition_id",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "task_id",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reviewer_key",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reviewer_name",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reviewer_surname",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sub_id",
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
|
from sys import stdout
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models import Count, Q
|
from django.db.models import Count, Q
|
||||||
|
from django.core.exceptions import ValidationError
|
||||||
from mdeditor.fields import MDTextField
|
from mdeditor.fields import MDTextField
|
||||||
|
|
||||||
from apps.competition.models import Competition
|
from apps.competition.models import Competition
|
||||||
@@ -78,6 +80,36 @@ class CompetitionTask(BaseModel):
|
|||||||
verbose_name="кол-во проверяющих для зачета задачи",
|
verbose_name="кол-во проверяющих для зачета задачи",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def clean(self):
|
||||||
|
super().clean()
|
||||||
|
if self.correct_answer_file and self.type not in ["checker", "input"]:
|
||||||
|
raise ValidationError({
|
||||||
|
"type": "Если загружен файл правильного ответа, то тип проверки не может быть ручным"
|
||||||
|
})
|
||||||
|
elif not self.correct_answer_file and self.type == "review":
|
||||||
|
raise ValidationError({
|
||||||
|
"correct_answer_file": "Загрузите правильный ответ"
|
||||||
|
})
|
||||||
|
|
||||||
|
if self.answer_file_path and not self.type == "checker":
|
||||||
|
raise ValidationError({
|
||||||
|
"type": "Укажите другой тип задания: этот не совместим с путем правильного ответа"
|
||||||
|
})
|
||||||
|
elif not self.answer_file_path and self.type == "checker":
|
||||||
|
raise ValidationError({
|
||||||
|
"answer_file_path": "Введите путь правильного ответа - это нужно для корректной работы чекера"
|
||||||
|
})
|
||||||
|
|
||||||
|
if not self.reviewers and self.type == "review":
|
||||||
|
raise ValidationError({
|
||||||
|
"reviewers": "Загрузите ревьюверов - кто будет проверять задания, если не они?"
|
||||||
|
})
|
||||||
|
elif self.reviewers and not self.type == "review":
|
||||||
|
raise ValidationError({
|
||||||
|
"type": "Проверьте тип - вы ввели ревьюверов, но задание не является ручным"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
|
|||||||
@@ -30,12 +30,13 @@ export const Header = () => {
|
|||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<a
|
<a
|
||||||
href="/docs/"
|
href="/docs/"
|
||||||
className="text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors flex items-center gap-1"
|
className="hidden md:flex text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors items-center gap-1"
|
||||||
>
|
>
|
||||||
<FileText className="h-4 w-4" />
|
<FileText className="h-4 w-4" />
|
||||||
</a>
|
Материалы
|
||||||
|
</a>
|
||||||
|
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
@@ -50,6 +51,16 @@ export const Header = () => {
|
|||||||
<Link to="/profile">
|
<Link to="/profile">
|
||||||
<DropdownMenuItem>Аккаунт</DropdownMenuItem>
|
<DropdownMenuItem>Аккаунт</DropdownMenuItem>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
|
<div className="md:hidden">
|
||||||
|
<Link to="/docs">
|
||||||
|
<DropdownMenuItem>
|
||||||
|
<FileText className="h-4 w-4 mr-2" />
|
||||||
|
Материалы
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
|
|||||||
+59
-18
@@ -1,8 +1,9 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Link, useNavigate } from 'react-router-dom';
|
import { Link, useNavigate, useParams } from 'react-router-dom';
|
||||||
import { Task } from '@/shared/types/task';
|
import { Task } from '@/shared/types/task';
|
||||||
import { ArrowLeft, Clock } from 'lucide-react';
|
import { ArrowLeft } from 'lucide-react';
|
||||||
import { CompetitionType } from '@/shared/types/competition';
|
import { CompetitionType } from '@/shared/types/competition';
|
||||||
|
import { CompetitionResult } from '@/shared/types/competition';
|
||||||
|
|
||||||
interface CompetitionHeaderProps {
|
interface CompetitionHeaderProps {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -11,8 +12,9 @@ interface CompetitionHeaderProps {
|
|||||||
setAnswer: (value: string) => void;
|
setAnswer: (value: string) => void;
|
||||||
setSelectedFile: (file: File | null) => void;
|
setSelectedFile: (file: File | null) => void;
|
||||||
competitionType?: CompetitionType;
|
competitionType?: CompetitionType;
|
||||||
startDate?: Date;
|
startDate?: Date | string;
|
||||||
endDate?: Date;
|
endDate?: Date | string;
|
||||||
|
taskResults?: CompetitionResult[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const CompetitionHeader: React.FC<CompetitionHeaderProps> = ({
|
const CompetitionHeader: React.FC<CompetitionHeaderProps> = ({
|
||||||
@@ -23,9 +25,11 @@ const CompetitionHeader: React.FC<CompetitionHeaderProps> = ({
|
|||||||
setSelectedFile,
|
setSelectedFile,
|
||||||
competitionType,
|
competitionType,
|
||||||
startDate,
|
startDate,
|
||||||
endDate
|
endDate,
|
||||||
|
taskResults = []
|
||||||
}) => {
|
}) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const { taskId } = useParams<{ taskId?: string }>();
|
||||||
const [timeLeft, setTimeLeft] = useState<string>('');
|
const [timeLeft, setTimeLeft] = useState<string>('');
|
||||||
|
|
||||||
const handleTaskSelect = (taskId: string) => {
|
const handleTaskSelect = (taskId: string) => {
|
||||||
@@ -34,7 +38,7 @@ const CompetitionHeader: React.FC<CompetitionHeaderProps> = ({
|
|||||||
navigate(`/competition/${competitionId}/tasks/${taskId}`);
|
navigate(`/competition/${competitionId}/tasks/${taskId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatDate = (date?: Date) => {
|
const formatDate = (date?: Date | string) => {
|
||||||
if (!date) return '';
|
if (!date) return '';
|
||||||
|
|
||||||
const dateObj = typeof date === 'string' ? new Date(date) : date;
|
const dateObj = typeof date === 'string' ? new Date(date) : date;
|
||||||
@@ -74,6 +78,42 @@ const CompetitionHeader: React.FC<CompetitionHeaderProps> = ({
|
|||||||
return () => clearInterval(timerInterval);
|
return () => clearInterval(timerInterval);
|
||||||
}, [endDate, competitionId, navigate, competitionType]);
|
}, [endDate, competitionId, navigate, competitionType]);
|
||||||
|
|
||||||
|
const getTaskStatus = (task: Task) => {
|
||||||
|
const result = taskResults.find(r => r.task_name === task.title);
|
||||||
|
|
||||||
|
let bgColor = 'var(--color-task-uncleared)';
|
||||||
|
let textColor = 'var(--color-task-text-uncleared)';
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
if (result.result === -1) {
|
||||||
|
bgColor = 'var(--color-task-checking)';
|
||||||
|
textColor = 'var(--color-task-text-checking)';
|
||||||
|
} else if (result.result === -2) {
|
||||||
|
bgColor = 'var(--color-task-uncleared)';
|
||||||
|
textColor = 'var(--color-task-text-uncleared)';
|
||||||
|
} else if (result.result === 0) {
|
||||||
|
bgColor = 'var(--color-task-wrong)';
|
||||||
|
textColor = 'var(--color-task-text-wrong)';
|
||||||
|
} else if (result.result < result.max_points) {
|
||||||
|
bgColor = 'var(--color-task-partial)';
|
||||||
|
textColor = 'var(--color-task-text-partial)';
|
||||||
|
} else if (result.result === result.max_points) {
|
||||||
|
bgColor = 'var(--color-task-correct)';
|
||||||
|
textColor = 'var(--color-task-text-correct)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const isActive = task.id === taskId;
|
||||||
|
const activeBorder = isActive ? 'border-2 border-blue-500' : '';
|
||||||
|
|
||||||
|
return {
|
||||||
|
backgroundColor: bgColor,
|
||||||
|
color: textColor,
|
||||||
|
className: `rounded-lg px-3 py-1.5 font-medium text-sm font-hse-sans cursor-pointer
|
||||||
|
transition-all hover:brightness-95 flex-shrink-0 ${activeBorder}`
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const showTimeSection = competitionType === CompetitionType.COMPETITIVE && (startDate || endDate);
|
const showTimeSection = competitionType === CompetitionType.COMPETITIVE && (startDate || endDate);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -120,18 +160,19 @@ const CompetitionHeader: React.FC<CompetitionHeaderProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-center gap-4 pb-4 overflow-x-auto no-scrollbar">
|
<div className="flex items-center justify-center gap-4 pb-4 overflow-x-auto no-scrollbar">
|
||||||
{tasks.map((task) => (
|
{tasks.map((task) => {
|
||||||
<button
|
const { backgroundColor, color, className } = getTaskStatus(task);
|
||||||
key={task.id}
|
return (
|
||||||
className={`text-[var(--color-task-text-uncleared)] bg-[var(--color-task-uncleared)]
|
<button
|
||||||
rounded-lg px-3 py-1.5 font-medium text-sm font-hse-sans cursor-pointer
|
key={task.id}
|
||||||
transition-all hover:brightness-95 flex-shrink-0
|
style={{ backgroundColor, color }}
|
||||||
`}
|
className={className}
|
||||||
onClick={() => handleTaskSelect(task.id)}
|
onClick={() => handleTaskSelect(task.id)}
|
||||||
>
|
>
|
||||||
{task.in_competition_position}
|
{task.in_competition_position}
|
||||||
</button>
|
</button>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useParams, Navigate, useNavigate } from "react-router-dom";
|
import { useParams, Navigate } from "react-router-dom";
|
||||||
import CompetitionHeader from "./components/CompetitionHeader";
|
import CompetitionHeader from "./components/CompetitionHeader";
|
||||||
import TaskContent from "./components/TaskContent";
|
import TaskContent from "./components/TaskContent";
|
||||||
import TaskSolution from "./modules/TaskSolution";
|
import TaskSolution from "./modules/TaskSolution";
|
||||||
import { getCompetitionTasks, submitTaskSolution } from "@/shared/api/session";
|
import { getCompetitionTasks, submitTaskSolution } from "@/shared/api/session";
|
||||||
import { getCompetition } from "@/shared/api/competitions";
|
import { getCompetition, getCompetitionResults } from "@/shared/api/competitions";
|
||||||
import { Loader2 } from "lucide-react";
|
import { Loader2 } from "lucide-react";
|
||||||
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { TaskType } from "@/shared/types/task";
|
import { TaskType } from "@/shared/types/task";
|
||||||
@@ -16,7 +16,6 @@ const CompetitionSession = () => {
|
|||||||
const [isReloading, setIsReloading] = useState(false);
|
const [isReloading, setIsReloading] = useState(false);
|
||||||
const competitionId = id || "";
|
const competitionId = id || "";
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const competitionQuery = useQuery({
|
const competitionQuery = useQuery({
|
||||||
queryKey: ["competition", competitionId],
|
queryKey: ["competition", competitionId],
|
||||||
@@ -30,6 +29,12 @@ const CompetitionSession = () => {
|
|||||||
enabled: !!competitionId,
|
enabled: !!competitionId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const resultsQuery = useQuery({
|
||||||
|
queryKey: ["competitionResults", competitionId],
|
||||||
|
queryFn: () => getCompetitionResults(competitionId),
|
||||||
|
enabled: !!competitionId,
|
||||||
|
});
|
||||||
|
|
||||||
const submitMutation = useMutation({
|
const submitMutation = useMutation({
|
||||||
mutationFn: () => {
|
mutationFn: () => {
|
||||||
if (!currentTask || !competitionId) throw new Error("Missing task or competition ID");
|
if (!currentTask || !competitionId) throw new Error("Missing task or competition ID");
|
||||||
@@ -47,10 +52,14 @@ const CompetitionSession = () => {
|
|||||||
queryKey: ['solutionHistory', competitionId, taskId]
|
queryKey: ['solutionHistory', competitionId, taskId]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: ['competitionResults', competitionId]
|
||||||
|
});
|
||||||
|
|
||||||
setIsReloading(true);
|
setIsReloading(true);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload()
|
window.location.reload();
|
||||||
setIsReloading(false);
|
setIsReloading(false);
|
||||||
}, 2500);
|
}, 2500);
|
||||||
},
|
},
|
||||||
@@ -61,6 +70,7 @@ const CompetitionSession = () => {
|
|||||||
|
|
||||||
const competition = competitionQuery.data;
|
const competition = competitionQuery.data;
|
||||||
const tasks = tasksQuery.data || [];
|
const tasks = tasksQuery.data || [];
|
||||||
|
const results = resultsQuery.data || [];
|
||||||
const isLoading = tasksQuery.isLoading || competitionQuery.isLoading;
|
const isLoading = tasksQuery.isLoading || competitionQuery.isLoading;
|
||||||
const error = tasksQuery.error || competitionQuery.error
|
const error = tasksQuery.error || competitionQuery.error
|
||||||
? "Не удалось загрузить данные. Пожалуйста, попробуйте позже."
|
? "Не удалось загрузить данные. Пожалуйста, попробуйте позже."
|
||||||
@@ -113,6 +123,7 @@ const CompetitionSession = () => {
|
|||||||
competitionType={competition?.type}
|
competitionType={competition?.type}
|
||||||
startDate={competition?.start_date}
|
startDate={competition?.start_date}
|
||||||
endDate={competition?.end_date}
|
endDate={competition?.end_date}
|
||||||
|
taskResults={results}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<main className="flex-1 bg-[#F8F8F8] pb-8">
|
<main className="flex-1 bg-[#F8F8F8] pb-8">
|
||||||
@@ -138,6 +149,16 @@ const CompetitionSession = () => {
|
|||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
isSubmitting={isSubmitting}
|
isSubmitting={isSubmitting}
|
||||||
/>
|
/>
|
||||||
|
{isReloading && (
|
||||||
|
<div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50">
|
||||||
|
<div className="bg-white p-6 rounded-lg shadow-xl text-center">
|
||||||
|
<Loader2 className="h-8 w-8 animate-spin mx-auto mb-4" />
|
||||||
|
<p className="font-hse-sans text-gray-700">
|
||||||
|
Решение отправлено! Пожалуйста, подождите...
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex h-40 items-center justify-center rounded-lg bg-white">
|
<div className="flex h-40 items-center justify-center rounded-lg bg-white">
|
||||||
|
|||||||
+1
-2
@@ -30,10 +30,9 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
|
|||||||
|
|
||||||
{isCleared ? (
|
{isCleared ? (
|
||||||
<Button
|
<Button
|
||||||
className="font-hse-sans flex-grow bg-green-600 hover:bg-green-700"
|
className="font-hse-sans flex-grow"
|
||||||
disabled={true}
|
disabled={true}
|
||||||
>
|
>
|
||||||
<CheckCircle className="mr-2 h-4 w-4" />
|
|
||||||
Задача сдана!
|
Задача сдана!
|
||||||
</Button>
|
</Button>
|
||||||
) : hasSubmissionsLeft ? (
|
) : hasSubmissionsLeft ? (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { User } from "@/shared/types/user";
|
|||||||
|
|
||||||
export const UserInfo = ({ user }: { user: User }) => {
|
export const UserInfo = ({ user }: { user: User }) => {
|
||||||
return (
|
return (
|
||||||
<section className="flex flex-1 flex-col items-center gap-6 text-center md:max-w-[420px] md:items-start md:text-ellipsis">
|
<section className="flex flex-1 flex-col items-center gap-6 text-center md:max-w-[420px] md:items-start md:text-left md:text-ellipsis">
|
||||||
{user.avatar && (
|
{user.avatar && (
|
||||||
<div className="aspect-square h-auto w-full max-w-[300px] overflow-hidden rounded-full border">
|
<div className="aspect-square h-auto w-full max-w-[300px] overflow-hidden rounded-full border">
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const UserStatsSections = () => {
|
|||||||
/>
|
/>
|
||||||
<UserStatBlock
|
<UserStatBlock
|
||||||
value={stats.total_attempts}
|
value={stats.total_attempts}
|
||||||
description="Попыток выполнено"
|
description="Решений отправлено"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ const ReviewContent = ({ review }: { review: Review }) => {
|
|||||||
<div className="flex flex-col gap-5">
|
<div className="flex flex-col gap-5">
|
||||||
<h2 className="text-3xl font-semibold">Ответ</h2>
|
<h2 className="text-3xl font-semibold">Ответ</h2>
|
||||||
|
|
||||||
<div className="bg-background rounded-xl px-5 py-3 text-lg">
|
<div className="bg-background rounded-xl px-5 py-3 text-lg break-words">
|
||||||
{extension === "txt" ? (
|
{extension === "txt" ? (
|
||||||
content
|
content
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user