4 Commits

Author SHA1 Message Date
alexis 99ceae2c5a add intervalo tiempo 2026-10-01 10:54:37 +02:00
alexis 7c77dcdd68 revert b765181b3f
revert add tiempo de respuesta
2026-10-01 10:53:52 +02:00
alexis b765181b3f add tiempo de respuesta 2026-10-01 09:09:38 +02:00
profesor ab9f014baf Actualizar resultados.php 2026-10-01 08:55:25 +02:00
8 changed files with 176 additions and 181 deletions
+1 -1
View File
@@ -71,7 +71,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-kahoot-register" id="btnCrearSala">Crear sala</button>
<button type="button" class="btn btn-kahoot-login" id="btnCrearSala">Crear sala</button>
</div>
</div>
</div>
+1 -2
View File
@@ -77,9 +77,8 @@
}
.btn-unirse:hover {
background-color: #1f6f09;
background-color: #0f56ab;
color: white;
transform: translateY(-2px);
}
.modal-kahoot {
-15
View File
@@ -401,18 +401,3 @@
}
}
.modal-kahoot {
border: none;
border-radius: 20px;
overflow: hidden;
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}
.modal-kahoot-header {
background-color: var(--kahoot-purple);
color: white;
border-bottom: none;
}
+1 -1
View File
@@ -276,7 +276,7 @@ $(document).on("click", ".btn-abandonar-sala", function () {
mensaje.text(
"Si abandonas la sala como anfitrión, la partida terminará para todos los jugadores.",
);
botonConfirmar.text("Sí, terminar partida");
botonConfirmar.text("Sí, abandonar");
} else {
titulo.text("¿Abandonar la sala?");
mensaje.text(
+5 -5
View File
@@ -36,11 +36,11 @@ function renderizarTablaRanking(jugadores) {
<thead class="table-dark">
<tr>
<th scope="col" style="width: 10%;">#</th>
<th scope="col" class="text-start" style="width: 30%;"><i class="fa-solid fa-user"></i> <br> Jugador</th>
<th scope="col" style="width: 15%;"><i class="fa-solid fa-trophy text-warning me-1"></i> <br> Victorias</th>
<th scope="col" style="width: 15%;"><i class="fa-solid fa-xmark text-danger me-1"></i> <br> Derrotas</th>
<th scope="col" style="width: 15%;"><i class="fa-solid fa-bullseye text-success me-1"></i> <br> Aciertos</th>
<th scope="col" style="width: 15%;"><i class="fa-solid fa-medal text-info me-1"></i> <br> Efectividad</th>
<th scope="col" class="text-start" style="width: 35%;">Jugador</th>
<th scope="col" style="width: 15%;"><i class="fa-solid fa-trophy text-warning me-1"></i> Vic</th>
<th scope="col" style="width: 15%;"><i class="fa-solid fa-xmark text-danger me-1"></i> Der</th>
<th scope="col" style="width: 15%;"><i class="fa-solid fa-bullseye text-success me-1"></i> Aciertos</th>
<th scope="col" style="width: 10%;"><i class="fa-solid fa-percent text-info me-1"></i> % Vic</th>
</tr>
</thead>
<tbody>
+11
View File
@@ -18,6 +18,8 @@ let preguntas = [];
let indice = 0; // pregunta que se está mostrando
let bloqueado = false; // true mientras se envía una respuesta o se ve el feedback
let numeroAciertos = 0; // número de aciertos del jugador
let tiempoRespuesta = 0;
let intervaloTiempo;
$(document).ready(function () {
@@ -81,6 +83,11 @@ function cargarPreguntas() {
// 2. Pintar la pregunta actual y sus respuestas
function mostrarPregunta() {
console.log("entro en mostrarPregunta");
tiempoRespuesta = 0;
intervaloTiempo = setInterval(function () {
tiempoRespuesta++;
}, 100);
const pregunta = preguntas[indice];
bloqueado = false;
@@ -111,6 +118,9 @@ function mostrarPregunta() {
// 3. El usuario pulsa una respuesta: se guarda y se enseña si ha acertado
function responder($botonPulsado) {
console.log("entro en responder");
clearInterval(intervaloTiempo);
console.log("Tiempo de respuesta: " + tiempoRespuesta /10 + " segundos");
if (bloqueado) {
return;
}
@@ -131,6 +141,7 @@ function responder($botonPulsado) {
idPartida: idPartida,
idPartidaxPregunta: pregunta.idPartidaxPregunta,
idRespuesta: idRespuesta,
tiempoRespuesta: tiempoRespuesta,
},
success: function (datos) {
if (datos.error) {
+1 -1
View File
@@ -293,7 +293,7 @@ $avatarUsuario = htmlspecialchars($_SESSION['avatar'] ?? 'img/avatars/defaultPro
Cancelar
</button>
<button type="submit" form="formCrearPregunta" class="btn btn-kahoot-register" id="btnCrearPregunta">
<button type="submit" form="formCrearPregunta" class="btn btn-kahoot-login" id="btnCrearPregunta">
<i class="bi bi-check-lg me-1"></i>
Crear pregunta
</button>
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/conexionBD.php';
require_once 'includes/conexionBD.php';
$idPartida = intval($_GET['idPartida'] ?? 0);
if ($idPartida <= 0) {