diff --git a/src/front/src/components/testing/AssignTestDialog.vue b/src/front/src/components/testing/AssignTestDialog.vue new file mode 100644 index 000000000..b07df9347 --- /dev/null +++ b/src/front/src/components/testing/AssignTestDialog.vue @@ -0,0 +1,172 @@ + + + diff --git a/src/front/src/components/testing/BodyDetailTesting.vue b/src/front/src/components/testing/BodyDetailTesting.vue index 38fd63104..aa54a694d 100644 --- a/src/front/src/components/testing/BodyDetailTesting.vue +++ b/src/front/src/components/testing/BodyDetailTesting.vue @@ -11,9 +11,6 @@

Время на прохождение — {{ data?.time }} минут

-

- Срок окончания — {{ new Date(data?.dateend).toLocaleDateString() }} -

Попытка 1 из {{ data?.attemps_number }}

diff --git a/src/front/src/utils/axios-api.js b/src/front/src/utils/axios-api.js index 015dd44ca..3ad402c9f 100644 --- a/src/front/src/utils/axios-api.js +++ b/src/front/src/utils/axios-api.js @@ -244,16 +244,19 @@ async function createTest(testData) { } } -async function assignTest(testId, employeeIds) { +async function assignTest(testId, employeeIds, completionDate) { try { - const testDetails = await getTestDetail(testId); - const completion_date = testDetails.dateend; + if (!completionDate) { + // If no completion date provided, get it from test details + const testDetails = await getTestDetail(testId); + completionDate = testDetails.dateend; + } const userIds = Array.from(employeeIds).map(id => Number(id)); console.log('Назначение теста для пользователей:', userIds); const promises = userIds.map(userId => - assignTestToUser(userId, testId, completion_date) + assignTestToUser(userId, testId, completionDate) ); await Promise.all(promises); @@ -303,7 +306,7 @@ async function assignTestToUser(userId, testId, completionDate) { const response = await axiosApiInstance.post('/api/tests/testingview/', { user_id: Number(userId), test_id: Number(testId), - completion_date: new Date(completionDate).toISOString() + completion_date: completionDate }); return response.data; } catch (error) { diff --git a/src/front/src/views/TestHomePage.vue b/src/front/src/views/TestHomePage.vue index 164917116..79b6ba41f 100644 --- a/src/front/src/views/TestHomePage.vue +++ b/src/front/src/views/TestHomePage.vue @@ -37,14 +37,19 @@