Переписываю спорные решения

This commit is contained in:
2023-01-16 19:57:55 +03:00
parent 794a5fa44e
commit 549e0eac74
11 changed files with 51 additions and 87 deletions

View File

@ -1,5 +1,4 @@
import { Link } from 'react-router-dom'
import avatar from './../../../images/medium_male.png'
import React from 'react'
import './quiz.scss'
export const Progressbar = ({indexQuestion, width}) => {
@ -15,4 +14,4 @@ export const Progressbar = ({indexQuestion, width}) => {
</div>
</div>
)
}
};

View File

@ -11,12 +11,12 @@ export const Results = () => {
const dispatch = useDispatch();
const {apiRequest} = useRequest();
useEffect(async () => {
useEffect(() => {
dispatch(fetchResultTest(test.uuid));
apiRequest(`/user-questionnaire/get-points-number?user_questionnaire_uuid=${test.uuid}`)
.then((res) => setMaxScore(res.sum_point));
}, []);
}, [apiRequest, dispatch, test]);
return (
<div className={'result _container'}>

View File

@ -38,7 +38,7 @@ export const TaskQuiz = () => {
dispatch(fetchGetAnswers(response[0].id));
setStripValue((+index + 1) * 100 / response.length)
})
}, [dispatch, apiRequest]);
}, [dispatch]);
const nextQuestion = async (e) => {
e.preventDefault();