Skip to content

Commit

Permalink
Merge pull request #61 from Arquisoft/webapp_interface
Browse files Browse the repository at this point in the history
Fixed problems for deployment by removing unused lines
  • Loading branch information
AbelMH1 authored Mar 14, 2024
2 parents 92e4b34 + 8574d17 commit 1c9192b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
6 changes: 1 addition & 5 deletions webapp/src/components/FirstGame.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React, { useState, useEffect } from 'react';
import React from 'react';
import { Container, Typography } from '@mui/material';
import './FirstGame.css';
import { CircularProgressbar } from 'react-circular-progressbar';
import 'react-circular-progressbar/dist/styles.css';
import axios from 'axios';
import { json } from 'react-router-dom';
import { useNavigate, useLocation } from 'react-router-dom';


Expand All @@ -17,7 +15,6 @@ const Quiz = () => {
var questions = useLocation().state.questions;

const [currentQuestionIndex, setCurrentQuestionIndex] = React.useState(0);
const [selectedOption, setSelectedOption] = React.useState(null);
const [isCorrect, setIsCorrect] = React.useState(null);

const esperar = (ms) => {
Expand Down Expand Up @@ -73,7 +70,6 @@ const Quiz = () => {
const checkAnswer = async (option) => {
getQuestions()
setIsCorrect(option === questions[currentQuestionIndex].correctAnswer);
setSelectedOption(option);

const botonIncorrecta = document.getElementById('option-' + questions[currentQuestionIndex].options.indexOf(option))
if (!isCorrect) {
Expand Down
8 changes: 2 additions & 6 deletions webapp/src/components/Menu.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import React, { useState, useEffect } from 'react';
import { Container, Typography } from '@mui/material';
import React, { useState } from 'react';
import { Container } from '@mui/material';
import './FirstGame.css';
import 'react-circular-progressbar/dist/styles.css';
import axios from 'axios';
import { json } from 'react-router-dom';
import { useNavigate } from 'react-router-dom'; // Importa useHistory

const apiEndpoint = 'http://localhost:8007';

var jsonApi = ''

var isApiCalledRef = false;


const DatosContext = React.createContext();

var questions = []

function secureRandomNumber(max) {
Expand Down
3 changes: 0 additions & 3 deletions webapp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import App from './App';
import reportWebVitals from './reportWebVitals';

import {
createBrowserRouter,
RouterProvider,
Route,
Routes,
useNavigate,
MemoryRouter
as Router
} from "react-router-dom";
Expand Down

0 comments on commit 1c9192b

Please sign in to comment.