diff --git a/client/src/pages/presentationEditor/components/answerComponents/AnswerMatch.tsx b/client/src/pages/presentationEditor/components/answerComponents/AnswerMatch.tsx index 3d854b87112a990c28dfc92408bf254e15c2678f..df79a37d8c60a10ad4ae62d31db131de5023fbc2 100644 --- a/client/src/pages/presentationEditor/components/answerComponents/AnswerMatch.tsx +++ b/client/src/pages/presentationEditor/components/answerComponents/AnswerMatch.tsx @@ -58,7 +58,7 @@ const AnswerMatch = ({ variant, activeSlide, competitionId }: AnswerMultipleProp (alt) => alternative.alternative_order === alt.correct_order ) axios - .put(`/api/competitions/${competitionId}/teams/${teamId}/answers/question_alternatives/${alternative.id}`, { + .put(`/api/competitions/${competitionId}/teams/${teamId}/answers/${alternative.id}`, { answer: `${alternative.alternative} - ${answer?.correct}`, }) .then(() => { @@ -89,7 +89,7 @@ const AnswerMatch = ({ variant, activeSlide, competitionId }: AnswerMultipleProp const answeredText = answersCopy[index].correct if (!activeSlide) return axios - .put(`/api/competitions/${competitionId}/teams/${teamId}/answers/question_alternatives/${alternative.id}`, { + .put(`/api/competitions/${competitionId}/teams/${teamId}/answers/${alternative.id}`, { answer: `${alternative.alternative} - ${answeredText}`, }) .catch(console.log) diff --git a/client/src/pages/presentationEditor/components/answerComponents/AnswerMultiple.tsx b/client/src/pages/presentationEditor/components/answerComponents/AnswerMultiple.tsx index 039d9dfb558fa037d578566ef1b2280527f6c42b..d95c735507090f3d88a518f26bb216f506b9f661 100644 --- a/client/src/pages/presentationEditor/components/answerComponents/AnswerMultiple.tsx +++ b/client/src/pages/presentationEditor/components/answerComponents/AnswerMultiple.tsx @@ -51,7 +51,7 @@ const AnswerMultiple = ({ variant, activeSlide, competitionId }: AnswerMultipleP if (!activeSlide || (activeSlide?.timer !== null && !timer.enabled)) { return } - const url = `/api/competitions/${competitionId}/teams/${teamId}/answers/question_alternatives/${alternative.id}` + const url = `/api/competitions/${competitionId}/teams/${teamId}/answers/${alternative.id}` const payload = { answer: checked ? 1 : 0, } diff --git a/client/src/pages/presentationEditor/components/answerComponents/AnswerSingle.tsx b/client/src/pages/presentationEditor/components/answerComponents/AnswerSingle.tsx index 1ff4b7cf16542dbe4540234d0ee1f66a45c474c0..901e37c3de26930bff64d802ba685f46dfbaf112 100644 --- a/client/src/pages/presentationEditor/components/answerComponents/AnswerSingle.tsx +++ b/client/src/pages/presentationEditor/components/answerComponents/AnswerSingle.tsx @@ -57,11 +57,11 @@ const AnswerSingle = ({ variant, activeSlide, competitionId }: AnswerSingleProps // Unselect each radio button to only allow one selected alternative const alternatives = activeSlide.questions[0].alternatives for (const alt of alternatives) { - const url = `/api/competitions/${competitionId}/teams/${teamId}/answers/question_alternatives/${alt.id}` + const url = `/api/competitions/${competitionId}/teams/${teamId}/answers/${alt.id}` await axios.put(url, { answer: 0 }) } // Update selected alternative - const url = `/api/competitions/${competitionId}/teams/${teamId}/answers/question_alternatives/${alternative.id}` + const url = `/api/competitions/${competitionId}/teams/${teamId}/answers/${alternative.id}` await axios .put(url, { answer: 1 }) .then(() => { diff --git a/client/src/pages/presentationEditor/components/answerComponents/AnswerText.tsx b/client/src/pages/presentationEditor/components/answerComponents/AnswerText.tsx index b8048c750c433cbbce68fa521e98a4b7937f38d8..55fa6d8cb721e1d7ceb3b76f449cf49888e93796 100644 --- a/client/src/pages/presentationEditor/components/answerComponents/AnswerText.tsx +++ b/client/src/pages/presentationEditor/components/answerComponents/AnswerText.tsx @@ -50,7 +50,7 @@ const AnswerText = ({ activeSlide, competitionId }: AnswerTextProps) => { return } const alternative = activeSlide.questions[0].alternatives[0] - const url = `/api/competitions/${competitionId}/teams/${teamId}/answers/question_alternatives/${alternative.id}` + const url = `/api/competitions/${competitionId}/teams/${teamId}/answers/${alternative.id}` await axios .put(url, { answer }) .then(() => {