back 1.0.38 y front 1.0.39 cambios en condicionales de sub preguntas, solo boleanos

This commit is contained in:
2025-11-25 22:43:14 -03:00
parent 1ef07ad2c5
commit 4c8938a24e
4 changed files with 147 additions and 138 deletions

View File

@@ -1062,12 +1062,12 @@ def create_answer(
if not question:
raise HTTPException(status_code=404, detail="Pregunta no encontrada")
# Calcular puntos según status
# Sistema simplificado: 1 punto por pregunta correcta
points_earned = 0
if answer.status == "ok":
points_earned = question.points
points_earned = 1
elif answer.status == "warning":
points_earned = int(question.points * 0.5)
points_earned = 0.5
# Buscar si ya existe una respuesta para esta inspección y pregunta
existing_answer = db.query(models.Answer).filter(