Enhance form rendering with crispy forms and improve answer timestamp handling in collection views

This commit is contained in:
Ross
2025-10-13 13:22:26 +01:00
parent ed4bd95955
commit a3712959ec
3 changed files with 34 additions and 19 deletions
+1 -5
View File
@@ -2947,11 +2947,7 @@ def collection_case_view_take(
"cid_user_exam": cid_user_exam,
"question_completed": question_completed,
"self_review": self_review,
# Provide a canonical start timestamp (prefer answer.started_at, then cid_user_exam.start_time)
"answer_started_at_iso": (
(answer.started_at.isoformat() if getattr(answer, 'started_at', None) else None)
or (cid_user_exam.start_time.isoformat() if getattr(cid_user_exam, 'start_time', None) else None)
),
"answer_started_at_iso": answer.started_at.isoformat() if answer and getattr(answer, 'started_at', None) else None,
},
)