2025-09-24 22:51:53 -06:00
< style >
. fake {
background-image : url ( img/bg03.jpg ) ;
background-repeat : no-repeat ;
background-position : center ;
background-size : cover ;
}
. hr-style {
opacity : 1 ;
width : 23 % ;
}
. bg-inst {
background-color : #e3ece8 ;
}
. med_style {
position : relative ;
width : 35 px ;
height : 35 px ;
background : #4d4d4d ;
border : 4 px solid #808080 ;
2026-07-01 15:47:43 -06:00
box-shadow : 0 0 15 px rgba ( 0 , 0 , 0 , 0.5 ) ;
2025-09-24 22:51:53 -06:00
}
. med_style . visited {
2026-07-01 15:47:43 -06:00
background : #8eba1f ;
background : linear-gradient ( to right , #8eba1f 0 % , #105742 100 % ) ;
2025-09-24 22:51:53 -06:00
border : 4 px solid #ffffff ;
}
. pop_html_style . padd_perso . swal2-html-container {
padding : 0 ;
}
. object-btn {
cursor : pointer ;
position : relative ;
2025-09-25 13:03:23 -06:00
width : 19 % ;
2025-09-24 22:51:53 -06:00
}
. btn-answer {
cursor : pointer ;
border-radius : 10 px ;
2026-07-01 15:47:43 -06:00
box-shadow : 0 0 2 px rgba ( 0 , 0 , 0 , 0.5 ) ;
2025-09-24 22:51:53 -06:00
width : 95 % ;
}
. letter {
background-color : #6c9d7a ;
border-radius : 10 px ;
border-top-right-radius : 0 ;
border-bottom-right-radius : 0 ;
}
. btn-answer . selected {
background-color : #d9c5d7 ;
}
. btn-answer . selected . letter {
background-color : #925c8d ;
}
. btn-answer : hover {
background-color : #d9c5d7 ;
}
. btn-answer : hover . letter {
background-color : #925c8d ;
}
. object-btn . completed :: before {
content : url ( img/18.5.png ) ;
position : absolute ;
top : 65 px ;
left : 0 ;
right : 0 ;
margin : 0 auto ;
}
2025-12-10 12:06:52 -06:00
. phone-numbers {
2026-07-01 15:47:43 -06:00
pointer-events : none !important ;
2025-12-10 12:06:52 -06:00
user-select : text ;
-webkit- user-select : text ;
-moz- user-select : text ;
-ms- user-select : text ;
}
2025-09-24 22:51:53 -06:00
< / style >
2026-07-01 15:47:43 -06:00
< div 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-12" >
< div class = "row justify-content-center" >
2025-09-24 22:51:53 -06:00
< div class = "col-10 mb-2 animate__animated animate__bounceInDown" >
< h2 class = "text-center fw-bold text-primary" > Consejos útiles< / h2 >
< hr class = "border border-3 border-verde-oscuro hr-style mx-auto my-0" / >
< / div >
< div class = "col-8 px-0 mb-3 animate__animated animate__lightSpeedInLeft" id = "col-instrucciones" >
< div class = "card bg-inst border-0 my-2 rounded-3 bg-custom ps-4 pe-3 py-2 text-center" >
< div class = "d-flex justify-content-center align-items-center flex-row gap-2" >
< img src = "img/3.1.png" class = "img-fluid mx-3" / >
< p class = "mb-0 text-start" > < strong > Instrucciones:< / strong > Da clic en cada una de las salas y contesta la pregunta correspondiente al tema para ganar los puntos.< / p >
< / 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-3" >
< div class = "content-medidor bg-white rounded-5 p-3 d-inline-flex flex-row justify-content-center align-items-center gap-3" >
< h4 class = "mb-0 fw-bold text-verde-pino" > Puntos:< / h4 >
< div class = "grids-med d-flex flex-row justify-content-center align-items-center gap-3" >
< 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 >
< / div >
< / div >
< div class = "col-11" >
2025-09-25 13:03:23 -06:00
< div class = "d-flex flex-row justify-content-center gap-2" >
2025-09-24 22:51:53 -06:00
< div class = "object-btn text-center d-inline-block" data-obj = "0" >
2026-07-01 15:47:43 -06:00
< img src = "img/18.0.png" class = "img-fluid mb-2 animate__animated animate__pulse animate__infinite" / > < br / >
2025-09-24 22:51:53 -06:00
< h4 class = "fw-bold text-center text-primary" > Sala: Estilo de vida< / h4 >
< / div >
< div class = "object-btn text-center d-inline-block" data-obj = "1" >
2026-07-01 15:47:43 -06:00
< img src = "img/18.1.png" class = "img-fluid mb-2 animate__animated animate__pulse animate__infinite" / > < br / >
2025-09-24 22:51:53 -06:00
< h4 class = "fw-bold text-center text-primary" > Sala: Desecho de residuos< / h4 >
< / div >
< div class = "object-btn text-center d-inline-block" data-obj = "2" >
2026-07-01 15:47:43 -06:00
< img src = "img/18.2.png" class = "img-fluid mb-2 animate__animated animate__pulse animate__infinite" / > < br / >
2025-09-24 22:51:53 -06:00
< h4 class = "fw-bold text-center text-primary" > Sala: Entrega domiciliaria< / h4 >
< / div >
< div class = "object-btn text-center d-inline-block" data-obj = "3" >
2026-07-01 15:47:43 -06:00
< img src = "img/18.3.png" class = "img-fluid mb-2 animate__animated animate__pulse animate__infinite" / > < br / >
2025-09-24 22:51:53 -06:00
< h4 class = "fw-bold text-center text-primary" > Sala: Soporte técnico< / h4 >
2026-07-01 15:47:43 -06:00
< h4 class = "mb-0 text-primary fw-bold phone-numbers" >
777 329 6162 < br / >
777 160 7199
< / h4 >
2025-09-24 22:51:53 -06:00
< / div >
< div class = "object-btn text-center d-inline-block" data-obj = "4" >
2026-07-01 15:47:43 -06:00
< img src = "img/18.4.png" class = "img-fluid mb-2 animate__animated animate__pulse animate__infinite" / > < br / >
2025-09-24 22:51:53 -06:00
< h4 class = "fw-bold text-center text-primary" > Sala: Reportes< / h4 >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "d-none" >
< div id = "pops-questions" >
2026-07-01 15:47:43 -06:00
< div class = "container-fluid px-0" style = "overflow: hidden; border-top-left-radius: 12px; border-top-right-radius: 12px" >
2025-09-24 22:51:53 -06:00
< div class = "row justify-content-center align-items-center" >
< div class = "col-12 text-center mb-3 img-pregunta bg-secondary" > < / div >
< div id = "txt-question" class = "col-12 text-center text-verde-oscuro fw-bold mb-3 px-4" > < / div >
2026-07-01 15:47:43 -06:00
< div class = "col-12 px-4 mb-3" >
2025-09-24 22:51:53 -06:00
< div id = "txt-answers" class = "d-flex flex-column justify-content-center align-items-center gap-3 text-start" > < / div >
< / 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-24 22:51:53 -06:00
< / div >
< / div >
< / div >
< div id = "pop0" >
< div class = "container-fluid" >
2026-07-01 15:47:43 -06:00
< div class = "w-100 text-center" >
< img src = "img/3.5.png" class = "img-fluid" / >
2025-09-24 22:51:53 -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 15:47:43 -06:00
'use strict' ;
2025-09-24 22:51:53 -06:00
$ ( '.wrap-course-content' ) . addClass ( 'fake' ) ;
let questions ;
let currentQuestionIndex = 0 ;
let currentQuestion ;
let correctQuestions = 0 ;
const bad = CourseNav . createSound ( 'audio/feedback-incorrect.mpeg' ) ;
const good = CourseNav . createSound ( 'audio/feedback-correct.mpeg' ) ;
const imganesPop = [ '<img src="img/18.0.png" class="img-fluid">' , '<img src="img/18.1.png" class="img-fluid">' , '<img src="img/18.2.png" class="img-fluid">' , '<img src="img/18.3.png" class="img-fluid">' , '<img src="img/18.4.png" class="img-fluid">' ] ;
const urlExcelFile = 'Actividades_Rotafolio_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 ) ;
2026-07-01 15:47:43 -06:00
var workbook = XLSX . read ( data , { type : 'array' } ) ;
2025-09-24 22:51:53 -06:00
var result = { } ;
2026-07-01 15:47:43 -06:00
workbook . SheetNames . forEach ( ( sheetName ) => {
2025-09-24 22:51:53 -06:00
var sheet = workbook . Sheets [ sheetName ] ;
result [ sheetName ] = XLSX . utils . sheet _to _json ( sheet ) ;
} ) ;
callback ( result ) ;
} ;
xhr . send ( ) ;
}
function procesarPreguntas ( data ) {
2026-07-01 15:47:43 -06:00
const preguntas = data . map ( ( fila ) => {
2025-09-24 22:51:53 -06:00
const opciones = [ ] ;
2026-07-01 15:47:43 -06:00
Object . keys ( fila ) . forEach ( ( key ) => {
2025-09-24 22:51:53 -06:00
if ( key . startsWith ( 'opcion' ) ) {
opciones . push ( {
text : fila [ key ] . trim ( ) ,
2026-07-01 15:47:43 -06:00
correct : key === 'opcion_c' ,
2025-09-24 22:51:53 -06:00
} ) ;
}
} ) ;
return {
pregunta : fila . pregunta . trim ( ) ,
opciones : opciones ,
retroalimentacion _correcta : fila . retroalimentacion _correcta ? fila . retroalimentacion _correcta . trim ( ) : '' ,
2026-07-01 15:47:43 -06:00
retroalimentacion _incorrecta : fila . retroalimentacion _incorrecta ? fila . retroalimentacion _incorrecta . trim ( ) : '' ,
2025-09-24 22:51:53 -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 ;
}
let currentObjectBtn ;
let isCorrectAnswer = false ;
readExcelFile ( urlExcelFile , function ( data ) {
2026-07-01 15:47:43 -06:00
const hojaDatos = data [ 'Diapositiva 20' ] ;
2025-09-24 22:51:53 -06:00
questions = procesarPreguntas ( hojaDatos ) ;
// Enable click handlers after questions are loaded
$ ( '.object-btn' ) . click ( function ( e ) {
e . preventDefault ( ) ;
if ( $ ( this ) . hasClass ( 'disabled' ) ) return ;
CourseNav . soundClick ( ) ;
currentObjectBtn = $ ( this ) ;
showRandomQuestion ( ) ;
} ) ;
} ) ;
function showRandomQuestion ( ) {
// Seleccionar pregunta por índice del botón
const objIndex = currentObjectBtn . data ( 'obj' ) ;
currentQuestion = questions [ objIndex ] ;
2026-07-01 15:47:43 -06:00
const html = $ ( '#pops-questions' ) . html ( ) ;
2025-09-24 22:51:53 -06:00
Swal . fire ( {
html : html ,
target : document . getElementById ( 'wrap-course-content' ) ,
customClass : {
popup : 'pop_html_style padd_perso border border-3 border-primary rounded-4' ,
2026-07-01 15:47:43 -06:00
confirmButton : 'btn text-white bg-primary amor fw-semibold animate__animated animate__pulse animate__infinite' ,
2025-09-24 22:51:53 -06:00
} ,
2026-07-01 15:47:43 -06:00
confirmButtonText : 'Cerrar' ,
2025-09-24 22:51:53 -06:00
showConfirmButton : false ,
allowOutsideClick : false ,
allowEscapeKey : false ,
focusConfirm : false ,
2026-07-01 15:47:43 -06:00
backdrop : 'rgba(65, 60, 60, .95)' ,
width : '50em' ,
2025-09-24 22:51:53 -06:00
didOpen : ( ) => {
displayQuestion ( ) ;
} ,
didClose : ( ) => {
//CourseNav.audioController.stopAudio();
checkAllCompleted ( ) ;
} ,
} ) ;
}
function displayQuestion ( ) {
const objIndex = currentObjectBtn . data ( 'obj' ) ;
const container = Swal . getHtmlContainer ( ) ;
$ ( container ) . find ( '.img-pregunta' ) . html ( imganesPop [ objIndex ] ) ;
$ ( container ) . find ( '#txt-question' ) . html ( ` <p class="fw-bold"> ${ currentQuestion . pregunta } </p> ` ) ;
const shuffledAnswers = shuffleArray ( [ ... currentQuestion . opciones ] ) ;
let answersHTML = '' ;
shuffledAnswers . forEach ( ( opcion , index ) => {
answersHTML += ` <div class="position-relative d-flex flex-row align-items-center gap-0 mb-2 btn-answer" data-correct=" ${ opcion . correct } ">
<div class="d-flex flex-row justify-content-center align-items-center letter text-white text-center p-3"> ${ String . fromCharCode ( 97 + index ) } </div>
<div class="txt-answer ps-3"> ${ opcion . text } </div>
</div> ` ;
} ) ;
$ ( container ) . find ( '#txt-answers' ) . html ( answersHTML ) ;
2026-07-01 15:47:43 -06:00
$ ( container )
. find ( '.btn-answer' )
. click ( function ( ) {
const isCorrect = $ ( this ) . data ( 'correct' ) ;
handleAnswer ( isCorrect ) ;
} ) ;
2025-09-24 22:51:53 -06:00
}
function handleAnswer ( isCorrect ) {
if ( isCorrect ) {
CourseNav . audioController . stopAllSoundsAndPlay ( good ) ;
correctQuestions ++ ;
// Marcar medidor como visitado
$ ( ` .med_style:eq( ${ correctQuestions - 1 } ) ` ) . addClass ( 'visited' ) ;
// Marcar botón como disabled
currentObjectBtn . addClass ( 'disabled completed' ) ;
currentObjectBtn . find ( 'img' ) . removeClass ( 'animate__pulse animate__infinite' ) ;
Swal . close ( ) ;
} else {
CourseNav . audioController . stopAllSoundsAndPlay ( bad ) ;
}
}
function checkAllCompleted ( ) {
if ( correctQuestions >= 5 ) {
setTimeout ( ( ) => {
2026-07-01 15:47:43 -06:00
const html = $ ( '#pop0' ) . html ( ) ;
2025-09-24 22:51:53 -06:00
Swal . fire ( {
html : html ,
target : document . getElementById ( 'wrap-course-content' ) ,
customClass : {
popup : 'pop_html_style border border-3 border-primary rounded-4' ,
2026-07-01 15:47:43 -06:00
confirmButton : 'btn text-white bg-primary amor fw-semibold animate__animated animate__pulse animate__infinite' ,
2025-09-24 22:51:53 -06:00
} ,
2026-07-01 15:47:43 -06:00
confirmButtonText : 'Cerrar' ,
2025-09-24 22:51:53 -06:00
showConfirmButton : true ,
allowOutsideClick : false ,
allowEscapeKey : false ,
2026-07-01 15:47:43 -06:00
backdrop : 'rgba(65, 60, 60, .95)' ,
width : '35em' ,
2025-09-24 22:51:53 -06:00
didClose : ( ) => {
CourseNav . setSlideVisited ( ) ;
2026-07-01 15:47:43 -06:00
} ,
2025-09-24 22:51:53 -06:00
} ) ;
} , 250 ) ;
}
}
} ) ;
< / script >