2025-10-06 17:03:24 -06:00
< style >
. fake {
2025-10-06 19:38:34 -06:00
background-image : url ( img/bg04.jpg ) ;
2025-10-06 17:03:24 -06:00
background-repeat : no-repeat ;
background-position : center ;
background-size : cover ;
background-attachment : fixed ;
}
. fake1 {
2025-10-06 19:38:34 -06:00
background-image : url ( img/bg03.jpg ) ;
2025-10-06 17:03:24 -06:00
background-repeat : no-repeat ;
background-position : center ;
background-size : cover ;
background-attachment : fixed ;
}
. btn-comenzar {
border-radius : 20 px ;
border-bottom-left-radius : 0 ;
border-bottom-right-radius : 0 ;
cursor : pointer ;
}
/* Estilos para drag and drop */
. options {
display : grid ;
grid-template-columns : repeat ( 4 , 1 fr ) ;
grid-template-rows : repeat ( 2 , 1 fr ) ;
gap : 15 px ;
/* padding: 20px; */
}
. draggable-option {
cursor : grab ;
background-image : url ( 'img/17.2.png' ) ;
background-size : 100 % auto ;
background-position : center ;
background-repeat : no-repeat ;
border-radius : 15 px ;
border : 3 px solid #dee2e6 ;
transition : all 0.3 s ease ;
user-select : none ;
height : 180 px ;
width : 200 px ;
display : flex ;
align-items : center ;
justify-content : center ;
text-align : center ;
padding : 15 px ;
color : #333 ;
font-weight : bold ;
text-shadow : 1 px 1 px 2 px rgba ( 255 , 255 , 255 , 0.8 ) ;
border : none ;
position : relative ;
}
. draggable-option : hover {
border-color : #6c9d7a ;
transform : translateY ( -5 px ) scale ( 1.05 ) ;
filter : drop-shadow ( 0 8 px 20 px rgba ( 0 , 0 , 0 , 0.2 ) ) ;
/* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); */
}
. draggable-option . dragging {
opacity : 0.7 ;
transform : rotate ( 8 deg ) scale ( 0.95 ) ;
cursor : grabbing ;
}
. option-text {
position : absolute ;
top : 44 % ;
left : 0 % ;
width : 90 % ;
background : transparent ;
height : 40 % ;
display : flex ;
justify-content : center ;
align-items : center ;
}
. container-drag {
min-height : 150 px ;
border : 3 px dashed #ccc !important ;
transition : all 0.3 s ease ;
display : flex ;
align-items : center ;
justify-content : center ;
position : relative ;
}
. container-drag . drag-over {
border-color : #6c9d7a !important ;
background-color : rgba ( 108 , 157 , 122 , 0.1 ) ;
}
. container-drag . has-answer {
border-color : #925c8d !important ;
background-color : rgba ( 146 , 92 , 141 , 0.1 ) ;
}
. draggable-option . used {
opacity : 0.3 ;
pointer-events : none ;
text-decoration : line-through ;
}
. draggable-option . hidden {
display : none ;
}
. dropped-option {
position : absolute ;
top : 50 % ;
left : 50 % ;
transform : translate ( -50 % , -50 % ) ;
background-color : #925c8d ;
color : white ;
padding : 10 px 15 px ;
border-radius : 8 px ;
font-weight : bold ;
z-index : 10 ;
}
2025-10-06 19:38:34 -06:00
. btn-reintentar {
cursor : pointer ;
}
2025-10-06 17:03:24 -06:00
< / 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 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 >
2025-10-08 12:32:24 -06:00
< div class = "col-12 mb-3 text-center" >
< h4 class = "fw-bold text-verde-pino" > DPCA< / h4 >
< / div >
2025-10-06 17:03:24 -06:00
< 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 >
< / div >
< / div >
< / div >
< / div >
2025-10-22 09:12:21 -06:00
< div class = "col-4 text-center mb-1 animate__animated animate__zoomIn" >
2025-10-06 17:03:24 -06:00
< img src = "img/17.0.png" class = "img-fluid" >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< 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" >
2025-10-08 11:06:36 -06:00
< 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.
2025-10-06 17:03:24 -06:00
< / p >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / 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" >
< / div >
< / 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?< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "col-8" >
< div class = "options" > < / 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" > 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 >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< script >
$ ( 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 ( ) ;
} ) ;
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" ) ) {
opciones . push ( {
text : fila [ key ] . trim ( ) ,
correct : key === "opcion_c" ,
} ) ;
}
} ) ;
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 ;
}
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 ;
}
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 } `
} ) ;
} ) ;
} ) ;
// Barajar todas las opciones
todasLasOpciones = shuffleArray ( todasLasOpciones ) ;
// Mostrar todas las opciones
mostrarTodasLasOpciones ( ) ;
}
function mostrarTodasLasOpciones ( ) {
const $options = $ ( '.options' ) ;
$options . empty ( ) ;
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>
` ) ;
$options . append ( $option ) ;
} ) ;
setupDragAndDrop ( ) ;
}
function mostrarPregunta ( ) {
if ( questions . length === 0 || currentQuestionIndex >= questions . length ) {
finalizarJuego ( ) ;
return ;
}
currentQuestion = questions [ currentQuestionIndex ] ;
// Mostrar la pregunta en el elemento .question
$ ( '.question' ) . text ( currentQuestion . pregunta ) ;
// Limpiar el área de drop
$ ( '.container-drag' ) . removeClass ( 'has-answer' ) . find ( '.dropped-option' ) . remove ( ) ;
// Rehabilitar todas las opciones para la nueva pregunta
$ ( '.draggable-option' ) . attr ( 'draggable' , true ) . css ( {
'opacity' : '1' ,
'pointer-events' : 'auto'
} ) ;
}
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 ) ;
}
} ) ;
}
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 ) ;
2025-10-06 19:38:34 -06:00
} , 250 ) ;
2025-10-06 17:03:24 -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 ( ) ;
}
} ) ;
}
function continuarJuego ( ) {
currentQuestionIndex ++ ;
if ( currentQuestionIndex >= questions . length ) {
setTimeout ( ( ) => {
finalizarJuego ( ) ;
2025-10-06 19:38:34 -06:00
} , 500 ) ;
2025-10-06 17:03:24 -06:00
} else {
preguntasActual ++ ;
mostrarPregunta ( ) ;
}
}
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' ) ;
}
}
function finalizarJuego ( ) {
const porcentaje = ( preguntasCorrectas / questions . length ) * 100 ;
const aprobado = porcentaje >= 60 ;
2025-10-06 19:38:34 -06:00
$ ( '.wrap-course-content' ) . addClass ( 'fake1' ) . removeClass ( 'fake' ) ;
CourseNav . setSlideVisited ( ) ;
2025-10-06 17:03:24 -06:00
if ( aprobado ) {
$ ( '#desarrollo' ) . hide ( ) ;
$ ( '#cierre' ) . show ( ) ;
} else {
$ ( '.col-reintentar' ) . show ( ) ;
$ ( '#desarrollo' ) . hide ( ) ;
$ ( '#cierre' ) . show ( ) ;
}
}
readExcelFile ( urlExcelFile , function ( data ) {
const hojaDatos = data [ "Diapositiva 37" ] ;
questions = procesarPreguntas ( hojaDatos ) ;
preguntasMax = questions . length ;
} ) ;
} ) ;
2025-10-06 19:38:34 -06:00
< / script >