wip pdf
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<transition name="fade" mode="out-in">
|
||||
<component
|
||||
:is="currentSliceComponent"
|
||||
:id="currentSliceId"
|
||||
:key="currentSliceId"
|
||||
:data="currentSlice"
|
||||
:current-index="currentQuestionIndex"
|
||||
@@ -83,12 +84,12 @@ export default {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// Al montar, escuchar el evento de recarga/cierre
|
||||
//Al montar, escuchar el evento de recarga/cierre
|
||||
window.addEventListener("beforeunload", this.clearStorageOnReload)
|
||||
},
|
||||
|
||||
beforeUnmount() {
|
||||
// Limpiar el listener al desmontar el componente
|
||||
//Limpiar el listener al desmontar el componente
|
||||
window.removeEventListener("beforeunload", this.clearStorageOnReload)
|
||||
},
|
||||
|
||||
@@ -110,7 +111,7 @@ export default {
|
||||
sectionId: this.currentSlice.section.id,
|
||||
sectionTitle: this.currentSlice.section.title,
|
||||
sliceId: this.currentSlice.id,
|
||||
value: event.value,
|
||||
value: event.value || event,
|
||||
score: event.score,
|
||||
questionTotalPoints: this.currentSlice.questionTotalPoints || 0,
|
||||
}
|
||||
@@ -169,7 +170,7 @@ export default {
|
||||
|
||||
saveAnswer(payload) {
|
||||
// payload: { id: "question1", value: "Si" }
|
||||
////console.log("Guardando respuesta:", payload)
|
||||
//console.log("Guardando respuesta - Payload:", payload)
|
||||
let el;
|
||||
if (typeof payload !== "object") {
|
||||
el = {
|
||||
@@ -180,7 +181,7 @@ export default {
|
||||
} else {
|
||||
el = payload
|
||||
}
|
||||
////console.log("Guardando respuesta:", el)
|
||||
//console.log("Guardando respuesta - Final:", el)
|
||||
this.answers.push(el)
|
||||
localStorage.setItem("answers", JSON.stringify(this.answers))
|
||||
},
|
||||
@@ -212,9 +213,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
calculateFinalScore() {
|
||||
const results = JSON.parse(localStorage.getItem('results'))
|
||||
if (results && results.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user