update
This commit is contained in:
@@ -0,0 +1,368 @@
|
||||
<style>
|
||||
.fake {
|
||||
background-image: url(img/bg01.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.fake1 {
|
||||
background-image: url(img/bg03.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.btn-comenzar {
|
||||
border-radius: 20px;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.drag-item {
|
||||
width: 25%;
|
||||
border-radius: 15px;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
.back-custom {
|
||||
width: 24%;
|
||||
}
|
||||
|
||||
.drop-item {
|
||||
width: 90%;
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
.btn-reintentar {
|
||||
cursor: pointer;
|
||||
}
|
||||
</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'>
|
||||
<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">Terapia segura en casa</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">Higiene y limpieza</h4>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-6 text-center animate__animated animate__zoomIn">
|
||||
<img src="img/08.0.png" class="img-fluid">
|
||||
</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>El jabón que utilice para el lavado de manos de preferencia debe ser <strong class="text-lila-claro">líquido</strong>, sin embargo, lo
|
||||
prioritario es que sea exclusivo para cuando usted realice los recambios en casa.</p>
|
||||
<p><strong class="text-lila-claro">Lo mismo ocurre con la toalla </strong>que utilice para secar sus manos.</p>
|
||||
<p class="mb-0">Sus manos, después de un correcto lavado, se encontrarán <strong class="text-lila-claro">limpias pero nunca estériles.</strong></p>
|
||||
</div>
|
||||
<div
|
||||
class="position-relative w-100 bg-verde-claro-2 text-verde-oscuro px-3 py-2 mb-3 animate__animated animate__flipInX animate__delay-1s">
|
||||
<p class="mb-0 fw-bold text-center">Para un recambio seguro bajo ningún motivo debe tocar las zonas estériles (libres de gérmenes) en el sistema de DP.</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">
|
||||
<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' id="dragAndDrop">
|
||||
<div class='row justify-content-center'>
|
||||
<div class="col-10 text-center animate__animated animate__bounceInDown">
|
||||
<div class="position-relative d-inline-block">
|
||||
<h2 class="text-primary mb-1 fw-bold">Terapia segura en casa</h2>
|
||||
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-2 opacity-100">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-10 mb-1 text-center">
|
||||
<h4 class="fw-bold text-verde-pino">Higiene y limpieza</h4>
|
||||
</div>
|
||||
<div class="col-10 mb-3">
|
||||
<div class="card bg-lila-rosa 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/book0.png" class="img-fluid">
|
||||
<p class="mb-0"><strong>Instrucciones:</strong> Identifique las zonas estériles en el sistema de DP y arrastre sus nombres hacia la fotografía que les corresponda.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 mb-3">
|
||||
<div id="content-drags" class="d-flex flex-row justify-content-center align-items-center gap-3">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div id="content-drops" class="d-flex flex-row justify-content-center align-items-center gap-3"></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'>
|
||||
<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">Terapia segura en casa</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">Higiene y limpieza</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
"use strict";
|
||||
$('.wrap-course-content').addClass('fake');
|
||||
|
||||
$('.btn-comenzar').click(function (e) {
|
||||
e.preventDefault();
|
||||
CourseNav.soundClick();
|
||||
$('#inicio').hide();
|
||||
$('#desarrollo').show();
|
||||
});
|
||||
|
||||
const imgDrop = ['img/08.0.png', 'img/08.0.png', 'img/08.0.png', 'img/08.0.png'];
|
||||
let questions;
|
||||
let correctQuestions = 0;
|
||||
let maxQuestions = 4;
|
||||
const bad = CourseNav.createSound('audio/feedback-incorrect.mpeg');
|
||||
const good = CourseNav.createSound('audio/feedback-correct.mpeg');
|
||||
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);
|
||||
});
|
||||
callback(result);
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
function procesarPreguntas(data) {
|
||||
const preguntas = data.map(fila => {
|
||||
const opciones = [];
|
||||
Object.keys(fila).forEach(key => {
|
||||
if (key.startsWith('opcion') && fila[key]) {
|
||||
opciones.push({
|
||||
text: String(fila[key]).trim(),
|
||||
correct: key === 'opcion_c'
|
||||
});
|
||||
}
|
||||
});
|
||||
return {
|
||||
pregunta: fila.pregunta ? String(fila.pregunta).trim() : '',
|
||||
opciones: opciones,
|
||||
retroalimentacion_correcta: fila.retroalimentacion_correcta ? String(fila.retroalimentacion_correcta).trim() : '',
|
||||
retroalimentacion_incorrecta: fila.retroalimentacion_incorrecta ? String(fila.retroalimentacion_incorrecta).trim() : ''
|
||||
};
|
||||
});
|
||||
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 createDragItems() {
|
||||
const container = $('#content-drags');
|
||||
container.empty();
|
||||
const dragMapping = {
|
||||
'Zona interna del conector a paciente': 0,
|
||||
'Punta abierta en la línea de transferencia': 1,
|
||||
'Sistema Ultrabag en DPCA o Cassette en DPA': 2,
|
||||
'Parte interna del tapón minicap': 3
|
||||
};
|
||||
questions.forEach((question, index) => {
|
||||
question.opciones.forEach((opcion, opcionIndex) => {
|
||||
const dragValue = dragMapping[opcion.text] !== undefined ? dragMapping[opcion.text] : 0;
|
||||
const dragItem = `
|
||||
<div class="drag-item px-3 py-2 bg-verde-claro-2 text-verde-oscuro fw-bold bx-shadow" data-drag="${dragValue}">
|
||||
<div class="d-flex flex-row justify-content-center align-items-center w-100 h-100">${opcion.text}</div>
|
||||
</div>
|
||||
`;
|
||||
container.append(dragItem);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function createDropItems() {
|
||||
const container = $('#content-drops');
|
||||
container.empty();
|
||||
imgDrop.forEach((imagen, index) => {
|
||||
const dropItem = `
|
||||
<div class="card back-custom p-2 bx-shadow rounded-3 border-0">
|
||||
<div class="w-100 container-drop gap-2">
|
||||
<div class="position-relative w-100 text-center mx-auto">
|
||||
<img src="${imagen}" class="img-fluid">
|
||||
</div>
|
||||
<div class="card-drop bg-verde-claro rounded-3 d-flex flex-row justify-content-center align-items-center gap-0">
|
||||
<div class="card num-card d-flex justify-content-center border-0 bg-verde-pino px-3 py-2 h-100">
|
||||
<h3 class="fw-bold text-white mb-0">${index + 1}</h3>
|
||||
</div>
|
||||
<div class="drop-item px-2 card h-100 bg-transparent border-0 shadow-none" data-drop="${index}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
container.append(dropItem);
|
||||
});
|
||||
}
|
||||
|
||||
function initializeDragDrop() {
|
||||
let correctCount = 0;
|
||||
let totalItems = 4;
|
||||
|
||||
$('.drag-item').draggable({
|
||||
revert: 'invalid',
|
||||
revertDuration: 300,
|
||||
containment: "#desarrollo",
|
||||
cursor: "grabbing",
|
||||
start: function (event, ui) {
|
||||
$(this).css({'z-index': 1000, 'transform': 'scale(0.8)'});
|
||||
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;
|
||||
var scale = parseFloat($('.wrap-course-content').css('transform').split('(')[1]) || 1;
|
||||
ui.position.left = newLeft / scale;
|
||||
ui.position.top = newTop / scale;
|
||||
},
|
||||
stop: function (event, ui) {
|
||||
$(this).css({'z-index': 1, 'transform': 'scale(1)'});
|
||||
}
|
||||
});
|
||||
|
||||
$('.drop-item').droppable({
|
||||
accept: '.drag-item',
|
||||
drop: function (event, ui) {
|
||||
const draggedItem = ui.draggable;
|
||||
const dragValue = parseInt(draggedItem.data('drag'));
|
||||
const dropValue = parseInt($(this).data('drop'));
|
||||
const isCorrect = dragValue === dropValue;
|
||||
|
||||
CourseNav.audioController.stopAllSoundsAndPlay(isCorrect ? good : bad);
|
||||
|
||||
$(this).html(draggedItem.find('.d-flex').text()).addClass('text-center d-flex align-items-center justify-content-center');
|
||||
draggedItem.hide();
|
||||
|
||||
if (isCorrect) {
|
||||
correctCount++;
|
||||
} else {
|
||||
$(this).siblings('.num-card').removeClass('bg-verde-pino').addClass('bg-danger');
|
||||
}
|
||||
|
||||
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: () => {
|
||||
if ($('.drag-item:visible').length === 0) {
|
||||
const percentage = (correctCount / totalItems) * 100;
|
||||
$('#desarrollo').hide();
|
||||
$('#cierre').show();
|
||||
if (percentage < 80) {
|
||||
$('.col-reintentar').show();
|
||||
}
|
||||
CourseNav.setSlideVisited();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function shuffleDragItems() {
|
||||
const container = $('#content-drags');
|
||||
const items = container.children().toArray();
|
||||
const shuffled = shuffleArray(items);
|
||||
shuffled.forEach(item => container.append(item));
|
||||
}
|
||||
|
||||
readExcelFile(urlExcelFile, function (data) {
|
||||
const hojaDatos = data["Diapositiva 16"];
|
||||
questions = shuffleArray(procesarPreguntas(hojaDatos)).slice(0, maxQuestions);
|
||||
createDragItems();
|
||||
createDropItems();
|
||||
shuffleDragItems();
|
||||
initializeDragDrop();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user