Skip to content

Commit

Permalink
unnecesary code
Browse files Browse the repository at this point in the history
  • Loading branch information
uo288574 committed Apr 26, 2024
1 parent aebdfeb commit f25b65b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions webapp/src/components/game/GameConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,16 @@ const GameConfiguration = () => {
}
}

// const handleChange = (event) => {
// setNumeroErrores(event.target.value);
// };

const initiateGame = async () => {
console.log(tematicasSeleccionadas)
console.log(numPreguntas)
await generateGameId();
await getQuestions()
console.log(questions)
await getQuestions();
//isApiCalledRef = true//ASK - is this necessary?
// navigation("/firstGame", {state: {questions, gameId}})
}

const generateGameId = async () => {
try {
const response = await axios.get(`${apiEndpoint}/generateGame`)
console.log(response.data)
gameId = response.data
} catch(error) {
console.error(error);
Expand All @@ -102,9 +94,7 @@ const GameConfiguration = () => {
const getQuestions = async () => {
try {
const topicsFormated = formatearTopics()
console.log(topicsFormated)
const response = await axios.get(`${apiEndpoint}/questions?n_preguntas=${numPreguntas}&n_respuestas=${numRes}${topicsFormated}`);
console.log(response.data.length)
for (var i = 0; i < response.data.length; i++) {
var possibleAnswers = [response.data[i].respuesta_correcta]
for (var j = 0; j < response.data[i].respuestas_incorrectas.length; j++) {
Expand Down

0 comments on commit f25b65b

Please sign in to comment.