2025-09-12 16:51:04 -06:00
|
|
|
<style>
|
|
|
|
|
.fake {
|
|
|
|
|
background-image: url(img/bg04.jpg);
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hr-style {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
width: 30%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bg-custom {
|
|
|
|
|
background: #f0f4f2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bg-custom-transparent {
|
2026-03-11 11:20:54 -06:00
|
|
|
background: rgba(242, 232, 222, 0.76);
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
to bottom,
|
|
|
|
|
rgba(242, 232, 222, 0.6) 0%,
|
|
|
|
|
rgba(240, 244, 242, 0.9) 100%
|
|
|
|
|
);
|
2025-09-12 16:51:04 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* .bg-custom-transparent img {
|
|
|
|
|
height: 230px;
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
.drop-card {
|
|
|
|
|
border: none;
|
2025-09-23 10:11:35 -06:00
|
|
|
width: 100%;
|
2025-09-12 16:51:04 -06:00
|
|
|
height: 40px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-drag {
|
|
|
|
|
cursor: grab;
|
|
|
|
|
width: 220px;
|
|
|
|
|
height: auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-items: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
background: linear-gradient(90deg, #b68fb2 0%, #925c8d 100%);
|
|
|
|
|
border-radius: 0px 10px 10px 0px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-drag.ui-draggable-dragging {
|
|
|
|
|
cursor: grabbing;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.img-retro {
|
|
|
|
|
top: -75px;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
max-width: 40%;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-18 11:58:18 -06:00
|
|
|
.content-enfermedad {
|
|
|
|
|
width: 24%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2025-09-12 16:51:04 -06:00
|
|
|
.form-append>div:first-child {
|
|
|
|
|
width: 20%;
|
|
|
|
|
min-width: 50px;
|
|
|
|
|
max-width: 60px;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-append>div:nth-child(2) {
|
|
|
|
|
width: auto;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
vertical-align: middle;
|
2025-09-17 08:49:15 -06:00
|
|
|
} */
|
2025-09-12 16:51:04 -06:00
|
|
|
</style>
|
2026-03-11 11:20:54 -06:00
|
|
|
<div class="page-sco py-2 py-md-4 h-100">
|
|
|
|
|
<div class="container h-100">
|
|
|
|
|
<div
|
|
|
|
|
id="drag-drop-activity"
|
|
|
|
|
class="row justify-content-center align-items-center h-100"
|
|
|
|
|
style="overflow: hidden"
|
|
|
|
|
>
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="row justify-content-center">
|
2025-09-12 16:51:04 -06:00
|
|
|
<div class="col-10 mb-2">
|
|
|
|
|
<h2 class="text-center fw-bold text-primary">Tipos de diálisis</h2>
|
2026-03-11 11:20:54 -06:00
|
|
|
<hr class="border border-3 border-verde-oscuro hr-style mx-auto my-0" />
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
|
|
|
|
<div class="col-7 px-0">
|
|
|
|
|
<div class="card border-0 my-2 rounded bg-secondary shadow p-3 text-center">
|
|
|
|
|
<div class="d-flex justify-content-center align-items-center flex-row">
|
2026-03-11 11:20:54 -06:00
|
|
|
<img src="img/2.1.png" class="img-fluid mx-3" />
|
|
|
|
|
<p class="mb-0">
|
|
|
|
|
<strong>Instrucciones:</strong> Toma los nombres y arrástralos hacia el lugar que
|
|
|
|
|
les corresponda en las imágenes.
|
|
|
|
|
</p>
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-03-11 11:20:54 -06:00
|
|
|
<div class="col-12">
|
2025-09-12 16:51:04 -06:00
|
|
|
<div class="row justify-content-center">
|
|
|
|
|
<div class="col-12 mb-3">
|
|
|
|
|
<div class="card bg-transparent border-0 rounded-0 shadow-none p-0">
|
2025-09-18 11:58:18 -06:00
|
|
|
<div class="d-flex flex-row justify-content-center gap-3">
|
2025-09-12 16:51:04 -06:00
|
|
|
<div class="content-enfermedad text-center">
|
2026-03-11 11:20:54 -06:00
|
|
|
<div
|
|
|
|
|
class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center"
|
|
|
|
|
>
|
2025-09-12 16:51:04 -06:00
|
|
|
<div class="card-header bg-transparent">
|
2026-03-11 11:20:54 -06:00
|
|
|
<img src="img/4.1.png" class="img-fluid" />
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
2026-03-11 11:20:54 -06:00
|
|
|
<div
|
|
|
|
|
class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded"
|
|
|
|
|
>
|
|
|
|
|
<div class="bg-secondary text-white fw-bold py-2 px-2">1</div>
|
2025-09-23 10:11:35 -06:00
|
|
|
<div class="option w-100"></div>
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-enfermedad text-center">
|
2026-03-11 11:20:54 -06:00
|
|
|
<div
|
|
|
|
|
class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center"
|
|
|
|
|
>
|
2025-09-12 16:51:04 -06:00
|
|
|
<div class="card-header bg-transparent">
|
2026-03-11 11:20:54 -06:00
|
|
|
<img src="img/4.2.png" class="img-fluid" />
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
2026-03-11 11:20:54 -06:00
|
|
|
<div
|
|
|
|
|
class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded"
|
|
|
|
|
>
|
|
|
|
|
<div class="bg-secondary text-white fw-bold py-2 px-2">2</div>
|
2025-09-23 10:11:35 -06:00
|
|
|
<div class="option w-100"></div>
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-enfermedad text-center">
|
2026-03-11 11:20:54 -06:00
|
|
|
<div
|
|
|
|
|
class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center"
|
|
|
|
|
>
|
2025-09-12 16:51:04 -06:00
|
|
|
<div class="card-header bg-transparent">
|
2026-03-11 11:20:54 -06:00
|
|
|
<img src="img/4.3.png" class="img-fluid" />
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
2026-03-11 11:20:54 -06:00
|
|
|
<div
|
|
|
|
|
class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded"
|
|
|
|
|
>
|
|
|
|
|
<div class="bg-secondary text-white fw-bold py-2 px-2">3</div>
|
2025-09-23 10:11:35 -06:00
|
|
|
<div class="option w-100"></div>
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-enfermedad text-center">
|
2026-03-11 11:20:54 -06:00
|
|
|
<div
|
|
|
|
|
class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center"
|
|
|
|
|
>
|
2025-09-12 16:51:04 -06:00
|
|
|
<div class="card-header bg-transparent">
|
2026-03-11 11:20:54 -06:00
|
|
|
<img src="img/4.4.png" class="img-fluid" />
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
2026-03-11 11:20:54 -06:00
|
|
|
<div
|
|
|
|
|
class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded"
|
|
|
|
|
>
|
|
|
|
|
<div class="bg-secondary text-white fw-bold py-2 px-2">4</div>
|
2025-09-23 10:11:35 -06:00
|
|
|
<div class="option w-100"></div>
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div id="content-drags" class="d-flex flex-row justify-content-center gap-3"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="d-none">
|
|
|
|
|
<div id="pop0">
|
|
|
|
|
<div class="container-fluid">
|
2026-03-11 11:20:54 -06:00
|
|
|
<div class="w-100 text-center">
|
|
|
|
|
<img src="img/3.5.png" class="img-fluid" />
|
2025-09-12 16:51:04 -06:00
|
|
|
</div>
|
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
|
<div class="col-12 text-center mb-2">
|
|
|
|
|
<h3 class="text-secondary-dark fw-bold">¡Bien hecho!</h3>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 text-center">
|
|
|
|
|
<p class="mb-0">Has concluido la actividad.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
$(function () {
|
|
|
|
|
"use strict";
|
2026-03-11 11:20:54 -06:00
|
|
|
$(".wrap-course-content").addClass("fake");
|
2025-09-12 16:51:04 -06:00
|
|
|
|
|
|
|
|
let questions;
|
|
|
|
|
let currentQuestionIndex = 0;
|
|
|
|
|
let currentQuestion;
|
|
|
|
|
let correctQuestions = 0;
|
2026-03-11 11:20:54 -06:00
|
|
|
const bad = CourseNav.createSound("audio/feedback-incorrect.mpeg");
|
|
|
|
|
const good = CourseNav.createSound("audio/feedback-correct.mpeg");
|
2025-09-12 16:51:04 -06:00
|
|
|
|
2026-03-11 11:20:54 -06:00
|
|
|
const urlExcelFile = "Drag_Drop2.xlsx";
|
2025-09-12 16:51:04 -06:00
|
|
|
|
|
|
|
|
function readExcelFile(url, callback) {
|
|
|
|
|
var xhr = new XMLHttpRequest();
|
2026-03-11 11:20:54 -06:00
|
|
|
xhr.open("GET", url, true);
|
|
|
|
|
xhr.responseType = "arraybuffer";
|
2025-09-12 16:51:04 -06:00
|
|
|
xhr.onload = function (e) {
|
|
|
|
|
var arrayBuffer = xhr.response;
|
|
|
|
|
var data = new Uint8Array(arrayBuffer);
|
|
|
|
|
var workbook = XLSX.read(data, { type: "array" });
|
|
|
|
|
var result = {};
|
2026-03-11 11:20:54 -06:00
|
|
|
workbook.SheetNames.forEach((sheetName) => {
|
2025-09-12 16:51:04 -06:00
|
|
|
var sheet = workbook.Sheets[sheetName];
|
|
|
|
|
result[sheetName] = XLSX.utils.sheet_to_json(sheet);
|
|
|
|
|
});
|
|
|
|
|
callback(result);
|
|
|
|
|
};
|
|
|
|
|
xhr.send();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function procesarPreguntas(data) {
|
2026-03-11 11:20:54 -06:00
|
|
|
const preguntas = data.map((fila) => {
|
2025-09-12 16:51:04 -06:00
|
|
|
const opciones = [];
|
2026-03-11 11:20:54 -06:00
|
|
|
Object.keys(fila).forEach((key) => {
|
|
|
|
|
if (key.startsWith("opcion")) {
|
2025-09-12 16:51:04 -06:00
|
|
|
opciones.push({
|
|
|
|
|
text: fila[key].trim(),
|
2026-03-11 11:20:54 -06:00
|
|
|
correct: key === "opcion_c",
|
2025-09-12 16:51:04 -06:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return {
|
|
|
|
|
pregunta: fila.pregunta.trim(),
|
|
|
|
|
opciones: opciones,
|
|
|
|
|
retroalimentacion_correcta: fila.retroalimentacion_correcta.trim(),
|
2026-03-11 11:20:54 -06:00
|
|
|
retroalimentacion_incorrecta: fila.retroalimentacion_incorrecta.trim(),
|
2025-09-12 16:51:04 -06:00
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
return preguntas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CreateDragAndDrop() {
|
2026-03-11 11:20:54 -06:00
|
|
|
$(".content-enfermedad").each(function (index) {
|
2025-09-12 16:51:04 -06:00
|
|
|
if (questions && questions[index]) {
|
|
|
|
|
const dropDiv = `<div class="position-relative card bg-transparent drop-card shadow-none rounded-0 p-0 mx-auto" data-drop="${index}"></div>`;
|
2026-03-11 11:20:54 -06:00
|
|
|
$(this).find(".option").append(dropDiv);
|
2025-09-12 16:51:04 -06:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Crear todas las respuestas en #content-drags
|
|
|
|
|
let allOptions = [];
|
|
|
|
|
questions.forEach((question, index) => {
|
2026-03-11 11:20:54 -06:00
|
|
|
question.opciones.forEach((opcion) => {
|
2025-09-12 16:51:04 -06:00
|
|
|
allOptions.push({ text: opcion.text, index: index });
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
allOptions = shuffleArray(allOptions);
|
2026-03-11 11:20:54 -06:00
|
|
|
allOptions.forEach((option) => {
|
2025-09-12 16:51:04 -06:00
|
|
|
const dragDiv = `<div class="card card-drag bg-verde-oscuro border-0 shadow-none px-3 py-2 text-white text-center" data-drag="${option.index}">${option.text}</div>`;
|
2026-03-11 11:20:54 -06:00
|
|
|
$("#content-drags").append(dragDiv);
|
2025-09-12 16:51:04 -06:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initializeDragAndDrop() {
|
2026-03-11 11:20:54 -06:00
|
|
|
$(".card-drag").draggable({
|
|
|
|
|
revert: "invalid",
|
2025-09-12 16:51:04 -06:00
|
|
|
revertDuration: 300,
|
2026-03-11 11:20:54 -06:00
|
|
|
/* containment: "#drag-drop-activity", */
|
2025-09-12 16:51:04 -06:00
|
|
|
cursor: "grabbing",
|
|
|
|
|
start: function (event, ui) {
|
2026-03-11 11:20:54 -06:00
|
|
|
$(this).css("z-index", 1000);
|
2025-09-12 16:51:04 -06:00
|
|
|
ui.position.left = 0;
|
|
|
|
|
ui.position.top = 0;
|
|
|
|
|
},
|
|
|
|
|
drag: function (event, ui) {
|
|
|
|
|
var changeLeft = ui.position.left - ui.originalPosition.left;
|
|
|
|
|
var newLeft = ui.originalPosition.left + changeLeft;
|
|
|
|
|
var changeTop = ui.position.top - ui.originalPosition.top;
|
|
|
|
|
var newTop = ui.originalPosition.top + changeTop;
|
|
|
|
|
ui.position.left = newLeft;
|
|
|
|
|
ui.position.top = newTop;
|
|
|
|
|
},
|
|
|
|
|
stop: function (event, ui) {
|
2026-03-11 11:20:54 -06:00
|
|
|
$(this).css("z-index", 1);
|
|
|
|
|
},
|
2025-09-12 16:51:04 -06:00
|
|
|
});
|
|
|
|
|
|
2026-03-11 11:20:54 -06:00
|
|
|
$(".drop-card").droppable({
|
|
|
|
|
accept: ".card-drag",
|
|
|
|
|
tolerance: "pointer",
|
2025-09-12 16:51:04 -06:00
|
|
|
drop: function (event, ui) {
|
2026-03-11 11:20:54 -06:00
|
|
|
const dragData = ui.helper.data("drag");
|
|
|
|
|
const dropData = $(this).data("drop");
|
2025-09-12 16:51:04 -06:00
|
|
|
|
|
|
|
|
if (dragData == dropData) {
|
|
|
|
|
good.play();
|
2026-03-11 11:20:54 -06:00
|
|
|
ui.helper.css({ position: "static", top: "auto", left: "auto" }).appendTo(this);
|
|
|
|
|
ui.helper.draggable("disable");
|
|
|
|
|
$(this).droppable("disable");
|
2025-09-12 16:51:04 -06:00
|
|
|
|
|
|
|
|
// Verificar si todos están completados
|
2026-03-11 11:20:54 -06:00
|
|
|
if ($(".drop-card:not(.ui-droppable-disabled)").length === 0) {
|
2025-09-12 16:51:04 -06:00
|
|
|
Completed();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
bad.play();
|
2026-03-11 11:20:54 -06:00
|
|
|
ui.helper.draggable("option", "revert", true);
|
2025-09-12 16:51:04 -06:00
|
|
|
}
|
2026-03-11 11:20:54 -06:00
|
|
|
},
|
2025-09-12 16:51:04 -06:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Completed() {
|
|
|
|
|
const html = $("#pop0").html();
|
|
|
|
|
Swal.fire({
|
|
|
|
|
html: html,
|
2026-03-11 11:20:54 -06:00
|
|
|
target: document.getElementById("wrap-course-content"),
|
2025-09-12 16:51:04 -06:00
|
|
|
customClass: {
|
2026-03-11 11:20:54 -06:00
|
|
|
popup: "pop_html_style border border-3 border-primary rounded-4",
|
|
|
|
|
confirmButton:
|
|
|
|
|
"btn text-white bg-primary amor fw-semibold animate__animated animate__pulse animate__infinite",
|
2025-09-12 16:51:04 -06:00
|
|
|
},
|
|
|
|
|
confirmButtonText: "Cerrar",
|
|
|
|
|
showConfirmButton: true,
|
|
|
|
|
allowOutsideClick: false,
|
|
|
|
|
allowEscapeKey: false,
|
|
|
|
|
focusConfirm: false,
|
|
|
|
|
backdrop: "rgba(65, 60, 60, .95)",
|
|
|
|
|
width: "35em",
|
2026-03-11 11:20:54 -06:00
|
|
|
didOpen: () => {},
|
2025-09-12 16:51:04 -06:00
|
|
|
didClose: () => {
|
|
|
|
|
CourseNav.audioController.stopAudio();
|
|
|
|
|
//CourseNav.soundClick();
|
|
|
|
|
CourseNav.setSlideVisited();
|
|
|
|
|
/* setTimeout(() => {
|
|
|
|
|
Swal.close();
|
|
|
|
|
CourseNav.nextSlide();
|
|
|
|
|
}, 100); */
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readExcelFile(urlExcelFile, function (data) {
|
|
|
|
|
const hojaDatos = data["DragAndDrop"];
|
|
|
|
|
questions = procesarPreguntas(hojaDatos);
|
|
|
|
|
CreateDragAndDrop();
|
|
|
|
|
initializeDragAndDrop();
|
2025-09-18 11:58:18 -06:00
|
|
|
//igualarAlturaBgCustomTransparent();
|
2025-09-12 16:51:04 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Ajustar altura de todos los elementos .bg-custom-transparent al más alto
|
|
|
|
|
function igualarAlturaBgCustomTransparent() {
|
|
|
|
|
var maxHeight = 0;
|
2026-03-11 11:20:54 -06:00
|
|
|
$(".bg-custom-transparent").each(function () {
|
|
|
|
|
$(this).css("height", "auto"); // Resetear altura para medir correctamente
|
2025-09-12 16:51:04 -06:00
|
|
|
var h = $(this).outerHeight();
|
|
|
|
|
if (h > maxHeight) maxHeight = h;
|
|
|
|
|
});
|
2026-03-11 11:20:54 -06:00
|
|
|
$(".bg-custom-transparent").css("height", maxHeight + "px");
|
2025-09-12 16:51:04 -06:00
|
|
|
}
|
|
|
|
|
|
2025-09-18 11:58:18 -06:00
|
|
|
/* $(window).on('resize', igualarAlturaBgCustomTransparent);
|
|
|
|
|
igualarAlturaBgCustomTransparent(); */
|
2025-09-12 16:51:04 -06:00
|
|
|
});
|
2025-09-18 11:58:18 -06:00
|
|
|
</script>
|