Files
Rotafilio_Vantive/contenido/07.html
T

397 lines
13 KiB
HTML
Raw Normal View History

2025-09-18 16:56:37 -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: 40%;
}
.bg-custom {
2026-03-11 11:20:54 -06:00
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
2025-09-18 16:56:37 -06:00
}
.btn-answer {
background-color: #808080;
border-radius: 20px;
cursor: pointer;
}
.btn-answer:hover {
background-color: #925c8d;
}
.btn-answer.selected {
background-color: #925c8d;
}
.completed {
filter: grayscale(1);
}
.disabled {
pointer-events: none;
}
.object-btn {
cursor: pointer;
}
.content-medidor {
background-color: #fff;
2026-03-11 11:20:54 -06:00
box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
2025-09-18 16:56:37 -06:00
border-radius: 40px;
}
.termometro {
position: relative;
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-template-rows: auto;
gap: 0;
2026-03-11 11:20:54 -06:00
background: #e7e7e7;
background: linear-gradient(to left, #e7e7e7 0%, #c3c3c3 100%);
2025-09-18 16:56:37 -06:00
border-radius: 40px;
}
.med_style {
border-radius: 0;
border: 1px solid #000;
border-right: 3px solid #c3c3c3;
width: 80px;
height: 30px;
}
.med_style:nth-child(6) {
border-top-right-radius: 40px;
border-bottom-right-radius: 40px;
border-left: 0;
border-right: 1px solid #000;
background: #76c300;
background: linear-gradient(to top, #76c300 0%, #386100 100%);
}
.med_style:first-child {
border-top-left-radius: 40px;
border-bottom-left-radius: 40px;
2026-03-11 11:20:54 -06:00
background: #df0000;
background: linear-gradient(to top, #df0000 0%, #4f0700 100%);
2025-09-18 16:56:37 -06:00
}
.med_style:nth-child(2),
.med_style:nth-child(3),
.med_style:nth-child(4),
.med_style:nth-child(5) {
border-left: 0;
}
.med_style:nth-child(3) {
background: #ffce00;
background: linear-gradient(to top, #ffce00 0%, #fe6a00 100%);
}
.med_style:nth-child(2) {
background: #ff8400;
background: linear-gradient(to top, #ff8400 0%, #c93000 100%);
}
.med_style:nth-child(4) {
background: #a4f800;
background: linear-gradient(to top, #a4f800 0%, #ffe600 100%);
}
.med_style:nth-child(5) {
background: #aaff00;
background: linear-gradient(to top, #aaff00 0%, #4e8600 100%);
}
.indicador-med {
position: absolute;
width: 60px;
height: 60px;
border-radius: 100%;
bottom: -60px;
left: 10px;
transition: left 0.5s ease;
}
</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 class="row justify-content-center align-items-center h-100">
<div class="col-12">
<div class="row justify-content-center">
2025-09-18 16:56:37 -06:00
<div class="col-10 mb-2">
<h2 class="text-center fw-bold text-primary">Tipos de diálisis peritoneal</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-18 16:56:37 -06:00
</div>
<div class="col-12 px-0 mb-3">
<div class="card bg-white border-0 my-2 rounded-0 bg-custom 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/3.1.png" class="img-fluid mx-3" />
<p class="mb-0">
2026-07-01 02:25:52 -06:00
<strong>Instrucciones:</strong> Presiona cada ícono, lee con atención las oraciones que se presentan acerca de los tipos de diálisis y determina si son falsas o verdaderas.
2026-03-11 11:20:54 -06:00
<!-- para llenar el medidor de salud del paciente. -->
</p>
2025-09-18 16:56:37 -06:00
</div>
</div>
</div>
<div id="actividad-objects" class="col-12">
<div class="row justify-content-center align-items-center">
<div class="col-12 text-center mb-5">
2026-07-01 02:25:52 -06:00
<div class="content-medidor p-2 d-inline-flex flex-row justify-content-center align-items-center gap-3">
2026-03-11 11:20:54 -06:00
<img src="img/07.7.png" class="img-fluid" />
2025-09-18 16:56:37 -06:00
<div class="termometro p-1">
<div id="#med0" class="med_style"></div>
<div id="#med1" class="med_style"></div>
<div id="#med2" class="med_style"></div>
<div id="#med3" class="med_style"></div>
<div id="#med4" class="med_style"></div>
<div id="#med5" class="med_style"></div>
2026-07-01 02:25:52 -06:00
<div id="indicador" class="indicador-med d-flex flex-row justify-content-center align-items-center">
2026-03-11 11:20:54 -06:00
<img src="img/07.5.png" class="img-fluid" />
2025-09-18 16:56:37 -06:00
</div>
</div>
2026-03-11 11:20:54 -06:00
<img src="img/07.6.png" class="img-fluid" />
2025-09-18 16:56:37 -06:00
</div>
</div>
<div class="col-12">
<div class="d-flex flex-row justify-content-center align-items-center gap-3">
2026-07-01 02:25:52 -06:00
<div class="object-btn text-center d-inline-block animate__animated animate__pulse animate__infinite" data-obj="0">
2026-03-11 11:20:54 -06:00
<img src="img/07.4.png" class="img-fluid" />
2025-09-18 16:56:37 -06:00
</div>
2026-07-01 02:25:52 -06:00
<div class="object-btn text-center d-inline-block animate__animated animate__pulse animate__infinite" data-obj="1">
2026-03-11 11:20:54 -06:00
<img src="img/07.3.png" class="img-fluid" />
2025-09-18 16:56:37 -06:00
</div>
2026-07-01 02:25:52 -06:00
<div class="object-btn text-center d-inline-block animate__animated animate__pulse animate__infinite" data-obj="2">
2026-03-11 11:20:54 -06:00
<img src="img/07.2.png" class="img-fluid" />
2025-09-18 16:56:37 -06:00
</div>
2026-07-01 02:25:52 -06:00
<div class="object-btn text-center d-inline-block animate__animated animate__pulse animate__infinite" data-obj="3">
2026-03-11 11:20:54 -06:00
<img src="img/07.1.png" class="img-fluid" style="max-width: 223px" />
2025-09-18 16:56:37 -06:00
</div>
2026-07-01 02:25:52 -06:00
<div class="object-btn text-center d-inline-block animate__animated animate__pulse animate__infinite" data-obj="4">
2026-03-11 11:20:54 -06:00
<img src="img/07.0.png" class="img-fluid" />
2025-09-18 16:56:37 -06:00
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="d-none">
<div id="pops-questions">
<div class="container-fluid">
<div class="row justify-content-center align-items-center">
<div id="txt-question" class="col-12 text-center text-verde-oscuro fw-bold mb-3"></div>
2026-07-01 15:47:43 -06:00
<div class="col-12 mb-3">
2026-07-01 02:25:52 -06:00
<div id="txt-answers" class="d-flex flex-row justify-content-center align-items-center gap-3"></div>
2025-09-18 16:56:37 -06:00
</div>
2026-07-01 15:47:43 -06:00
<div class="col-12 text-center">
<p class="small mb-0">"Estos son casos hipotéticos basados en las referencias bibliográficas."</p>
</div>
2025-09-18 16:56:37 -06:00
</div>
</div>
</div>
<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-18 16:56:37 -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 () {
2026-07-01 02:25:52 -06:00
'use strict';
$('.wrap-course-content').addClass('fake');
2025-09-18 16:56:37 -06:00
let questions;
let currentQuestionIndex = 0;
let currentQuestion;
let correctQuestions = 0;
let currentObjectBtn;
let isCorrectAnswer = false;
2026-07-01 02:25:52 -06:00
const bad = CourseNav.createSound('audio/feedback-incorrect.mpeg');
const good = CourseNav.createSound('audio/feedback-correct.mpeg');
2025-09-18 16:56:37 -06:00
2026-07-01 02:25:52 -06:00
const urlExcelFile = 'Actividades_Rotafolio_Vantive.xlsx';
2025-09-18 16:56:37 -06:00
function readExcelFile(url, callback) {
var xhr = new XMLHttpRequest();
2026-07-01 02:25:52 -06:00
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
2025-09-18 16:56:37 -06:00
xhr.onload = function (e) {
var arrayBuffer = xhr.response;
var data = new Uint8Array(arrayBuffer);
2026-07-01 02:25:52 -06:00
var workbook = XLSX.read(data, { type: 'array' });
2025-09-18 16:56:37 -06:00
var result = {};
2026-03-11 11:20:54 -06:00
workbook.SheetNames.forEach((sheetName) => {
2025-09-18 16:56:37 -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-18 16:56:37 -06:00
const opciones = [];
2026-03-11 11:20:54 -06:00
Object.keys(fila).forEach((key) => {
2026-07-01 02:25:52 -06:00
if (key.startsWith('opcion')) {
2025-09-18 16:56:37 -06:00
opciones.push({
2026-07-01 02:25:52 -06:00
text: String(fila[key]).trim(),
correct: key === 'opcion_c',
2025-09-18 16:56:37 -06:00
});
}
});
return {
2026-07-01 02:25:52 -06:00
pregunta: String(fila.pregunta).trim(),
2025-09-18 16:56:37 -06:00
opciones: opciones,
2026-07-01 02:25:52 -06:00
retroalimentacion_correcta: fila.retroalimentacion_correcta ? fila.retroalimentacion_correcta.trim() : '',
retroalimentacion_incorrecta: fila.retroalimentacion_incorrecta ? fila.retroalimentacion_incorrecta.trim() : '',
2025-09-18 16:56:37 -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;
}
// Cargar preguntas al inicio
2026-03-11 11:20:54 -06:00
readExcelFile(urlExcelFile, function (data) {
2026-07-01 02:25:52 -06:00
const hojaDatos = data['Diapositiva 7'];
2025-09-25 13:03:23 -06:00
questions = procesarPreguntas(hojaDatos);
2025-09-18 16:56:37 -06:00
});
2026-07-01 02:25:52 -06:00
$('.object-btn').click(function (e) {
2025-09-18 16:56:37 -06:00
e.preventDefault();
2026-07-01 02:25:52 -06:00
if ($(this).hasClass('disabled')) return;
2025-09-18 16:56:37 -06:00
CourseNav.soundClick();
currentObjectBtn = $(this);
if (questions && questions.length > 0) {
showRandomQuestion();
}
});
function showRandomQuestion() {
2025-09-25 13:03:23 -06:00
// Seleccionar pregunta en orden secuencial
currentQuestion = questions[currentQuestionIndex];
currentQuestionIndex = (currentQuestionIndex + 1) % questions.length;
2025-09-18 16:56:37 -06:00
2026-07-01 02:25:52 -06:00
const html = $('#pops-questions').html();
2025-09-18 16:56:37 -06:00
Swal.fire({
html: html,
2026-07-01 02:25:52 -06:00
target: document.getElementById('wrap-course-content'),
2025-09-18 16:56:37 -06:00
customClass: {
2026-07-01 02:25:52 -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-18 16:56:37 -06:00
},
2026-07-01 02:25:52 -06:00
confirmButtonText: 'Cerrar',
2025-09-18 16:56:37 -06:00
showConfirmButton: false,
allowOutsideClick: false,
allowEscapeKey: false,
focusConfirm: false,
2026-07-01 02:25:52 -06:00
backdrop: 'rgba(65, 60, 60, .95)',
width: '45em',
2025-09-18 16:56:37 -06:00
didOpen: () => {
displayQuestion();
},
didClose: () => {
CourseNav.audioController.stopAudio();
if (currentObjectBtn) {
2026-07-01 02:25:52 -06:00
currentObjectBtn.addClass('completed disabled');
2025-09-18 16:56:37 -06:00
checkAllCompleted();
}
},
});
}
function displayQuestion() {
const contentSwal = $(Swal.getHtmlContainer());
2026-07-01 02:25:52 -06:00
const txtPregunta = contentSwal.find('#txt-question');
const txtAnswers = contentSwal.find('#txt-answers');
2025-09-18 16:56:37 -06:00
txtPregunta.html(currentQuestion.pregunta);
// Aleatorizar respuestas
const shuffledOpciones = shuffleArray([...currentQuestion.opciones]);
2026-07-01 02:25:52 -06:00
let answersHtml = '';
2025-09-18 16:56:37 -06:00
shuffledOpciones.forEach((opcion, index) => {
answersHtml += `<div class="btn-answer text-white p-2 px-3" data-correct="${opcion.correct}">${opcion.text}</div>`;
});
txtAnswers.html(answersHtml);
// Event listener para respuestas
2026-07-01 02:25:52 -06:00
contentSwal.find('.btn-answer').click(function () {
isCorrectAnswer = $(this).data('correct');
$(this).addClass('selected');
2025-09-18 16:56:37 -06:00
if (isCorrectAnswer) {
good.play();
correctQuestions++;
moveIndicator();
Swal.close();
} else {
bad.play();
}
});
}
function moveIndicator() {
2026-07-01 02:25:52 -06:00
const positions = ['left: 90px', 'left: 170px', 'left: 250px', 'left: 330px', 'left: 410px'];
2025-09-18 16:56:37 -06:00
if (correctQuestions <= 5) {
2026-07-01 02:25:52 -06:00
$('#indicador').attr('style', positions[correctQuestions - 1]);
2025-09-18 16:56:37 -06:00
}
}
function checkAllCompleted() {
2026-07-01 02:25:52 -06:00
const totalButtons = $('.object-btn').length;
const completedButtons = $('.object-btn.completed').length;
2025-09-18 16:56:37 -06:00
if (totalButtons === completedButtons) {
setTimeout(() => {
2026-07-01 02:25:52 -06:00
const html = $('#pop0').html();
2025-09-18 16:56:37 -06:00
Swal.fire({
html: html,
2026-07-01 02:25:52 -06:00
target: document.getElementById('wrap-course-content'),
2025-09-18 16:56:37 -06:00
customClass: {
2026-07-01 02:25:52 -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-18 16:56:37 -06:00
},
2026-07-01 02:25:52 -06:00
confirmButtonText: 'Cerrar',
2025-09-18 16:56:37 -06:00
showConfirmButton: true,
allowOutsideClick: false,
allowEscapeKey: false,
2026-07-01 02:25:52 -06:00
backdrop: 'rgba(65, 60, 60, .95)',
width: '35em',
2025-09-18 16:56:37 -06:00
didClose: () => {
CourseNav.setSlideVisited();
2026-03-11 11:20:54 -06:00
},
2025-09-18 16:56:37 -06:00
});
}, 250);
}
}
});
</script>