Skip to content

Commit

Permalink
Pruebas de Usabilidad v3
Browse files Browse the repository at this point in the history
  • Loading branch information
didierrc committed Dec 14, 2023
1 parent 58bd14d commit 1deacde
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
13 changes: 13 additions & 0 deletions Escritorio-Virtual/crucigrama.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ <h4>Elige el nivel de dificultad:</h4>

if (crucigrama) {
// Teclas aceptadas
// Usabilidad - Tecla de retroceso
if (teclasPermitidas.test(event.key) || event.keyCode == 8) {

if (!crucigrama.isACellClicked) {
Expand Down Expand Up @@ -299,6 +300,18 @@ <h4>Botonera:</h4> <!-- Pruebas de usabilidad.-->
<button onclick="crucigrama ? crucigrama.introduceElement('/') : alert('Tienes que crear un juego!')">/</button>
</section>

<!-- Usabilidad - Usuario quería feedback sonoro para saber las correctas o falsas. -->

<audio controls>
<source src="multimedia/correct.mp3" type="audio/mpeg">
<source src="multimedia/correct.wav" type="audio/wav">
</audio>

<audio controls>
<source src="multimedia/wrong.mp3" type="audio/mpeg">
<source src="multimedia/wrong.wav" type="audio/wav">
</audio>

</body>


Expand Down
6 changes: 4 additions & 2 deletions Escritorio-Virtual/estilo/crucigrama.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ main>p {
font-size: 1.3em;
padding: 0.5em 1em;
border-color: black;
border-width: 0.08em;
}

/* Especificidad: 012 */
Expand Down Expand Up @@ -110,8 +111,9 @@ section[data-type="formulario"] {
align-items: flex-start;
}

/* Especificidad: 011 */
input[name="tiempoDB"] {
/* Especificidad: 011-001 */
input[name="tiempoDB"],
audio {
display: none;
}

Expand Down
14 changes: 10 additions & 4 deletions Escritorio-Virtual/js/crucigrama.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,21 @@ class Crucigrama {
if (expression_row && expression_col) {
$(this.cellClicked).text(element); // Mostramos el valor introducido
$(this.cellClicked).attr("data-state", "correct"); // Estado en correcto
$("audio")[0].play() // Usabilidad

// Usabilidad - Solo se deselecciona si la respuesta es correcta
// Se deselecciona la celda
this.isACellClicked = false;
this.cellClicked = null;

} else {
this.crucigrama[iOfCell][jOfCell] = 0;
$(this.cellClicked).removeAttr("data-state"); // deja de estar seleccionada
//$(this.cellClicked).removeAttr("data-state"); // deja de estar seleccionada
$("audio")[1].play() // Usabilidad
alert("Elemento introducido no correcto");
}

// Se deselecciona la celda
this.isACellClicked = false;
this.cellClicked = null;


// Comprobamos el final del crucigrama
if (this.check_win_condition()) {
Expand Down
Binary file added Escritorio-Virtual/multimedia/correct.mp3
Binary file not shown.
Binary file added Escritorio-Virtual/multimedia/correct.wav
Binary file not shown.
Binary file added Escritorio-Virtual/multimedia/wrong.mp3
Binary file not shown.
Binary file added Escritorio-Virtual/multimedia/wrong.wav
Binary file not shown.

0 comments on commit 1deacde

Please sign in to comment.