Files
Manual_Vantive/contenido/06.html
T

373 lines
14 KiB
HTML
Raw Normal View History

2025-09-30 16:49:20 -06:00
<style>
.fake {
background-image: url(img/bg02.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
background-attachment: fixed;
}
.fake1 {
background-image: url(img/bg00.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
background-attachment: fixed;
}
.fake2 {
background-image: url(img/bg03.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
background-attachment: fixed;
}
.btn-respuesta {
max-width: 550px;
cursor: pointer;
}
.btn-comenzar {
border-radius: 20px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
cursor: pointer;
}
.btn-reintentar {
cursor: pointer;
}
.indicator-circle {
width: 40px;
height: 40px;
margin: 0px 8px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
font-size: 18px;
font-weight: bold;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
</style>
<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">
2025-09-30 16:49:20 -06:00
<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">Acceso peritoneal y sus cuidados</h2>
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-3 opacity-100" />
2025-09-30 16:49:20 -06:00
</div>
</div>
<div class="col-12">
<div class="row justify-content-center align-items-center">
2025-10-22 09:12:21 -06:00
<div class="col-4 text-center animate__animated animate__zoomIn">
<img src="img/06.0.png" class="img-fluid" />
2025-09-30 16:49:20 -06:00
</div>
<div class="col-6">
<div class="card bg-white border-0 rounded-3 p-0 bx-shadow">
<div class="p-3 pb-0 position-relative mb-3 w-100 animate__animated animate__flipInX">
<p class="mb-0">
El sitio de salida (SS) es el área de
<strong class="text-lila-claro">la piel por donde emerge el catéter</strong> peritoneal y requiere
cuidados continuos de higiene y vigilancia para la prevención de complicaciones locales.<sup
class="fw-bold"
>4</sup
>
</p>
2025-09-30 16:49:20 -06:00
</div>
<div
class="position-relative w-100 bg-lila-rosa text-primary px-3 py-2 mb-3 animate__animated animate__flipInX animate__delay-1s"
>
2025-09-30 16:49:20 -06:00
<p class="mb-0 fw-bold text-center">Descubramos más acerca de estos cuidados.</p>
</div>
<div class="position-relative w-100 text-center animate__animated animate__zoomIn animate__delay-2s">
<div
class="btn-comenzar bg-primary d-inline-block px-3 py-2 text-center animate__animated animate__pulse animate__infinite"
>
2025-09-30 16:49:20 -06:00
<h5 class="text-white fw-bold mb-0">COMENZAR ACTIVIDAD</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="desarrollo" 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-11">
<div class="row justify-content-center">
2025-09-30 16:49:20 -06:00
<div class="col-10 text-center">
<div class="position-relative d-inline-block">
<h2 class="text-primary mb-1 fw-bold">Acceso peritoneal y sus cuidados</h2>
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-3 opacity-100" />
2025-09-30 16:49:20 -06:00
</div>
</div>
<div class="col-10 mb-3">
<div class="card bg-lila-claro text-white border-0 rounded-4 bx-shadow py-2 px-3">
<div class="row justify-content-center">
<div class="col-10">
<div class="d-flex flex-row justify-content-center align-items-center gap-3">
<img src="img/book2.png" class="img-fluid" />
<p class="mb-0">
<strong>Instrucciones:</strong> Lea lo que opinan dos doctores sobre los cuidados del sitio de
salida. Analice sus argumentos y elija quién tiene la razón.
</p>
2025-09-30 16:49:20 -06:00
</div>
</div>
</div>
</div>
</div>
2026-07-01 15:28:02 -06:00
<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>
2025-09-30 16:49:20 -06:00
<div class="col-12">
<div class="row justify-content-center">
<div class="col-12 mb-2">
<div class="d-flex justify-content-center align-items-center gap-2 flex-row indicadores-avance"></div>
</div>
<div class="col-12">
<div id="puzzle-versus" class="d-flex flex-row justify-content-center gap-2"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<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">
2025-09-30 16:49:20 -06:00
<div class="row justify-content-center">
<div class="col-12 text-center mb-3">
<img src="img/cierre_actividad.png" class="img-fluid" />
2025-09-30 16:49:20 -06:00
</div>
<div class="col-12 mb-3 text-center">
<div class="position-relative d-inline-block">
2025-10-08 11:06:36 -06:00
<h2 class="text-primary mb-1 fw-bold">Acceso peritoneal y sus cuidados</h2>
<hr class="border border-2 border-verde-oscuro hr-style my-0 opacity-100" />
2025-09-30 16:49:20 -06:00
</div>
</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">
2025-09-30 16:49:20 -06:00
<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()"
>
2025-09-30 16:49:20 -06:00
<h5 class="text-white fw-bold mb-0">Reintentar</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
"use strict";
$(".wrap-course-content").addClass("fake");
2025-09-30 16:49:20 -06:00
let questions;
let currentQuestionIndex = 0;
let currentQuestion;
let correctQuestions = 0;
let maxQuestions = 5;
let currentFichaIndex = 0;
let questionResults = [];
const bad = CourseNav.createSound("audio/feedback-incorrect.mpeg");
const good = CourseNav.createSound("audio/feedback-correct.mpeg");
2025-09-30 16:49:20 -06:00
const imgPerso = ["img/06.1.png", "img/06.2.png"];
const urlExcelFile = "Actividades_Manual_Vantive.xlsx";
2025-09-30 16:49:20 -06:00
$(".btn-comenzar").click(function (e) {
2025-09-30 16:49:20 -06:00
e.preventDefault();
CourseNav.soundClick();
$(".wrap-course-content").addClass("fake1").removeClass("fake");
$("#inicio").hide();
$("#desarrollo").show();
2025-09-30 16:49:20 -06:00
});
function readExcelFile(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "arraybuffer";
2025-09-30 16:49:20 -06:00
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) => {
2025-09-30 16:49:20 -06:00
var sheet = workbook.Sheets[sheetName];
result[sheetName] = XLSX.utils.sheet_to_json(sheet);
});
callback(result);
};
xhr.send();
}
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 procesarPreguntas(data) {
return data.map((fila) => ({
pregunta: fila.pregunta ? String(fila.pregunta).trim() : "",
opcion: fila.opcion ? String(fila.opcion).trim() : "",
opcion_c: fila.opcion_c ? String(fila.opcion_c).trim() : "",
2025-09-30 16:49:20 -06:00
}));
}
function createIndicators(total) {
const container = $(".indicadores-avance");
2025-09-30 16:49:20 -06:00
container.empty();
for (let i = 0; i < total; i++) {
const circle = $('<div class="indicator-circle"></div>');
circle.css({
"background-color": i === 0 ? "#2196F3" : "#E0E0E0",
2025-09-30 16:49:20 -06:00
});
circle.attr("data-index", i);
2025-09-30 16:49:20 -06:00
container.append(circle);
}
}
function createVersusStructure() {
if (currentQuestionIndex >= maxQuestions || currentQuestionIndex >= questions.length) {
finishActivity();
return;
}
currentQuestion = questions[currentQuestionIndex];
const shuffledImages = shuffleArray([...imgPerso]);
const leftIsCorrect = Math.random() < 0.5;
const leftResponse = leftIsCorrect ? currentQuestion.opcion_c : currentQuestion.opcion;
const rightResponse = leftIsCorrect ? currentQuestion.opcion : currentQuestion.opcion_c;
const structure = `
<div class="btn-respuesta animate__animated animate__zoomIn" data-correct="${leftIsCorrect}">
<div class="d-flex flex-column justify-content-center align-items-center gap-0">
<img src="${shuffledImages[0]}" alt="personaje" style="z-index:1;">
2026-07-07 11:53:55 -06:00
<div class="card bg-verde-ceniza border-0 shadow rounded-15 pt-5 px-3 pb-3 text-center text-respuesta text-white" style="margin-top: -60px;"><p class="mb-0">${leftResponse || ""}</p></div>
2025-09-30 16:49:20 -06:00
</div>
</div>
<img src="img/06.3.png" class="img-fluid mx-2 animate__animated animate__zoomIn">
<div class="btn-respuesta animate__animated animate__zoomIn" data-correct="${!leftIsCorrect}">
<div class="d-flex flex-column justify-content-center align-items-center gap-0">
<img src="${shuffledImages[1]}" alt="personaje" style="z-index:1;">
2026-07-07 11:53:55 -06:00
<div class="card bg-verde-ceniza border-0 shadow rounded-15 pt-5 px-3 pb-3 text-center text-respuesta text-white" style="margin-top: -60px;"><p class="mb-0">${rightResponse || ""}</p></div>
2025-09-30 16:49:20 -06:00
</div>
</div>
`;
$("#puzzle-versus").removeClass("animate__animated animate__zoomOut").html(structure);
2025-09-30 16:49:20 -06:00
updateIndicators();
initializeAnswers();
}
function updateIndicators() {
$(".indicator-circle").each(function (index) {
2025-09-30 16:49:20 -06:00
if (index < currentQuestionIndex && questionResults[index] !== undefined) {
const isCorrect = questionResults[index];
$(this).css({
"background-color": "transparent",
"background-image": `url(img/${isCorrect ? "checkG" : "checkB"}.png)`,
2025-09-30 16:49:20 -06:00
});
} else if (index === currentQuestionIndex) {
$(this).css({
"background-color": "#2196F3",
"background-image": "none",
2025-09-30 16:49:20 -06:00
});
} else {
$(this).css({
"background-color": "#E0E0E0",
"background-image": "none",
2025-09-30 16:49:20 -06:00
});
}
});
}
function initializeAnswers() {
$(".btn-respuesta")
.off("click")
.on("click", function () {
const isCorrect = $(this).data("correct");
2025-09-30 16:49:20 -06:00
CourseNav.audioController.stopAllSoundsAndPlay(isCorrect ? good : bad);
2025-09-30 16:49:20 -06:00
if (isCorrect) {
correctQuestions++;
}
2025-09-30 16:49:20 -06:00
questionResults[currentQuestionIndex] = isCorrect;
2025-09-30 16:49:20 -06:00
Swal.fire({
target: document.getElementById("wrap-course-content"),
imageUrl: isCorrect ? "img/good.png" : "img/bad.png",
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: "Cerrar",
backdrop: "rgba(65, 60, 60, .95)",
width: "35em",
didClose: () => {
$("#puzzle-versus").addClass("animate__animated animate__zoomOut");
setTimeout(() => {
currentQuestionIndex++;
if (currentQuestionIndex < maxQuestions && currentQuestionIndex < questions.length) {
createVersusStructure();
} else {
finishActivity();
}
}, 500);
},
});
2025-09-30 16:49:20 -06:00
});
}
function finishActivity() {
const totalQuestions = Math.min(maxQuestions, questions.length);
const percentage = (correctQuestions / totalQuestions) * 100;
$(".wrap-course-content").addClass("fake2").removeClass("fake1");
$("#desarrollo").hide();
$("#cierre").show();
2025-09-30 16:49:20 -06:00
if (percentage < 80) {
$(".col-reintentar").show();
2025-09-30 16:49:20 -06:00
}
CourseNav.setSlideVisited();
}
// Cargar datos del Excel
readExcelFile(urlExcelFile, function (data) {
const hojaDatos = data["Diapositiva 12"];
questions = shuffleArray(procesarPreguntas(hojaDatos));
const totalQuestions = Math.min(maxQuestions, questions.length);
createIndicators(totalQuestions);
createVersusStructure();
});
});
</script>