2025-10-06 17:03:24 -06:00
|
|
|
<style>
|
2026-07-01 15:28:02 -06:00
|
|
|
.fake {
|
|
|
|
|
background-image: url(img/bg04.jpg);
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-attachment: fixed;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.fake1 {
|
|
|
|
|
background-image: url(img/bg03.jpg);
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-attachment: fixed;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.btn-comenzar {
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
/* Estilos para drag and drop */
|
|
|
|
|
.options {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(4, 1fr);
|
|
|
|
|
grid-template-rows: repeat(2, 1fr);
|
|
|
|
|
gap: 15px;
|
|
|
|
|
/* padding: 20px; */
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.draggable-option {
|
|
|
|
|
cursor: grab;
|
|
|
|
|
background-image: url("img/17.2.png");
|
|
|
|
|
background-size: 100% auto;
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
border-radius: 15px;
|
|
|
|
|
border: 3px solid #dee2e6;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
user-select: none;
|
|
|
|
|
height: 180px;
|
|
|
|
|
width: 200px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 15px;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
|
|
|
|
|
border: none;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.draggable-option:hover {
|
|
|
|
|
border-color: #6c9d7a;
|
|
|
|
|
transform: translateY(-5px) scale(1.05);
|
|
|
|
|
filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.2));
|
|
|
|
|
/* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); */
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.draggable-option.dragging {
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
transform: rotate(8deg) scale(0.95);
|
|
|
|
|
cursor: grabbing;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.option-text {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 44%;
|
|
|
|
|
left: 0%;
|
|
|
|
|
width: 90%;
|
|
|
|
|
background: transparent;
|
|
|
|
|
height: 40%;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.container-drag {
|
|
|
|
|
min-height: 150px;
|
|
|
|
|
border: 3px dashed #ccc !important;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.container-drag.drag-over {
|
|
|
|
|
border-color: #6c9d7a !important;
|
|
|
|
|
background-color: rgba(108, 157, 122, 0.1);
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.container-drag.has-answer {
|
|
|
|
|
border-color: #925c8d !important;
|
|
|
|
|
background-color: rgba(146, 92, 141, 0.1);
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.draggable-option.used {
|
|
|
|
|
opacity: 0.3;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
text-decoration: line-through;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.draggable-option.hidden {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.dropped-option {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
background-color: #925c8d;
|
|
|
|
|
color: white;
|
|
|
|
|
padding: 10px 15px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
z-index: 10;
|
|
|
|
|
}
|
2025-10-06 19:38:34 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
.btn-reintentar {
|
2025-10-06 19:38:34 -06:00
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
</style>
|
2026-07-01 15:28:02 -06:00
|
|
|
<div id="inicio" class="page-sco py-2 py-md-0 h-100">
|
|
|
|
|
<div class="container h-100">
|
|
|
|
|
<div class="row justify-content-center align-items-center h-100">
|
|
|
|
|
<div class="col-11">
|
|
|
|
|
<div class="row justify-content-center align-items-center">
|
|
|
|
|
<div class="col-12 text-center animate__animated animate__bounceInDown">
|
|
|
|
|
<div class="position-relative d-inline-block">
|
|
|
|
|
<h2 class="text-primary mb-1 fw-bold">Procedimientos</h2>
|
|
|
|
|
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-1 opacity-100" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 mb-3 text-center">
|
|
|
|
|
<h4 class="fw-bold text-verde-pino">DPCA</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-5 text-center intro mb-3 animate__animated animate__flipInX">
|
|
|
|
|
<div class="card bg-white border-0 rounded-3 p-3 pb-0 bx-shadow">
|
|
|
|
|
<p class="my-0">
|
|
|
|
|
Para que una terapia de diálisis tenga los resultados esperados, se deben conocer los pasos necesarios
|
|
|
|
|
para llevarla a cabo.
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
En esta actividad podrá demostrar cuánto conoce acerca de los
|
|
|
|
|
<b class="text-morado-claro">procedimientos de conexión y desconexión de la DPCA.</b>
|
|
|
|
|
</p>
|
|
|
|
|
<div class="w-100 position-relative text-center">
|
|
|
|
|
<div
|
|
|
|
|
class="btn-comenzar bg-primary d-inline-block px-3 py-2 text-center animate__animated animate__pulse animate__infinite"
|
|
|
|
|
>
|
|
|
|
|
<h5 class="text-white fw-bold mb-0">COMENZAR ACTIVIDAD</h5>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
|
|
|
|
<div class="col-4 text-center mb-1 animate__animated animate__zoomIn">
|
|
|
|
|
<img src="img/17.0.png" class="img-fluid" />
|
|
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
<div id="desarrollo" class="page-sco py-2 py-md-0 h-100" style="display: none; overflow: hidden">
|
|
|
|
|
<div class="container h-100">
|
|
|
|
|
<div class="row justify-content-center align-items-center h-100">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="row justify-content-center mb-5">
|
|
|
|
|
<div class="col-11 text-center animate__animated animate__bounceInDown">
|
|
|
|
|
<div class="position-relative d-inline-block">
|
|
|
|
|
<h2 class="text-primary mb-1 fw-bold">Procedimientos</h2>
|
|
|
|
|
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-3 opacity-100" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 mb-3 text-center">
|
|
|
|
|
<h4 class="fw-bold text-verde-pino">DPCA</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 px-0 mb-3">
|
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="card bg-verde-claro border-0 rounded-0 py-2 px-3">
|
|
|
|
|
<div class="row justify-content-start">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="d-flex flex-row justify-content-center align-items-center gap-3 ps-4">
|
|
|
|
|
<img src="img/book3.png" class="img-fluid" />
|
|
|
|
|
<p class="mb-0">
|
|
|
|
|
<strong>Instrucciones:</strong> Lea con atención cada descripción y arrastre hacia ella el
|
|
|
|
|
sobre con el nombre del paso al que corresponde.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 mb-3 text-center">
|
|
|
|
|
<p class="small mb-0">"Estos son casos hipotéticos basados en las referencias bibliográficas."</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-11">
|
|
|
|
|
<div
|
|
|
|
|
class="row justify-content-center align-items-center animate__animated animate__slideInRight no-overflow"
|
|
|
|
|
>
|
|
|
|
|
<div class="col-4">
|
|
|
|
|
<div class="card border-0 bg-verde-pino rounded">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
|
<div class="col-7">
|
|
|
|
|
<div class="card bg-transparent border border-2 border-white custom-card p-5 container-drag">
|
|
|
|
|
<img src="img/17.1.png" class="img-fluid" />
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
|
|
|
|
<div class="col-10 text-white mt-3">
|
|
|
|
|
<div class="question">
|
|
|
|
|
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Minima aliquam placeat neque,
|
|
|
|
|
officia est laborum molestias voluptatibus pariatur, quaerat dolorum, et omnis mollitia.
|
|
|
|
|
Dolorum facere minima at quas? Quo, praesentium?
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
|
|
|
|
<div class="col-8">
|
|
|
|
|
<div class="options"></div>
|
|
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
<div id="cierre" class="page-sco py-2 py-md-0 h-100" style="display: none">
|
|
|
|
|
<div class="container h-100">
|
|
|
|
|
<div class="row justify-content-center align-items-center h-100">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
|
<div class="col-12 text-center mb-3">
|
|
|
|
|
<img src="img/cierre_actividad.png" class="img-fluid" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 mb-3 text-center">
|
|
|
|
|
<div class="position-relative d-inline-block">
|
|
|
|
|
<h2 class="text-primary mb-1 fw-bold">Procedimientos</h2>
|
|
|
|
|
<hr class="border border-2 border-verde-oscuro hr-style my-0 opacity-100" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 mb-3 text-center">
|
|
|
|
|
<h4 class="fw-bold text-verde-pino">DPCA</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 text-center mb-3">
|
|
|
|
|
<h4 class="text-secondary fw-bold">Ha concluido la actividad.</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 text-center col-reintentar animate__animated animate__zoomIn" style="display: none">
|
|
|
|
|
<div
|
|
|
|
|
class="btn-reintentar rounded-3 bg-primary d-inline-block px-3 py-2 text-center animate__animated animate__pulse animate__infinite"
|
|
|
|
|
onclick="CourseNav.reload()"
|
|
|
|
|
>
|
|
|
|
|
<h5 class="text-white fw-bold mb-0">Reintentar</h5>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
2026-07-01 15:28:02 -06:00
|
|
|
</div>
|
2025-10-06 17:03:24 -06:00
|
|
|
</div>
|
|
|
|
|
<script>
|
2026-07-01 15:28:02 -06:00
|
|
|
$(function () {
|
|
|
|
|
"use strict";
|
|
|
|
|
$(".wrap-course-content").addClass("fake");
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
$(".intro").removeClass("animate__flipInX");
|
|
|
|
|
}, 600);
|
|
|
|
|
|
|
|
|
|
var preguntasActual = 0,
|
|
|
|
|
preguntasMax = 6,
|
|
|
|
|
preguntasCorrectas = 0;
|
|
|
|
|
const bad = CourseNav.createSound("audio/feedback-incorrect.mpeg");
|
|
|
|
|
const good = CourseNav.createSound("audio/feedback-correct.mpeg");
|
|
|
|
|
|
|
|
|
|
$(".btn-comenzar").click(function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
CourseNav.soundClick();
|
|
|
|
|
$("#inicio").hide();
|
|
|
|
|
$("#desarrollo").show();
|
|
|
|
|
inicializarTodasLasOpciones();
|
|
|
|
|
mostrarPregunta();
|
|
|
|
|
});
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
const urlExcelFile = "Actividades_Manual_Vantive.xlsx";
|
|
|
|
|
|
|
|
|
|
function readExcelFile(url, callback) {
|
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
|
xhr.open("GET", url, true);
|
|
|
|
|
xhr.responseType = "arraybuffer";
|
|
|
|
|
xhr.onload = function (e) {
|
|
|
|
|
var arrayBuffer = xhr.response;
|
|
|
|
|
var data = new Uint8Array(arrayBuffer);
|
|
|
|
|
var workbook = XLSX.read(data, { type: "array" });
|
|
|
|
|
var result = {};
|
|
|
|
|
workbook.SheetNames.forEach((sheetName) => {
|
|
|
|
|
var sheet = workbook.Sheets[sheetName];
|
|
|
|
|
result[sheetName] = XLSX.utils.sheet_to_json(sheet);
|
2025-10-06 17:03:24 -06:00
|
|
|
});
|
2026-07-01 15:28:02 -06:00
|
|
|
callback(result);
|
|
|
|
|
};
|
|
|
|
|
xhr.send();
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function procesarPreguntas(data) {
|
|
|
|
|
const preguntas = data.map((fila) => {
|
|
|
|
|
const opciones = [];
|
|
|
|
|
Object.keys(fila).forEach((key) => {
|
|
|
|
|
if (key.startsWith("opcion")) {
|
|
|
|
|
opciones.push({
|
|
|
|
|
text: fila[key].trim(),
|
|
|
|
|
correct: key === "opcion_c",
|
2025-10-06 17:03:24 -06:00
|
|
|
});
|
2026-07-01 15:28:02 -06:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return {
|
|
|
|
|
pregunta: fila.pregunta.trim(),
|
|
|
|
|
opciones: opciones,
|
|
|
|
|
retroalimentacion_correcta: fila.retroalimentacion_correcta ? fila.retroalimentacion_correcta.trim() : "",
|
|
|
|
|
retroalimentacion_incorrecta: fila.retroalimentacion_incorrecta
|
|
|
|
|
? fila.retroalimentacion_incorrecta.trim()
|
|
|
|
|
: "",
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
return preguntas;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function shuffleArray(array) {
|
|
|
|
|
for (let i = array.length - 1; i > 0; i--) {
|
|
|
|
|
const j = Math.floor(Math.random() * (i + 1));
|
|
|
|
|
[array[i], array[j]] = [array[j], array[i]];
|
|
|
|
|
}
|
|
|
|
|
return array;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
let questions = [];
|
|
|
|
|
let currentQuestion = null;
|
|
|
|
|
let currentQuestionIndex = 0;
|
|
|
|
|
let todasLasOpciones = [];
|
|
|
|
|
|
|
|
|
|
function inicializarTodasLasOpciones() {
|
|
|
|
|
todasLasOpciones = [];
|
|
|
|
|
|
|
|
|
|
// Recopilar todas las opciones de todas las preguntas
|
|
|
|
|
questions.forEach((pregunta, preguntaIndex) => {
|
|
|
|
|
pregunta.opciones.forEach((opcion, opcionIndex) => {
|
|
|
|
|
todasLasOpciones.push({
|
|
|
|
|
text: opcion.text,
|
|
|
|
|
correct: opcion.correct,
|
|
|
|
|
preguntaIndex: preguntaIndex,
|
|
|
|
|
id: `pregunta-${preguntaIndex}-opcion-${opcionIndex}`,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
// Barajar todas las opciones
|
|
|
|
|
todasLasOpciones = shuffleArray(todasLasOpciones);
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
// Mostrar todas las opciones
|
|
|
|
|
mostrarTodasLasOpciones();
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function mostrarTodasLasOpciones() {
|
|
|
|
|
const $options = $(".options");
|
|
|
|
|
$options.empty();
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
todasLasOpciones.forEach((opcion, index) => {
|
|
|
|
|
const $option = $(`
|
2025-10-06 19:38:34 -06:00
|
|
|
<div class="draggable-option" draggable="true"
|
|
|
|
|
data-correct="${opcion.correct}"
|
2025-10-06 17:03:24 -06:00
|
|
|
data-pregunta-index="${opcion.preguntaIndex}"
|
|
|
|
|
data-option-id="${opcion.id}">
|
|
|
|
|
<div class="option-text">${opcion.text}</div>
|
|
|
|
|
</div>
|
|
|
|
|
`);
|
2026-07-01 15:28:02 -06:00
|
|
|
$options.append($option);
|
|
|
|
|
});
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
setupDragAndDrop();
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function mostrarPregunta() {
|
|
|
|
|
if (questions.length === 0 || currentQuestionIndex >= questions.length) {
|
|
|
|
|
finalizarJuego();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
currentQuestion = questions[currentQuestionIndex];
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
// Mostrar la pregunta en el elemento .question
|
|
|
|
|
$(".question").text(currentQuestion.pregunta);
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
// Limpiar el área de drop
|
|
|
|
|
$(".container-drag").removeClass("has-answer").find(".dropped-option").remove();
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
// Rehabilitar todas las opciones para la nueva pregunta
|
|
|
|
|
$(".draggable-option").attr("draggable", true).css({
|
|
|
|
|
opacity: "1",
|
|
|
|
|
"pointer-events": "auto",
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function setupDragAndDrop() {
|
|
|
|
|
const $draggables = $(".draggable-option");
|
|
|
|
|
const $dropZone = $(".container-drag");
|
|
|
|
|
|
|
|
|
|
// Eventos para elementos draggable
|
|
|
|
|
$draggables.on("dragstart", function (e) {
|
|
|
|
|
$(this).addClass("dragging");
|
|
|
|
|
e.originalEvent.dataTransfer.setData("text/plain", "");
|
|
|
|
|
e.originalEvent.dataTransfer.effectAllowed = "move";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$draggables.on("dragend", function (e) {
|
|
|
|
|
$(this).removeClass("dragging");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Eventos para zona de drop
|
|
|
|
|
$dropZone.on("dragover", function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
e.originalEvent.dataTransfer.dropEffect = "move";
|
|
|
|
|
$(this).addClass("drag-over");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$dropZone.on("dragleave", function (e) {
|
|
|
|
|
$(this).removeClass("drag-over");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$dropZone.on("drop", function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
$(this).removeClass("drag-over");
|
|
|
|
|
|
|
|
|
|
const $draggedElement = $(".dragging");
|
|
|
|
|
if ($draggedElement.length > 0) {
|
|
|
|
|
manejarDrop($draggedElement);
|
2025-10-06 17:03:24 -06:00
|
|
|
}
|
2026-07-01 15:28:02 -06:00
|
|
|
});
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function manejarDrop($draggedElement) {
|
|
|
|
|
const isCorrect = $draggedElement.data("correct") === true;
|
|
|
|
|
const preguntaIndexOpcion = $draggedElement.data("pregunta-index");
|
|
|
|
|
const optionText = $draggedElement.find(".option-text").text() || $draggedElement.text();
|
|
|
|
|
|
|
|
|
|
// Verificar si la opción corresponde a la pregunta actual
|
|
|
|
|
const esOpcionDeLaPreguntaActual = preguntaIndexOpcion === currentQuestionIndex;
|
|
|
|
|
const isCorrectForCurrentQuestion = isCorrect && esOpcionDeLaPreguntaActual;
|
|
|
|
|
|
|
|
|
|
// Crear elemento dropped
|
|
|
|
|
const $droppedOption = $(`<div class="dropped-option">${optionText}</div>`);
|
|
|
|
|
$(".container-drag").addClass("has-answer").find(".dropped-option").remove();
|
|
|
|
|
$(".container-drag").append($droppedOption);
|
|
|
|
|
|
|
|
|
|
// NO eliminar la opción, mantenerla disponible
|
|
|
|
|
// Restaurar el estado normal de todas las opciones
|
|
|
|
|
$(".draggable-option").attr("draggable", true).css({
|
|
|
|
|
opacity: "1",
|
|
|
|
|
"pointer-events": "auto",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Reproducir sonido
|
|
|
|
|
CourseNav.audioController.stopAllSoundsAndPlay(isCorrectForCurrentQuestion ? good : bad);
|
|
|
|
|
|
|
|
|
|
// Actualizar contadores
|
|
|
|
|
if (isCorrectForCurrentQuestion) {
|
|
|
|
|
preguntasCorrectas++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Mostrar feedback después de un delay
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
mostrarFeedback(isCorrectForCurrentQuestion, currentQuestion);
|
|
|
|
|
}, 250);
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function mostrarFeedback(isCorrect, pregunta) {
|
|
|
|
|
const retroalimentacion = isCorrect ? pregunta.retroalimentacion_correcta : pregunta.retroalimentacion_incorrecta;
|
|
|
|
|
|
|
|
|
|
Swal.fire({
|
|
|
|
|
target: document.getElementById("wrap-course-content"),
|
|
|
|
|
imageUrl: isCorrect ? "img/good.png" : "img/bad.png",
|
|
|
|
|
text: retroalimentacion || "",
|
|
|
|
|
showConfirmButton: true,
|
|
|
|
|
customClass: {
|
|
|
|
|
popup: "pop_retros bg-transparent border-0 rounded-0 shadow-none",
|
|
|
|
|
confirmButton:
|
|
|
|
|
"btn text-primary bg-lila-rosa amor fw-semibold animate__animated animate__pulse animate__infinite",
|
|
|
|
|
},
|
|
|
|
|
confirmButtonText: "Continuar",
|
|
|
|
|
backdrop: "rgba(65, 60, 60, .95)",
|
|
|
|
|
width: "35em",
|
|
|
|
|
didClose: () => {
|
|
|
|
|
continuarJuego();
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function continuarJuego() {
|
|
|
|
|
currentQuestionIndex++;
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
if (currentQuestionIndex >= questions.length) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
finalizarJuego();
|
|
|
|
|
}, 500);
|
|
|
|
|
} else {
|
|
|
|
|
preguntasActual++;
|
|
|
|
|
mostrarPregunta();
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function visualFeedBack(isCorrect) {
|
|
|
|
|
// Cambiar la imagen de la alarma correspondiente
|
|
|
|
|
const $alarms = $(".alarms .alarm-img");
|
|
|
|
|
if ($alarms.length > preguntasActual) {
|
|
|
|
|
$alarms.eq(preguntasActual).attr("src", isCorrect ? "img/alarm_c.png" : "img/alarm_i.png");
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
function finalizarJuego() {
|
|
|
|
|
const porcentaje = (preguntasCorrectas / questions.length) * 100;
|
|
|
|
|
const aprobado = porcentaje >= 60;
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
$(".wrap-course-content").addClass("fake1").removeClass("fake");
|
2025-10-06 19:38:34 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
CourseNav.setSlideVisited();
|
2025-10-06 19:38:34 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
if (aprobado) {
|
|
|
|
|
$("#desarrollo").hide();
|
|
|
|
|
$("#cierre").show();
|
|
|
|
|
} else {
|
|
|
|
|
$(".col-reintentar").show();
|
|
|
|
|
$("#desarrollo").hide();
|
|
|
|
|
$("#cierre").show();
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-06 17:03:24 -06:00
|
|
|
|
2026-07-01 15:28:02 -06:00
|
|
|
readExcelFile(urlExcelFile, function (data) {
|
|
|
|
|
const hojaDatos = data["Diapositiva 37"];
|
|
|
|
|
questions = procesarPreguntas(hojaDatos);
|
|
|
|
|
preguntasMax = questions.length;
|
2025-10-06 17:03:24 -06:00
|
|
|
});
|
2026-07-01 15:28:02 -06:00
|
|
|
});
|
2025-10-06 19:38:34 -06:00
|
|
|
</script>
|