diff --git a/src/cuestionario_respondido/cuestionario_respondido.service.ts b/src/cuestionario_respondido/cuestionario_respondido.service.ts index de9f5d1..cf248a9 100644 --- a/src/cuestionario_respondido/cuestionario_respondido.service.ts +++ b/src/cuestionario_respondido/cuestionario_respondido.service.ts @@ -420,12 +420,14 @@ recibas tu constancia.

cr.id_cuestionario_respondido, cr.fecha_respuesta, p.id_participante, - p.correo AS correo_participante + p.correo AS correo_participante, + pe.fecha_asistencia FROM cuestionario_respondido cr JOIN participante p ON cr.id_participante = p.id_participante + LEFT JOIN participante_evento pe ON p.id_participante = pe.id_participante AND pe.id_evento = ? WHERE cr.id_cuestionario = ? ORDER BY cr.fecha_respuesta DESC - `, [idCuestionario]); + `, [cuestionario.evento ? cuestionario.evento.id_evento : null, idCuestionario]); // Obtener todas las respuestas para este cuestionario const respuestasAbiertas = await this.dataSource.query(` @@ -481,7 +483,8 @@ recibas tu constancia.

const encabezados = [ 'ID Participante', 'Correo', - 'Fecha Respuesta' + 'Fecha Respuesta', + 'Asistencia' ]; // Agregar cada pregunta como un encabezado @@ -496,7 +499,8 @@ recibas tu constancia.

const fila = [ participante.id_participante.toString(), participante.correo_participante, - new Date(participante.fecha_respuesta).toLocaleString() + new Date(participante.fecha_respuesta).toLocaleString(), + participante.fecha_asistencia ? 'Sí' : 'No' ]; // Agregar cada respuesta en el orden de las preguntas