actualizacion de imagenes e actividades
This commit is contained in:
+98
-83
@@ -16,8 +16,12 @@
|
||||
}
|
||||
|
||||
.bg-custom-transparent {
|
||||
background: rgba(242, 232, 222, .76);
|
||||
background: linear-gradient(to bottom, rgba(242, 232, 222, .6) 0%, rgba(240, 244, 242, .9) 100%);
|
||||
background: rgba(242, 232, 222, 0.76);
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(242, 232, 222, 0.6) 0%,
|
||||
rgba(240, 244, 242, 0.9) 100%
|
||||
);
|
||||
}
|
||||
|
||||
/* .bg-custom-transparent img {
|
||||
@@ -72,76 +76,91 @@
|
||||
vertical-align: middle;
|
||||
} */
|
||||
</style>
|
||||
<div class='page-sco py-2 py-md-4 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-4 h-100">
|
||||
<div class="container h-100">
|
||||
<div
|
||||
id="drag-drop-activity"
|
||||
class="row justify-content-center align-items-center h-100"
|
||||
style="overflow: hidden"
|
||||
>
|
||||
<div class="col-12">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-10 mb-2">
|
||||
<h2 class="text-center fw-bold text-primary">Tipos de diálisis</h2>
|
||||
<hr class="border border-3 border-verde-oscuro hr-style mx-auto my-0">
|
||||
<hr class="border border-3 border-verde-oscuro hr-style mx-auto my-0" />
|
||||
</div>
|
||||
<div class="col-7 px-0">
|
||||
<div class="card border-0 my-2 rounded bg-secondary shadow p-3 text-center">
|
||||
<div class="d-flex justify-content-center align-items-center flex-row">
|
||||
<img src="img/2.1.png" class="img-fluid mx-3">
|
||||
<p class="mb-0"><strong>Instrucciones:</strong> Toma los nombres y arrástralos hacia el lugar que les corresponda en las imágenes.</p>
|
||||
<img src="img/2.1.png" class="img-fluid mx-3" />
|
||||
<p class="mb-0">
|
||||
<strong>Instrucciones:</strong> Toma los nombres y arrástralos hacia el lugar que
|
||||
les corresponda en las imágenes.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="drag-drop-activity" class="col-12">
|
||||
<div class="col-12">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 mb-3">
|
||||
<div class="card bg-transparent border-0 rounded-0 shadow-none p-0">
|
||||
<div class="d-flex flex-row justify-content-center gap-3">
|
||||
<div class="content-enfermedad text-center">
|
||||
<div class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center">
|
||||
<div
|
||||
class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center"
|
||||
>
|
||||
<div class="card-header bg-transparent">
|
||||
<img src="img/4.1.png" class="img-fluid">
|
||||
<img src="img/4.1.png" class="img-fluid" />
|
||||
</div>
|
||||
<div class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded">
|
||||
<div class="bg-secondary text-white fw-bold py-2 px-2">
|
||||
1
|
||||
</div>
|
||||
<div
|
||||
class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded"
|
||||
>
|
||||
<div class="bg-secondary text-white fw-bold py-2 px-2">1</div>
|
||||
<div class="option w-100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-enfermedad text-center">
|
||||
<div class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center">
|
||||
<div
|
||||
class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center"
|
||||
>
|
||||
<div class="card-header bg-transparent">
|
||||
<img src="img/4.2.png" class="img-fluid">
|
||||
<img src="img/4.2.png" class="img-fluid" />
|
||||
</div>
|
||||
<div class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded">
|
||||
<div class="bg-secondary text-white fw-bold py-2 px-2">
|
||||
2
|
||||
</div>
|
||||
<div
|
||||
class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded"
|
||||
>
|
||||
<div class="bg-secondary text-white fw-bold py-2 px-2">2</div>
|
||||
<div class="option w-100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-enfermedad text-center">
|
||||
<div class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center">
|
||||
<div
|
||||
class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center"
|
||||
>
|
||||
<div class="card-header bg-transparent">
|
||||
<img src="img/4.3.png" class="img-fluid">
|
||||
<img src="img/4.3.png" class="img-fluid" />
|
||||
</div>
|
||||
<div class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded">
|
||||
<div class="bg-secondary text-white fw-bold py-2 px-2">
|
||||
3
|
||||
</div>
|
||||
<div
|
||||
class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded"
|
||||
>
|
||||
<div class="bg-secondary text-white fw-bold py-2 px-2">3</div>
|
||||
<div class="option w-100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-enfermedad text-center">
|
||||
<div class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center">
|
||||
<div
|
||||
class="card rounded bg-custom-transparent border-0 shadow px-3 py-2 mt-2 text-center"
|
||||
>
|
||||
<div class="card-header bg-transparent">
|
||||
<img src="img/4.4.png" class="img-fluid">
|
||||
<img src="img/4.4.png" class="img-fluid" />
|
||||
</div>
|
||||
<div class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded">
|
||||
<div class="bg-secondary text-white fw-bold py-2 px-2">
|
||||
4
|
||||
</div>
|
||||
<div
|
||||
class="w-100 form-append bg-secondary-light d-flex flex-row border-0 rounded"
|
||||
>
|
||||
<div class="bg-secondary text-white fw-bold py-2 px-2">4</div>
|
||||
<div class="option w-100"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -162,8 +181,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">
|
||||
@@ -179,27 +198,27 @@
|
||||
<script>
|
||||
$(function () {
|
||||
"use strict";
|
||||
$('.wrap-course-content').addClass('fake');
|
||||
$(".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 bad = CourseNav.createSound("audio/feedback-incorrect.mpeg");
|
||||
const good = CourseNav.createSound("audio/feedback-correct.mpeg");
|
||||
|
||||
const urlExcelFile = 'Drag_Drop2.xlsx';
|
||||
const urlExcelFile = "Drag_Drop2.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);
|
||||
});
|
||||
@@ -209,13 +228,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",
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -223,7 +242,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;
|
||||
@@ -238,36 +257,36 @@
|
||||
}
|
||||
|
||||
function CreateDragAndDrop() {
|
||||
$('.content-enfermedad').each(function (index) {
|
||||
$(".content-enfermedad").each(function (index) {
|
||||
if (questions && questions[index]) {
|
||||
const dropDiv = `<div class="position-relative card bg-transparent drop-card shadow-none rounded-0 p-0 mx-auto" data-drop="${index}"></div>`;
|
||||
$(this).find('.option').append(dropDiv);
|
||||
$(this).find(".option").append(dropDiv);
|
||||
}
|
||||
});
|
||||
|
||||
// Crear todas las respuestas en #content-drags
|
||||
let allOptions = [];
|
||||
questions.forEach((question, index) => {
|
||||
question.opciones.forEach(opcion => {
|
||||
question.opciones.forEach((opcion) => {
|
||||
allOptions.push({ text: opcion.text, index: index });
|
||||
});
|
||||
});
|
||||
|
||||
allOptions = shuffleArray(allOptions);
|
||||
allOptions.forEach(option => {
|
||||
allOptions.forEach((option) => {
|
||||
const dragDiv = `<div class="card card-drag bg-verde-oscuro border-0 shadow-none px-3 py-2 text-white text-center" data-drag="${option.index}">${option.text}</div>`;
|
||||
$('#content-drags').append(dragDiv);
|
||||
$("#content-drags").append(dragDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function initializeDragAndDrop() {
|
||||
$('.card-drag').draggable({
|
||||
revert: 'invalid',
|
||||
$(".card-drag").draggable({
|
||||
revert: "invalid",
|
||||
revertDuration: 300,
|
||||
containment: "#drag-drop-activity",
|
||||
/* containment: "#drag-drop-activity", */
|
||||
cursor: "grabbing",
|
||||
start: function (event, ui) {
|
||||
$(this).css('z-index', 1000);
|
||||
$(this).css("z-index", 1000);
|
||||
ui.position.left = 0;
|
||||
ui.position.top = 0;
|
||||
},
|
||||
@@ -280,32 +299,32 @@
|
||||
ui.position.top = newTop;
|
||||
},
|
||||
stop: function (event, ui) {
|
||||
$(this).css('z-index', 1);
|
||||
}
|
||||
$(this).css("z-index", 1);
|
||||
},
|
||||
});
|
||||
|
||||
$('.drop-card').droppable({
|
||||
accept: '.card-drag',
|
||||
tolerance: 'pointer',
|
||||
$(".drop-card").droppable({
|
||||
accept: ".card-drag",
|
||||
tolerance: "pointer",
|
||||
drop: function (event, ui) {
|
||||
const dragData = ui.helper.data('drag');
|
||||
const dropData = $(this).data('drop');
|
||||
const dragData = ui.helper.data("drag");
|
||||
const dropData = $(this).data("drop");
|
||||
|
||||
if (dragData == dropData) {
|
||||
good.play();
|
||||
ui.helper.css({ position: 'static', top: 'auto', left: 'auto' }).appendTo(this);
|
||||
ui.helper.draggable('disable');
|
||||
$(this).droppable('disable');
|
||||
ui.helper.css({ position: "static", top: "auto", left: "auto" }).appendTo(this);
|
||||
ui.helper.draggable("disable");
|
||||
$(this).droppable("disable");
|
||||
|
||||
// Verificar si todos están completados
|
||||
if ($('.drop-card:not(.ui-droppable-disabled)').length === 0) {
|
||||
if ($(".drop-card:not(.ui-droppable-disabled)").length === 0) {
|
||||
Completed();
|
||||
}
|
||||
} else {
|
||||
bad.play();
|
||||
ui.helper.draggable('option', 'revert', true);
|
||||
ui.helper.draggable("option", "revert", true);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -313,10 +332,11 @@
|
||||
const html = $("#pop0").html();
|
||||
Swal.fire({
|
||||
html: html,
|
||||
target: document.getElementById('wrap-course-content'),
|
||||
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'
|
||||
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",
|
||||
},
|
||||
confirmButtonText: "Cerrar",
|
||||
showConfirmButton: true,
|
||||
@@ -325,8 +345,7 @@
|
||||
focusConfirm: false,
|
||||
backdrop: "rgba(65, 60, 60, .95)",
|
||||
width: "35em",
|
||||
didOpen: () => {
|
||||
},
|
||||
didOpen: () => {},
|
||||
didClose: () => {
|
||||
CourseNav.audioController.stopAudio();
|
||||
//CourseNav.soundClick();
|
||||
@@ -347,22 +366,18 @@
|
||||
//igualarAlturaBgCustomTransparent();
|
||||
});
|
||||
|
||||
|
||||
// Ajustar altura de todos los elementos .bg-custom-transparent al más alto
|
||||
function igualarAlturaBgCustomTransparent() {
|
||||
var maxHeight = 0;
|
||||
$('.bg-custom-transparent').each(function () {
|
||||
$(this).css('height', 'auto'); // Resetear altura para medir correctamente
|
||||
$(".bg-custom-transparent").each(function () {
|
||||
$(this).css("height", "auto"); // Resetear altura para medir correctamente
|
||||
var h = $(this).outerHeight();
|
||||
if (h > maxHeight) maxHeight = h;
|
||||
});
|
||||
$('.bg-custom-transparent').css('height', maxHeight + 'px');
|
||||
$(".bg-custom-transparent").css("height", maxHeight + "px");
|
||||
}
|
||||
|
||||
/* $(window).on('resize', igualarAlturaBgCustomTransparent);
|
||||
igualarAlturaBgCustomTransparent(); */
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user