update
This commit is contained in:
+106
-79
@@ -25,7 +25,7 @@
|
||||
.btn-answer {
|
||||
cursor: pointer;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 2px rgba(0, 0, 0, .5);
|
||||
box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.letter {
|
||||
@@ -69,37 +69,44 @@
|
||||
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 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">Autocuidado</h2>
|
||||
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-1 opacity-100">
|
||||
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-1 opacity-100" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 mb-3 text-center">
|
||||
<h4 class="fw-bold text-verde-pino">Consumo y balance de líquidos</h4>
|
||||
</div>
|
||||
<div class="col-12 text-center mb-1 animate__animated animate__zoomIn">
|
||||
<img src="img/11.0.png" class="img-fluid">
|
||||
<img src="img/11.0.png" class="img-fluid" />
|
||||
</div>
|
||||
<div class="col-12 text-center mb-3 animate__animated animate__flipInX">
|
||||
<p> La gran ventaja que le ofrece la DP es que se trata de un tratamiento <strong
|
||||
class="text-lila-claro">autoadministrado y domiciliario</strong>, sin embargo, es necesario que acuda a
|
||||
todas sus consultas de seguimiento y lleve todos sus estudios de laboratorio y registros del tratamiento
|
||||
que le solicite el personal de salud.</p>
|
||||
<p>
|
||||
La gran ventaja que le ofrece la DP es que se trata de un tratamiento
|
||||
<strong class="text-lila-claro">domiciliario</strong>, sin embargo, es necesario que
|
||||
acuda a todas sus consultas de seguimiento y lleve todos sus estudios de laboratorio y
|
||||
registros del tratamiento que le solicite el personal de salud.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-12 text-center animate__animated animate__lightSpeedInLeft animate__delay-1s mb-3">
|
||||
<div class="d-inline-block px-3 py-2 bg-verde-claro rounded-3 text-verde-oscuro fw-bold">
|
||||
<div
|
||||
class="col-12 text-center animate__animated animate__lightSpeedInLeft animate__delay-1s mb-3"
|
||||
>
|
||||
<div
|
||||
class="d-inline-block px-3 py-2 bg-verde-claro rounded-3 text-verde-oscuro fw-bold"
|
||||
>
|
||||
Un aspecto importante a tomar en cuenta es el consumo y balance de líquidos.
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 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">
|
||||
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>
|
||||
@@ -108,15 +115,15 @@
|
||||
</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 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">Autocuidado</h2>
|
||||
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-3 opacity-100">
|
||||
<hr class="border border-2 border-verde-oscuro hr-style my-0 mb-3 opacity-100" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-11 mb-3 text-center">
|
||||
@@ -127,10 +134,12 @@
|
||||
<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> Lea cada una de las preguntas acerca del control de
|
||||
líquidos y conteste correctamente. Por cada acierto obtendrá una
|
||||
pieza del rompecabezas, el reto es descubrir la imagen oculta.</p>
|
||||
<img src="img/book0.png" class="img-fluid" />
|
||||
<p class="mb-0">
|
||||
<strong>Instrucciones:</strong> Lea cada una de las preguntas acerca del
|
||||
control de líquidos y conteste correctamente. Por cada acierto obtendrá una
|
||||
pieza del rompecabezas, el reto es descubrir la imagen oculta.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,10 +151,14 @@
|
||||
<div id="svg-container"></div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div id="card-content-quiz-rompecabezas"
|
||||
class="card bg-white border-0 rounded-15 p-3 card-content-quiz animate__animated animate__zoomIn bx-shadow">
|
||||
<div
|
||||
id="card-content-quiz-rompecabezas"
|
||||
class="card bg-white border-0 rounded-15 p-3 card-content-quiz animate__animated animate__zoomIn bx-shadow"
|
||||
>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 text-center fw-bold text-verde-oscuro txt-question mb-3"></div>
|
||||
<div
|
||||
class="col-12 text-center fw-bold text-verde-oscuro txt-question mb-3"
|
||||
></div>
|
||||
<div class="col-12 content-answers"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -157,18 +170,18 @@
|
||||
</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 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">
|
||||
<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">Autocuidado</h2>
|
||||
<hr class="border border-2 border-verde-oscuro hr-style my-0 opacity-100">
|
||||
<hr class="border border-2 border-verde-oscuro hr-style my-0 opacity-100" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 mb-3 text-center">
|
||||
@@ -177,10 +190,14 @@
|
||||
<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="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()">
|
||||
onclick="CourseNav.reload()"
|
||||
>
|
||||
<h5 class="text-white fw-bold mb-0">Reintentar</h5>
|
||||
</div>
|
||||
</div>
|
||||
@@ -192,47 +209,51 @@
|
||||
<script>
|
||||
$(function () {
|
||||
"use strict";
|
||||
$('.wrap-course-content').addClass('fake');
|
||||
$(".wrap-course-content").addClass("fake");
|
||||
|
||||
let questions;
|
||||
let currentQuestionIndex = 0;
|
||||
let currentQuestion;
|
||||
let correctQuestions = 0;
|
||||
let maxQuestions = -1;
|
||||
const bad = CourseNav.createSound('audio/feedback-incorrect.mpeg');
|
||||
const good = CourseNav.createSound('audio/feedback-correct.mpeg');
|
||||
const bad = CourseNav.createSound("audio/feedback-incorrect.mpeg");
|
||||
const good = CourseNav.createSound("audio/feedback-correct.mpeg");
|
||||
|
||||
function loadSVG() {
|
||||
$.get('img/puzzle.svg', function (data) {
|
||||
var svg = $(data).find('svg');
|
||||
$('#svg-container').html(svg);
|
||||
// Remove width and height attributes to make SVG responsive
|
||||
svg.removeAttr('width').removeAttr('height');
|
||||
$.get(
|
||||
"img/puzzle.svg",
|
||||
function (data) {
|
||||
var svg = $(data).find("svg");
|
||||
$("#svg-container").html(svg);
|
||||
// Remove width and height attributes to make SVG responsive
|
||||
svg.removeAttr("width").removeAttr("height");
|
||||
|
||||
// Ocultar elementos con id que inicie con 'pz' y agregar clase 'piece-puzzle'
|
||||
svg.find('[id^="pz"]').hide().addClass('piece-puzzle');
|
||||
}, 'xml');
|
||||
// Ocultar elementos con id que inicie con 'pz' y agregar clase 'piece-puzzle'
|
||||
svg.find('[id^="pz"]').hide().addClass("piece-puzzle");
|
||||
},
|
||||
"xml"
|
||||
);
|
||||
}
|
||||
|
||||
$('.btn-comenzar').click(function (e) {
|
||||
$(".btn-comenzar").click(function (e) {
|
||||
e.preventDefault();
|
||||
CourseNav.soundClick();
|
||||
$('#inicio').hide();
|
||||
$('#desarrollo').show();
|
||||
$("#inicio").hide();
|
||||
$("#desarrollo").show();
|
||||
});
|
||||
|
||||
const urlExcelFile = 'Actividades_Manual_Vantive.xlsx';
|
||||
const urlExcelFile = "Actividades_Manual_Vantive.xlsx";
|
||||
|
||||
function readExcelFile(url, callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
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 => {
|
||||
workbook.SheetNames.forEach((sheetName) => {
|
||||
var sheet = workbook.Sheets[sheetName];
|
||||
result[sheetName] = XLSX.utils.sheet_to_json(sheet);
|
||||
});
|
||||
@@ -242,13 +263,13 @@
|
||||
}
|
||||
|
||||
function procesarPreguntas(data) {
|
||||
const preguntas = data.map(fila => {
|
||||
const preguntas = data.map((fila) => {
|
||||
const opciones = [];
|
||||
Object.keys(fila).forEach(key => {
|
||||
if (key.startsWith('opcion')) {
|
||||
Object.keys(fila).forEach((key) => {
|
||||
if (key.startsWith("opcion")) {
|
||||
opciones.push({
|
||||
text: fila[key].trim(),
|
||||
correct: key === 'opcion_c'
|
||||
correct: key === "opcion_c",
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -256,7 +277,7 @@
|
||||
pregunta: fila.pregunta.trim(),
|
||||
opciones: opciones,
|
||||
retroalimentacion_correcta: fila.retroalimentacion_correcta.trim(),
|
||||
retroalimentacion_incorrecta: fila.retroalimentacion_incorrecta.trim()
|
||||
retroalimentacion_incorrecta: fila.retroalimentacion_incorrecta.trim(),
|
||||
};
|
||||
});
|
||||
return preguntas;
|
||||
@@ -278,32 +299,36 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$('#card-content-quiz-rompecabezas').hide();
|
||||
$("#card-content-quiz-rompecabezas").hide();
|
||||
|
||||
currentQuestion = questions[currentQuestionIndex];
|
||||
$('.txt-question').text(currentQuestion.pregunta);
|
||||
$(".txt-question").text(currentQuestion.pregunta);
|
||||
|
||||
const answersContainer = $('.content-answers');
|
||||
const answersContainer = $(".content-answers");
|
||||
answersContainer.empty();
|
||||
|
||||
setTimeout(() => {
|
||||
$('#card-content-quiz-rompecabezas').removeClass('animate__zoomIn').addClass('animate__zoomIn').show();
|
||||
$("#card-content-quiz-rompecabezas")
|
||||
.removeClass("animate__zoomIn")
|
||||
.addClass("animate__zoomIn")
|
||||
.show();
|
||||
}, 100);
|
||||
|
||||
const shuffledOpciones = shuffleArray([...currentQuestion.opciones]);
|
||||
|
||||
shuffledOpciones.forEach((opcion, index) => {
|
||||
const btn = $(`<div class="position-relative d-flex flex-row align-items-center gap-0 mb-2 btn-answer" data-correct="${opcion.correct}">
|
||||
const btn =
|
||||
$(`<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>`);
|
||||
answersContainer.append(btn);
|
||||
});
|
||||
|
||||
$('.btn-answer').click(function () {
|
||||
const isCorrect = $(this).data('correct') === true;
|
||||
$(".btn-answer").click(function () {
|
||||
const isCorrect = $(this).data("correct") === true;
|
||||
|
||||
$('.btn-answer').off('click').css('pointer-events', 'none');
|
||||
$(".btn-answer").off("click").css("pointer-events", "none");
|
||||
|
||||
if (isCorrect) {
|
||||
correctQuestions++;
|
||||
@@ -316,12 +341,13 @@
|
||||
|
||||
function showFeedback(isCorrect) {
|
||||
Swal.fire({
|
||||
target: document.getElementById('wrap-course-content'),
|
||||
imageUrl: isCorrect ? 'img/good.png' : 'img/bad.png',
|
||||
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'
|
||||
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)",
|
||||
@@ -332,7 +358,7 @@
|
||||
}
|
||||
currentQuestionIndex++;
|
||||
displayQuestion();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -348,23 +374,24 @@
|
||||
CourseNav.setSlideVisited();
|
||||
|
||||
if (passed) {
|
||||
$('#desarrollo').hide();
|
||||
$('#cierre').show();
|
||||
$("#desarrollo").hide();
|
||||
$("#cierre").show();
|
||||
} else {
|
||||
$('.col-reintentar').show();
|
||||
$('#desarrollo').hide();
|
||||
$('#cierre').show();
|
||||
$(".col-reintentar").show();
|
||||
$("#desarrollo").hide();
|
||||
$("#cierre").show();
|
||||
}
|
||||
}
|
||||
|
||||
readExcelFile(urlExcelFile, function (data) {
|
||||
const hojaDatos = data["Diapositiva 22"];
|
||||
const preguntasProcesadas = shuffleArray(procesarPreguntas(hojaDatos));
|
||||
questions = maxQuestions === -1 ? preguntasProcesadas : preguntasProcesadas.slice(0, maxQuestions);
|
||||
questions =
|
||||
maxQuestions === -1 ? preguntasProcesadas : preguntasProcesadas.slice(0, maxQuestions);
|
||||
loadSVG();
|
||||
setTimeout(() => {
|
||||
displayQuestion();
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user