This commit is contained in:
2026-07-01 02:25:52 -06:00
parent 8dd25c3b23
commit 0be4d028e1
34 changed files with 443 additions and 440 deletions
+40 -37
View File
@@ -18,7 +18,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 {
@@ -58,11 +58,11 @@
transition: all 0.5s ease;
}
</style>
<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'>
<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">
<div class="col-10 mb-2 animate__animated animate__bounceInDown">
<h2 class="text-center fw-bold text-primary">Control de líquidos</h2>
<hr class="border border-3 border-verde-oscuro hr-style mx-auto my-0" />
@@ -71,8 +71,7 @@
<div class="card bg-inst border-0 my-2 rounded-0 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> Lee cada una de las preguntas acerca del control de líquidos y contesta correctamente. Por cada acierto obtendrás una
pieza del rompecabezas, el reto es descubrir la imagen oculta.</p>
<p class="mb-0 text-start"><strong>Instrucciones:</strong> Lee cada una de las preguntas acerca del control de líquidos y contesta correctamente. Por cada acierto obtendrás una pieza del rompecabezas, el reto es descubrir la imagen oculta.</p>
</div>
</div>
</div>
@@ -82,7 +81,7 @@
<div id="svg-container"></div>
</div>
<div class="col-7 col-actividad">
<div id="card-content-quiz-rompecabezas" class="card bg-white border-0 rounded-15 p-3 card-content-quiz animate__animated animate__zoomIn" style="box-shadow: 0 0 12px rgba(0,0,0,.5);">
<div id="card-content-quiz-rompecabezas" class="card bg-white border-0 rounded-15 p-3 card-content-quiz animate__animated animate__zoomIn" style="box-shadow: 0 0 12px rgba(0, 0, 0, 0.5)">
<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 content-answers"></div>
@@ -99,8 +98,8 @@
<div class="d-none">
<div id="pop0">
<div class="container-fluid">
<div class=" w-100 text-center">
<img src="img/3.5.png" class="img-fluid">
<div class="w-100 text-center">
<img src="img/3.5.png" class="img-fluid" />
</div>
<div class="row justify-content-center">
<div class="col-12 text-center mb-2">
@@ -115,7 +114,7 @@
</div>
<script>
$(function () {
"use strict";
'use strict';
$('.wrap-course-content').addClass('fake');
let questions;
let currentQuestionIndex = 0;
@@ -125,15 +124,19 @@
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',
);
}
const urlExcelFile = 'Actividades_Rotafolio_Vantive.xlsx';
@@ -145,9 +148,9 @@
xhr.onload = function (e) {
var arrayBuffer = xhr.response;
var data = new Uint8Array(arrayBuffer);
var workbook = XLSX.read(data, { type: "array" });
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);
});
@@ -157,21 +160,21 @@
}
function procesarPreguntas(data) {
const preguntas = data.map(fila => {
const preguntas = data.map((fila) => {
const opciones = [];
Object.keys(fila).forEach(key => {
Object.keys(fila).forEach((key) => {
if (key.startsWith('opcion')) {
opciones.push({
text: fila[key].trim(),
correct: key === 'opcion_c'
text: String(fila[key]).trim(),
correct: key === 'opcion_c',
});
}
});
return {
pregunta: fila.pregunta.trim(),
pregunta: String(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;
@@ -188,7 +191,7 @@
function displayQuestion() {
if (currentQuestionIndex < questions.length) {
currentQuestion = questions[currentQuestionIndex];
$('.txt-question').text(currentQuestion.pregunta);
$('.txt-question').html(currentQuestion.pregunta);
$('.content-answers').empty();
@@ -208,7 +211,7 @@
}
function initializeAnswers() {
$('#card-content-quiz-rompecabezas').on('click', '.btn-answer', function() {
$('#card-content-quiz-rompecabezas').on('click', '.btn-answer', function () {
const isCorrect = $(this).data('correct');
if (isCorrect) {
@@ -241,29 +244,29 @@
function checkAllCompleted() {
setTimeout(() => {
const html = $("#pop0").html();
const html = $('#pop0').html();
Swal.fire({
html: html,
target: document.getElementById('wrap-course-content'),
customClass: {
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'
confirmButton: 'btn text-white bg-primary amor fw-semibold animate__animated animate__pulse animate__infinite',
},
confirmButtonText: "Cerrar",
confirmButtonText: 'Cerrar',
showConfirmButton: true,
allowOutsideClick: false,
allowEscapeKey: false,
backdrop: "rgba(65, 60, 60, .95)",
width: "35em",
backdrop: 'rgba(65, 60, 60, .95)',
width: '35em',
didClose: () => {
CourseNav.setSlideVisited();
}
},
});
}, 250);
}
readExcelFile(urlExcelFile, function (data) {
const hojaDatos = data["Diapositiva 17"];
const hojaDatos = data['Diapositiva 17'];
questions = shuffleArray(procesarPreguntas(hojaDatos));
loadSVG();
displayQuestion();