-
-
Save parzibyte/9b4e0b49a490910b657bc8e58d344844 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("DOMContentLoaded", () => { | |
const datosEstudianteCodificados = sessionStorage.getItem("datosEstudiante"); | |
// No hay datos | |
if (!datosEstudianteCodificados) { | |
return alert("No hay datos guardados. Asegúrate de enviar el formulario"); | |
} | |
const datosEstudiante = JSON.parse(datosEstudianteCodificados); | |
const notaLaboratorio = (datosEstudiante.notaTaller1 + datosEstudiante.notaTaller2) / 2; | |
const notaUnidad = (notaLaboratorio * 4 / 10) + (datosEstudiante.notaParcial * 6 / 10); | |
document.querySelector("#nombreEstudiante").textContent = datosEstudiante.nombreEstudiante; | |
document.querySelector("#carnetEstudiante").textContent = datosEstudiante.carnetEstudiante; | |
document.querySelector("#nombreAsignatura").textContent = datosEstudiante.nombreAsignatura; | |
document.querySelector("#notaTaller1").textContent = datosEstudiante.notaTaller1; | |
document.querySelector("#notaTaller2").textContent = datosEstudiante.notaTaller2; | |
document.querySelector("#notaParcial").textContent = datosEstudiante.notaParcial; | |
document.querySelector("#notaLaboratorio").textContent = notaLaboratorio; | |
document.querySelector("#notaFinal").textContent = notaUnidad; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment