Let the model handle this. If you're worried about code duplication, you can do something like:

```python
model_kwargs = {
    "student_item": student_item,
    "answer": answer,
    "attempt_number": attempt_number,
}
if submitted_at:
    model_kwargs["submitted_at"] = submitted_at

submission = Submission.objects.create(**model_kwargs)

```